14. Add Cognito ID to your app delegate: add Cognito code containing your identity pool ID to the didFinishLaunchingWithOptions delegate method of your AppDelegate.swift file.

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. /// Setup AWS Cognito credentials let credentialsProvider = AWSCognitoCredentialsProvider( regionType: AWSRegionType.USEast1, identityPoolId: “us-east-1:7d5b4064-d730–44ae-a1c3-bdc3d8bdf195”) let defaultServiceConfiguration = AWSServiceConfiguration( region: AWSRegionType.USEast1, credentialsProvider: credentialsProvider) AWSServiceManager.default().defaultServiceConfiguration = defaultServiceConfiguration return true }

15. Enable push capability: enable push notifications in YourProject -> Target -> Capabilities.

16. Register for push notifications: add a line of code that registers your app for push notifications. In the didFinishLaunchingWithOptions delegate method of your AppDelegate.swift file, insert this line of code before returning the true boolean.

registerForPushNotifications(application: application)

17. Implement push notifications for the application:

a) Import the native UserNofications package: import the iOS's native UserNotifications package in order to turn your app into a notification center.

import UserNotifications

b) Make your app delegate a subclass of UNUserNotificationCenterDelegate: make your application a subclass of UNUserNotificationCenterDelegate in order to implement delegate methods that enable push notifications.

class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate {

c) Implement the registerForPushNotifications method: implement the registerForPushNotifications method you included earlier in step 16.

func registerForPushNotifications(application: UIApplication) { /// The notifications settings if #available(iOS 10.0, *) { UNUserNotificationCenter.current().delegate = self UNUserNotificationCenter.current().requestAuthorization(options: [.badge, .sound, .alert], completionHandler: {(granted, error) in if (granted) { UIApplication.shared.registerForRemoteNotifications() } else{ //Do stuff if unsuccessful… } }) } else { let settings = UIUserNotificationSettings(types: [UIUserNotificationType.alert, UIUserNotificationType.badge, UIUserNotificationType.sound], categories: nil) application.registerUserNotificationSettings(settings) application.registerForRemoteNotifications() } }

d) Implement the userNotificationCenter delegate methods: implement the userNofificationCenter methods that make the notification center work.

// Called when a notification is delivered to a foreground app. @available(iOS 10.0, *) func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { print(“User Info = “,notification.request.content.userInfo) completionHandler([.alert, .badge, .sound]) } // Called to let your app know which action was selected by the user for a given notification. @available(iOS 10.0, *) func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { print(“User Info = “,response.notification.request.content.userInfo) completionHandler() }

18. Enable SNS ability in the role you created: enable SNS capability for the role you created in step 12.

a) Go to IAM: go to the AWS dashboard and click "IAM" under "Security, Identity & Compliance".

b) Click on "Roles": click on "Roles" to see the authorized and unauthorized roles that have been created for your application.

c) Click on the unauthenticated role of your application: open the unauthenticated role of you application. The role will be named Cognito_<Indentity Pool Name>Unauth_Role.