> For the complete documentation index, see [llms.txt](https://docs.taptalk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.taptalk.io/onetalk-omnichannel-documentation/onetalk-channel-integration/live-chat/onetalk-live-chat-for-react-native/get-started-ios.md). Agents can also search and read this documentation through its [MCP server](https://docs.taptalk.io/~gitbook/mcp).

# Get Started - iOS

This section will cover a step-by-step approach to bridge your React Native project to OneTalk Live Chat iOS SDK. We will be using Xcode to configure native code in the React Native project.

{% hint style="warning" %}
**Before you get started:** Make sure you have [**created a channel in OneTalk dashboard**](https://docs.taptalk.io/onetalk-omnichannel-documentation/onetalk-channel-integration/live-chat.md#setup-live-chat-for-ios) and obtain the **`APP_KEY_SECRET.`**` `&#x20;
{% endhint %}

### Configure and Initialize TapTalk.io Omnichannel iOS SDK for React Native project

#### Step 1: Install TapTalk.io Omnichannel iOS SDK

**Option 1: Swift Package Manager (Recommended)**

{% hint style="info" %}
If you have previously implemented the SDK from Cocoapods and is migrating to Swift Package Manager, please uninstall it first by removing `pod 'TapTalkLive'` from your Podfile and then run `pod install`.

If you have no other pods in use and want to remove Cocoapods completely from your project, run `pod deintegrate` instead.
{% endhint %}

To add TapTalk.io package to your project, open your project in Xcode, then go to menu bar then select **File -> Add Package Dependencies**, then enter [**https://github.com/taptalk-io/taptalk.io-omnichannel-ios**](https://github.com/taptalk-io/taptalk.io-omnichannel-ios) in the top right search bar.

<figure><img src="https://4266585843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LfVupFSqh_qZAY9OiCO%2Fuploads%2Fcp30LmjrxtSDW6jTXi9s%2Fimage.png?alt=media&amp;token=7bac1400-3b1f-4b66-ae6e-82115b7a41b7" alt=""><figcaption></figcaption></figure>

Select **taptalk.io-omnichannel-ios**, specify the version and your project, then click **Add Package**.

{% hint style="info" %}
You can check a more updated version release notes of the SDK [here](https://github.com/taptalk-io/taptalk.io-omnichannel-ios/tags).
{% endhint %}

After the package is resolved, select your project from the Project navigator (folder icon at the top left pane), click the required target, go to **General** tab and make sure **OneTalkLiveChat** is added to Frameworks and Libraries, if not, add it with the **+** button, then add OneTalkLiveChat from TapTalkLive Package.

<figure><img src="https://4266585843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LfVupFSqh_qZAY9OiCO%2Fuploads%2FiImQoo4zuD1Hx0GAvolg%2Fimage.png?alt=media&amp;token=8d2cdf7e-77a5-46e9-8ed9-66838a075898" alt=""><figcaption></figcaption></figure>

**Option 2: Cocoapods**

{% hint style="info" %}
As of December 2026, Cocoapods is set to be read-only. At that point, no new versions or pods will be added to trunk.

We recommend implementing the SDK with Swift Package Manager instead.
{% endhint %}

You can install the TapTalk.io Omnichannel iOS SDK using [CocoaPods](https://cocoapods.org/) like the following. If you are new to CocoaPods, you can see more information in [Cocoapods guides](https://guides.cocoapods.org/using/getting-started.html). First, navigate to the *ios* folder of your React Native project directory, and check if a file named **Podfile** exists. If there is no **Podfile** in the *ios* folder, we will create a new one using terminal. Open a terminal window and navigate to the *ios* directory of your React Native project, then create a **Podfile** by running the following command in the terminal:

```
$ pod init
```

Then **Podfile** will be created in your project directory. Open the **Podfile** and add the following lines to the **Podfile**.

```ruby
# Please make sure you define platform on your Podfile
# Make sure to use ios 11.0 for minimum deployment target

platform :ios, '11.0'

target "YourProjectName" do
    
    ...
    
    pod 'TapTalkLive'
    pod 'JSONModel', '1.8.0', :modular_headers => true
    
endru
```

{% hint style="warning" %} <mark style="color:red;">**Note**</mark><mark style="color:red;">:</mark> <mark style="color:red;"></mark><mark style="color:red;">**For SDK version 1.1.0 and above,  remove**</mark><mark style="color:red;">**`use_frameworks!`**</mark><mark style="color:red;">**&#x20;**</mark><mark style="color:red;">**and add additional pod implementation with modular headers to handle some compatibility issues.**</mark>

For versions below 1.1.0, please remove **`pod 'AFNetworking`**' and **`pod 'JSONModel'`** implementation on the code above with **`use_frameworks!`**
{% endhint %}

{% hint style="warning" %}
**Note:** Please make sure you implement ios version 11.0`platform :ios, '11.0'` for minimum deployment target to obtain latest update of TapTalk.io SDK
{% endhint %}

{% hint style="warning" %}
**Note:** If you are using SDK version lower than 1.1.0 and your **podfile** has Flipper enabled, disable it by commenting the following lines to enable `use_frameworks!`.
{% endhint %}

```ruby
#use_flipper!
#post_install do |installer|
#  flipper_post_install(installer)
#end
```

Next, open your terminal window and move to the *ios* directory of your React Native project, then install the updated pod by running this command in your terminal:

```bash
$ pod install
```

#### Step 2: Open React Native project's ios workspace in Xcode

After the pod has finished installing, navigate to the *ios* folder inside your React Native project root folder and locate a file named **YourProjectName.xcworkspace**, then open this file with Xcode. We will follow the next steps by configuring the project from Xcode.

#### Step 3: Grant permission in your application project

To make sure TapTalk.io Omnichannel iOS have all permission to access user's media, file, location, and contact, the application needs to ask for permissions. Go to your **info.plist**, and add the following key-value pairs.

| Information Property Key                            | Information Property Value                                                                                                                                                             |
| --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Privacy - Camera Usage Description                  | $(PRODUCT\_NAME) needs to request access to your camera to take profile picture and to send image chat.                                                                                |
| Privacy - Contacts Usage Description                | $(PRODUCT\_NAME) need your permission to access your contact, we will sync your contact to our server and automatically find your friend so it is easier for you to find your friends. |
| Privacy - Photo Library Additions Usage Description | $(PRODUCT\_NAME) needs to request access to your photo library to save photo.                                                                                                          |
| Privacy - Photo Library Usage Description           | $(PRODUCT\_NAME) needs to request access to your photo library to take profile picture and to send image chat.                                                                         |
| Privacy - Location When In Use Usage Description    | $(PRODUCT\_NAME) needs to request access to your location to send location chat.                                                                                                       |

{% hint style="info" %}
**Note**: You can change **Information Property Value** based on your own preferences. These values will appear when the application requests permission from the user.
{% endhint %}

![Adding new key in info.plist](https://4266585843-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LfVupFSqh_qZAY9OiCO%2F-LzpjUyPVVETR4wSOgJn%2F-LzpjgZSXJKtiMFJ6Edq%2F8b43524-Screen_Shot_2019-08-28_at_13.57.43.png?alt=media\&token=f8fb75d2-8578-4456-ba53-0bda817a7a09)

#### Step 4: Enable background modes

Background modes is required to handle background process in TapTalk.io. It is used to run some processes in the background before the app is killed. For more information about the processes, check out the [background process section](https://docs.taptalk.io/onetalk-omnichannel-documentation/onetalk-channel-integration/live-chat/onetalk-ios/background-process-in-taptalklive-ios.md).

To enable **background modes**, go to **Target** -> **Capabilities**, then turn **Background Modes** toggle to **ON**, next select **Background fetch** and **Remote notifications**

![](https://4266585843-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LfVupFSqh_qZAY9OiCO%2F-LzpjoPXCyDtXUTiNSXg%2F-Lzpk4nGaQ8fBhUqHqNN%2Feaab744-Screen_Shot_2019-08-28_at_13.37.54.png?alt=media\&token=7a41a275-97e7-48aa-a11a-ee283d9ac68e)

After you turn on the **Background Modes**, **Required background modes** key will be added automatically in your **Info.plist** as shown below.

![](https://4266585843-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LfVupFSqh_qZAY9OiCO%2F-LzpjoPXCyDtXUTiNSXg%2F-LzpkK_5kgOcDdlpGK5k%2F979a00b-Screen_Shot_2019-08-28_at_13.44.36.png?alt=media\&token=3da5a3ec-927b-461a-98b7-626c3ac5a7f7)

#### Step 5: Initialize TapTalk.io Omnichannel iOS in your application class

In order to use TapTalk.io Omnichannel, you must first initialize an instance by passing the `APP_KEY_SECRET` and `API_BASE_URL` assigned to your application to the `initWithSecretKey:` method as a parameter. Generally, initialization is implemented in the **appDelegate** `application:didFinishLaunchingWithOptions:` method.

{% tabs %}
{% tab title="Objective-C" %}
{% code title="AppDelegate.m" %}

```objective-c
// For version 3.0.0 and above
#import "OneTalkLiveChat.h"

// For versions below 3.0.0
#import <TapTalkLive/TapTalkLive.h>

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Initialize TapTalkLive
    [[TapTalkLive sharedInstance] initWithSecretKey:APP_KEY_SECRET
    success:^{
        // Succcessfully initialized TapTalkLive
    }
    failure:^(NSString *errorMessage) {
        // Failed to initialize
    }];
    
    return YES;
}
```

{% endcode %}
{% endtab %}

{% tab title="Swift" %}
{% code title="AppDelegate.swift" %}

```swift
import OneTalkLiveChat

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
    // Initialize TapTalkLive
    TapTalkLive.sharedInstance().initWithSecretKey(APP_KEY_SECRET) {
        // Succcessfully initialized TapTalkLive
    }
    failure: { errorMessage in
        // Failed to initialize
    }

    return true
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Parameters**\
**`APP_KEY_SECRET`**: (String) application key Secret
{% endhint %}

#### Step 6: Initialize TapTalk.io Omnichannel 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 Omnichannel, you have to connect and implement these methods in your **`UIApplicationDelegate`** methods in **appDelegate** file to make sure TapTalk.io Omnichannel runs smoothly in your application.

| TapTalk.io Omnichannel 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.                                        |
| `handleException:`                                 | Tells the delegate when application throws exception.                                         |

{% tabs %}
{% tab title="Objective-C" %}
{% code title="AppDelegate.m" %}

```objective-c
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Implement TapTalkLive didFinishLaunchingWithOptions here
    [[TapTalkLive sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
    
    // Initialize TapTalkLive
    [[TapTalkLive sharedInstance] initWithSecretKey:...];
    
    return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application {
    // Implement TapTalkLive applicationWillResignActive here
    [[TapTalkLive sharedInstance] applicationWillResignActive:application];
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
    // Implement TapTalkLive applicationDidEnterBackground here
    [[TapTalkLive sharedInstance] applicationDidEnterBackground:application];
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
    // Implement TapTalkLive applicationWillEnterForeground here
    [[TapTalkLive sharedInstance] applicationWillEnterForeground:application];
}
  
- (void)applicationDidBecomeActive:(UIApplication *)application {
    // Implement TapTalkLive applicationDidBecomeActive here
    [[TapTalkLive sharedInstance] applicationDidBecomeActive:application];
}

- (void)applicationWillTerminate:(UIApplication *)application {
    // Implement TapTalkLive applicationWillTerminate here
    [[TapTalkLive sharedInstance] applicationWillTerminate:application];
}
```

{% endcode %}
{% endtab %}

{% tab title="Swift" %}
{% code title="AppDelegate.swift" %}

```swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
    // Implement TapTalk Omnichannel didFinishLaunchingWithOptions here
    TapTalkLive.sharedInstance().application(application, didFinishLaunchingWithOptions:launchOptions)
    
    // Initialize TapTalkLive
    TapTalkLive.sharedInstance().initWithSecretKey(...)

    return true
}

func applicationWillResignActive(_ application: UIApplication) {
    // Implement TapTalk Omnichannel applicationWillResignActive here
    TapTalkLive.sharedInstance().applicationWillResignActive(application)
}

func applicationDidEnterBackground(_ application: UIApplication) {
    // Implement TapTalkLive applicationDidEnterBackground here
    TapTalkLive.sharedInstance().applicationDidEnterBackground(application)
}

func applicationWillEnterForeground(_ application: UIApplication) {
    // Implement TapTalkLive applicationWillEnterForeground here
    TapTalkLive.sharedInstance().applicationWillEnterForeground(application)
}

func applicationDidBecomeActive(_ application: UIApplication) {
    // Implement TapTalkLive applicationDidBecomeActive here
    TapTalkLive.sharedInstance().applicationDidBecomeActive(application)
}

func applicationWillTerminate(_ application: UIApplication) {
    // Implement TapTalkLive applicationWillTerminate here
    TapTalkLive.sharedInstance().applicationWillTerminate(application)
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

To register uncaught exception handler, call `NSSetUncaughtExceptionHandler(&handleExceptions)` in `application:didFinishLaunchingWithOptions:` callback and add delegate function `handleExceptions`.

{% tabs %}
{% tab title="Objective-C" %}

<pre class="language-objective-c" data-title="AppDelegate.m"><code class="lang-objective-c">- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Implement TapTalkLive didFinishLaunchingWithOptions here
    [[TapTalkLive sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
    
    // Initialize TapTalkLive
    [[TapTalkLive sharedInstance] initWithSecretKey:...];
    
    // Register Uncaught Exception Handler
    NSSetUncaughtExceptionHandler(&#x26;handleExceptions);
    
    return YES;
}

// Add delegate function to handle exceptions
- (void)handleExceptions:(NSException *exception) {
    // Implement TapTalkLive handleException method
<strong>    [[TapTalkLive sharedInstance] handleException:exception];
</strong>}
</code></pre>

{% endtab %}

{% tab title="Swift" %}
{% code title="AppDelegate.m" %}

```swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
    // Implement TapTalk Omnichannel didFinishLaunchingWithOptions here
    TapTalkLive.sharedInstance().application(application, didFinishLaunchingWithOptions:launchOptions)
    
    // Initialize TapTalkLive
    TapTalkLive.sharedInstance().initWithSecretKey(...)
    
    // Register Uncaught Exception Handler
    NSSetUncaughtExceptionHandler(handleException)
    
    return true
}

// Add delegate function to handle exceptions
let handleException: @convention(c) (NSException) -> Void = { exception in
    // Implement TapTalkLive handleException method
    TapTalkLive.sharedInstance().handle(exception)
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="warning" %}
**Note**: Don't forget to register for exception handler inside **`application:didFinishLaunchingWithOptions:`**&#x6D;ethod and implement **`handleExceptions`** method in **appDelegate** class to make sure TapTalk.io able to handle exceptions.
{% endhint %}

#### **Step 7: Create a method in AppDelegate to navigate to OneTalk Live Chat View**

After the configurations above are completed, we will add a method named `navigateToOneTalk` in the project's AppDelegate to navigate to OneTalk Live Chat view. Open your **AppDelegate.m** file and add the following:

{% tabs %}
{% tab title="Objective-C" %}
{% code title="AppDelegate.m" %}

```objective-c
// For version 3.0.0 and above
#import "OneTalkLiveChat.h"

// For versions below 3.0.0
#import <TapTalkLive/TapTalkLive.h>

@interface AppDelegate () <TapTalkLiveDelegate>

// Add a UINavigationController variable
@property (strong, nonatomic) UINavigationController *navigationController;

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Implement TapTalkLive didFinishLaunchingWithOptions here    
    [[TapTalkLive sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
    
    RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
    RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                     moduleName:@"TapLiveReactNative"
                                              initialProperties:nil];
    
    rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1.0f];
    
    _window = [[UIWindow alloc] initWithFrame:CGRectMake(0.0f, 0.0f, CGRectGetWidth([UIScreen mainScreen].bounds), CGRectGetHeight([UIScreen mainScreen].bounds))];
    
    // Initialize navigation controller
    UIViewController *rootViewController = [[UIViewController alloc] init];
    rootViewController.view = rootView;
    _navigationController = [[UINavigationController alloc] initWithRootViewController:rootViewController];
    [self.navigationController setNavigationBarHidden:YES animated:YES];
    self.window.rootViewController = self.navigationController;
    [self.window makeKeyAndVisible];
    
    // Initialize TapTalkLive
    [[TapTalkLive sharedInstance] initWithSecretKey:...];
    
    NSSetUncaughtExceptionHandler(&handleExceptions);
    
    return YES;
}

// Method to open live chat view
- (void)navigateToOneTalk {
    [[TapTalkLive sharedInstance] presentTapTalkLiveViewWithCurrentNavigationController:self.navigationController animated:ANIMATED];
}

@end
```

{% endcode %}
{% endtab %}

{% tab title="Swift" %}
{% code title="AppDelegate.swift" %}

```swift
import React
import OneTalkLiveChat

class AppDelegate: UIResponder, UIApplicationDelegate, TapTalkLiveDelegate {

    // Add a UINavigationController variable
    var navigationController: UINavigationController?
    
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
        // Implement TapTalkLive didFinishLaunchingWithOptions here    
        TapTalkLive.sharedInstance().application(application, didFinishLaunchingWithOptions:launchOptions)
    
        let bridge = RCTBridge(delegate: self, launchOptions: launchOptions)
        let rootView = RCTRootView(
            bridge: bridge,
            moduleName: "TapLiveReactNative",
            initialProperties: nil
        )
        
        rootView.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1)
    
        window = UIWindow(frame: CGRect(x: 0.0, y: 0.0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height))
        
        // Initialize navigation controller
        let rootViewController = UIViewController()
        rootViewController.view = rootView
        navigationController = UINavigationController(rootViewController: rootViewController)
        navigationController?.setNavigationBarHidden(true, animated: true)
        window.rootViewController = navigationController
        window.makeKeyAndVisible()
        
        // Initialize TapTalkLive
        TapTalkLive.sharedInstance().initWithSecretKey(...)
        
        NSSetUncaughtExceptionHandler(handleException)
        
        return true
    }
        
    // Method to open live chat view
    public func navigateToOneTalk() {
        if let navigationController {
            TapTalkLive.sharedInstance().presentView(withCurrentNavigationController: navigationController, animated: ANIMATED)
        }
    }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

For Objective-C build, open your **AppDelegate.h** file and add the following lines to enable the previously created method to be called from another file.

{% tabs %}
{% tab title="Objective-C" %}

<pre class="language-objective-c" data-title="AppDelegate.h"><code class="lang-objective-c">@interface AppDelegate : UIResponder &#x3C;UIApplicationDelegate, RCTBridgeDelegate>

<strong>- (void)navigateToOneTalk;
</strong>
@end
</code></pre>

{% endtab %}
{% endtabs %}

#### **Step 8: Create module file in the project folder**

We will create a module file that contains a react method to open OneTalk live chat view from your React Native app. To create a new file, check the left panel on your Xcode and make sure the *Project Navigator* tab (folder icon) is active. Then right click on *YourProjectName* folder (expanded from *YourProjectName.xcodeproj*), and select *New File*.

Select *Cocoa Touch Class*, then press *Next*.

![](https://4266585843-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LfVupFSqh_qZAY9OiCO%2F-MQLsHCpbN8OBEQWCESs%2F-MQVl_r0_RWRtI1q-jAY%2Fimage.png?alt=media\&token=7ad8a2a6-3e4b-4312-a867-75a3245ed2a3)

We will name this file *OneTalkStarterModule*. Select *NSObject* as the subclass and *Objective-C* as the language, then press *Next*, and press *Create* on the next window.

![](https://4266585843-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LfVupFSqh_qZAY9OiCO%2F-MQLsHCpbN8OBEQWCESs%2F-MQVlgXuM0EopSWNFdmC%2Fimage.png?alt=media\&token=40b57732-9cfe-421d-9d0c-e4c501663f55)

Two files named *OneTalkStarterModule.h* and *OneTalkStarterModule.m* will be generated in your project folder. First, open *OneTalkStarterModule.h* and update its contents with the following:

{% tabs %}
{% tab title="Objective-C" %}
{% code title="OneTalkStarterModule.h" %}

```objective-c
#import <React/RCTBridgeModule.h>

NS_ASSUME_NONNULL_BEGIN

@interface OneTalkStarterModule : NSObject <RCTBridgeModule>

@end

NS_ASSUME_NONNULL_END
```

{% endcode %}
{% endtab %}
{% endtabs %}

Then open the *OneTalkStarterModule.m* file and modify it like below:

{% tabs %}
{% tab title="Objective-C" %}
{% code title="OneTalkStarterModule.m" %}

```objective-c
#import "OneTalkStarterModule.h"
#import "AppDelegate.h"

@implementation OneTalkStarterModule

RCT_EXPORT_MODULE(OneTalkStarter);

RCT_EXPORT_METHOD(navigateToOneTalk) {
  dispatch_async(dispatch_get_main_queue(), ^{
    AppDelegate *appDelegate = (AppDelegate *) [UIApplication sharedApplication].delegate;
    [appDelegate navigateToOneTalk];
  });
}

RCT_EXPORT_METHOD(getActivityName:(RCTResponseSenderBlock) callback) {
  callback(@[@"OneTalkStarter (callback)"]);
}

@end
```

{% endcode %}

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**RCT\_EXPORT\_MODULE** exposes this module to react via a compile time macro.

**RCT\_EXPORT\_METHOD** will enable the method to be invoked from javascript of a React Native app.
{% endhint %}

#### Step 9. Open OneTalk Live Chat View

Once the module set up is done, you can find a place in your application where you would like to add a call to the native module’s `navigateToOneTalk()` method to open OneTalk Live Chat view.&#x20;

&#x20;In order to access your native module from JavaScript you need to first import `NativeModules` from React Native:

```javascript
import { NativeModules } from 'react-native';
```

You can then invoke the native method `navigateToOneTalk()` to open OneTalk Live Chat view. Here we will be using a button's  `onPress()` method as an example.

```javascript
<Button
    onPress={() => NativeModules.OneTalkStarter.navigateToOneTalk()}
    title='Launch OneTalk'
/>
```

{% hint style="info" %}
**Note**: You can check a more complete implementation guide in the [OneTalk Live Chat for iOS](https://docs.taptalk.io/onetalk-omnichannel-documentation/onetalk-channel-integration/live-chat/onetalk-ios.md) section.
{% endhint %}
