Created
October 11, 2018 16:23
-
-
Save mobilequickie/ef52ab5045126864bcb09a313ba036b1 to your computer and use it in GitHub Desktop.
This is a sample AppDelegate with the required three code snippets for adding AWSMobileClient to your project as a credentials manager
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import AWSMobileClient //#1 | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
//#2 Add this return statement for AWSMobileClient | |
return AWSMobileClient.sharedInstance().interceptApplication( | |
application, didFinishLaunchingWithOptions: | |
launchOptions) | |
} | |
// #3 Add this application:open url with AWSMobileClient singleton | |
func application(_ application: UIApplication, open url: URL, | |
sourceApplication: String?, annotation: Any) -> Bool { | |
return AWSMobileClient.sharedInstance().interceptApplication( | |
application, open: url, | |
sourceApplication: sourceApplication, | |
annotation: annotation) | |
} | |
func applicationWillResignActive(_ application: UIApplication) {} | |
func applicationDidEnterBackground(_ application: UIApplication) {} | |
func applicationWillEnterForeground(_ application: UIApplication) {} | |
func applicationDidBecomeActive(_ application: UIApplication) {} | |
func applicationWillTerminate(_ application: UIApplication) {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment