TapTalk.io Documentation
  • Introduction
  • OneTalk Omnichannel Documentation
    • Getting Started with OneTalk
      • Team Members
      • Add Topic
      • Assign Agent to Topic
      • Paid Proactive Chat
    • Channel Integration
      • Telegram Integration
      • WhatsApp SME Integration
      • Instagram DM Integration
      • Facebook Messenger Integration
      • Live Chat Integration (iOS, Android, Web)
        • OneTalk Live Chat for Android
          • Get Started
          • Event Listener
          • Authentication
          • Case & Topic
          • Navigate Live Chat UI
          • Customize UI Appearance
        • OneTalk Live Chat for iOS
          • Get Started
          • Background Process in TapTalk.io Omnichannel iOS
          • Event Delegate
          • Authentication
          • Case & Topic
          • Navigate Live Chat UI
          • Customize UI Appearance
        • OneTalk Live Chat for Web
          • Get Started
          • Callback
          • Method
        • OneTalk Live Chat for React Native
          • Get Started - Android
          • Authentication - Android
          • Get Started - iOS
          • Authentication - iOS
        • OneTalk Live Chat for Flutter
          • Get Started - Android
          • Get Started - iOS
      • Google Business Messages Integration
      • Google Business Profile Integration
      • Tokopedia Integration
    • Integration API
      • Inbox API
      • User/Contact API
    • Live Chat Widget Callback Function
    • Social Channel Button
    • Custom Chatbot Integration
      • Get Started
      • Edit or Delete Chatbot
      • Development
    • QnA via API
    • Webhook
  • PowerTalk Chat SDK Documentation
    • Getting Started with PowerTalk
    • PowerTalk Android
      • Get Started
      • Enable Chat Features
      • Authentication
      • TapUI and TapCore
      • Background Process in TapTalk.io
      • Connection
      • Event Listener
      • Push Notification
      • General
      • User
      • Room List
        • Room List - TapUI
        • Room List - TapCore
      • Chat Room and Messages
        • Chat Room and Messages - TapUI
        • Chat Room and Messages - TapCore
      • Contact
      • Message Type
      • Customize UI Appearance
      • Customize Chat Features
      • Customize Chat Message Bubble
      • Customize Navigation Bar
      • Deep Linking
      • Error Codes
    • PowerTalk iOS
      • Get Started
      • TapUI and TapCore
      • Background Process in TapTalk.io
      • Implement Application Delegate
      • Authentication
      • Connection
      • Event Delegate
      • Push Notification
      • General
      • User
      • Room List
        • Room List - TapUI
        • Room List - TapCore
      • Chat Room and Messages
        • Chat Room and Messages - TapUI
        • Chat Room and Messages - TapCore
      • Contact
      • Message Type
      • Customize UI Appearance
      • Customize Chat Features
      • Customize Chat Message Bubble
      • Customize Navigation Bar
      • Deep Linking
      • Error Codes
    • PowerTalk React Native
      • Get Started - Android
      • Get Started - iOS
    • PowerTalk Flutter
      • Get Started - Android
      • Get Started - iOS
    • Javascript SDK
      • Get Started
      • Authentication
      • Connection
      • General
      • Event Listener
      • User
      • Room List
      • Chat Room
      • Messages
      • Contact
      • Message Type
    • Server API
      • Get Started
      • Base URL
      • Authentication
      • User
      • Contact
      • Message
      • Room
    • Webhook
      • Get Started
      • Webhook Payload
  • MeetTalk SDK Documentation
    • Getting Started with MeetTalk
    • MeetTalk Android
      • Get Started
      • Event Listener
    • MeetTalk iOS
      • Get Started
      • Implement Application Delegate
      • Event Delegate
  • SendTalk API Documentation
    • Introduction
    • Whatsapp Verification
Powered by GitBook
On this page

Was this helpful?

  1. MeetTalk SDK Documentation
  2. MeetTalk iOS

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 MeetTalk, 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.

If you have previously implemented PowerTalk SDK in your app, simply import MeeTalk.h class to your AppDelegate, then change TapTalk to MeetTalk the application delegate method implementations

Application Delegate Method

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.

AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  
    //Implement TapTalk didFinishLaunchingWithOptions here    
    [[MeetTalk sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
    
    //Other code
    ...
    ...
    
    return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application {
  
    //Implement TapTalk applicationWillResignActive here
    [[MeetTalk sharedInstance] applicationWillResignActive:application];
  
    //Other code
    ...
    ...
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
    //Implement TapTalk applicationDidEnterBackground here
    [[MeetTalk sharedInstance] applicationDidEnterBackground:application];
  
    //Other code
    ...
    ...
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
  
    //Implement TapTalk applicationWillEnterForeground here
    [[MeetTalk sharedInstance] applicationWillEnterForeground:application];
  
    //Other code
    ...
    ...
  }
  
- (void)applicationDidBecomeActive:(UIApplication *)application {
  
    //Implement TapTalk applicationDidBecomeActive here    
    [[MeetTalk sharedInstance] applicationDidBecomeActive:application];
  
    //Other code
    ...
    ...
}

- (void)applicationWillTerminate:(UIApplication *)application {
  
    //Implement TapTalk applicationWillTerminate here
    [[MeetTalk sharedInstance] applicationWillTerminate:application];
  
    //Other code
    ...
    ...
}

Note: You have to implement application:didRegisterForRemoteNotificationsWithDeviceToken and application:didReceiveRemoteNotification to handle and receive notification from TapTalk.io.

AppDelegate.m
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
  
    //Implement TapTalk application:didRegisterForRemoteNotificationsWithDeviceToken here
    [[MeetTalk sharedInstance] application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
  
    //Other code
    ...
    ...
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {
  
    //Implement TapTalk application:didReceiveRemoteNotification:fetchCompletionHandler here
    [[MeetTalk sharedInstance] application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
  
    //Other code
    ...
    ...
}

You have to add below code NSSetUncaughtExceptionHandler(&handleExceptions); in application:didFinishLaunchingWithOptions:method to register uncaught exception handler and add delegate function handleExceptions.

AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

  //Register Uncaught Exception Handler
  NSSetUncaughtExceptionHandler(&handleExceptions);
}

//Add delegate function to handle exceptions
void handleExceptions(NSException *exception) {
  //Implement TapTalk.io handleException method
  [[MeetTalk sharedInstance] handleException:exception];
}

Note: Don't forget to register for exception handler inside application:didFinishLaunchingWithOptions: method and implement handleExceptions method in appDelegate class to make sure TapTalk.io able to handle exceptions.

PreviousGet StartedNextEvent Delegate

Last updated 2 years ago

Was this helpful?