Implement Application Delegate
To allow the iOS SDK to respond to the connection and state changes in your iOS client app, you have to implement all of our application delegate methods in your UIApplicationDelegate methods in appDelegate file.
After you initialize the TapTalk.io, you have to connect and implement these methods in your UIApplicationDelegate methods in appDelegate file to make sure TapTalk.io runs smoothly in your application.
TapTalk Application Delegate Metho
Description
application:didFinishLaunchingWithOptions
Tells the delegate that the launch process is almost done and the app is almost ready to run.
applicationWillResignActive:
Tells the delegate that the app is about to become inactive.
applicationDidEnterBackground:
Tells the delegate that the app is now in the background.
applicationWillEnterForeground:
Tells the delegate that the app is about to enter the foreground.
applicationDidBecomeActive:
Tells the delegate that the app has become active.
applicationWillTerminate:
Tells the delegate when the app is about to terminate.
application:
didRegisterForRemoteNotificationsWithDeviceToken:
Tells the delegate that the app successfully registered with Apple Push Notification service (APNs).
application:didReceiveRemoteNotification:
fetchCompletionHandler:
Tells the app that a remote notification arrived that indicates there is data to be fetched.
handleException:
Tells the delegate when application throws exception.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Implement TapTalk didFinishLaunchingWithOptions here
[[TapTalk sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
// Initialize TapTalk
[[TapTalk sharedInstance] initWithAppKeyID:...];
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application {
// Implement TapTalk applicationWillResignActive here
[[TapTalk sharedInstance] applicationWillResignActive:application];
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
// Implement TapTalk applicationDidEnterBackground here
[[TapTalk sharedInstance] applicationDidEnterBackground:application];
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
// Implement TapTalk applicationWillEnterForeground here
[[TapTalk sharedInstance] applicationWillEnterForeground:application];
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
// Implement TapTalk applicationDidBecomeActive here
[[TapTalk sharedInstance] applicationDidBecomeActive:application];
}
- (void)applicationWillTerminate:(UIApplication *)application {
// Implement TapTalk applicationWillTerminate here
[[TapTalk sharedInstance] applicationWillTerminate:application];
}To register uncaught exception handler, call NSSetUncaughtExceptionHandler(&handleExceptions) in application:didFinishLaunchingWithOptions: callback and add delegate function handleExceptions.
Last updated