> 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/powertalk-chat-sdk-documentation/powertalk-react-native/get-started-ios.md).

# Get Started - iOS

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

## Quick Start

TapTalk.io helps you to implement real-time chat with any type of your client app with speed and efficiency. Our iOS SDK provides you with various methods to initialize, configure, and build the chat from the client-side - no server-side implementation is required because our reliable infra management service is delivered with the SDK. This page presents a brief overview of the SDK’s structure and abilities, then lets you go through the preliminary steps of implementing the SDK in your own app.

## Configure and Initialize TapTalk.io iOS SDK

#### **Step 1: Create a new application from your dashboard**

**1.** Login to [TapTalk.io Dashboard](https://taptalk.io/), then choose **Development** -> **Apps**

![](https://4266585843-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LfVupFSqh_qZAY9OiCO%2F-MHKsq4vOlouRa03adbb%2F-MHKvQJYwokZj2SvRd6U%2F08a4ad0-Screenly_-_9.0_Development_-_Apps_-_Empty_State2x.png?alt=media\&token=6f629f44-d932-400f-984d-2fb1a1f0e408)

**2**. Click **New App** Button, input **App Name** and choose **Platform**, and then click **Create New App** Button.

![](https://4266585843-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LfVupFSqh_qZAY9OiCO%2F-MHKsq4vOlouRa03adbb%2F-MHKxC_cD1-kv3lPxiSk%2F58201a8-Screenly_-_9.1.0_Development_-_Apps_-_New_App_-_Empty_State2x.png?alt=media\&token=ab2fe069-a0b6-4d22-86d3-fdd8e51c235f)

![](https://4266585843-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LfVupFSqh_qZAY9OiCO%2F-MHKsq4vOlouRa03adbb%2F-MHKxGJV7RBtqLBu8UwT%2Ff2a1418-Screenly_-_9.1.1_Development_-_Apps_-_New_App_-_Filled2x.png?alt=media\&token=5b628aa3-05ec-47e9-98ef-dbc2c23de5bc)

**3.** A pop-up dialog will be shown with provided **App Key ID** & **App Key Secret**

![](https://4266585843-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LfVupFSqh_qZAY9OiCO%2F-MHKsq4vOlouRa03adbb%2F-MHKxQLyhxLOunGM05hx%2Ff869a40-Screenly_-_9.1.3_Development_-_Apps_-_New_App_-_Your_App_Key_-_Dismiss2x.png?alt=media\&token=b7bfb1cb-65ff-47e6-beda-69011f5addb8)

{% hint style="warning" %}
**Note:** Please remember to save your **App Key ID** & your **App Key Secret** because it will only be shown once and will be used in [TapTalk.io initialization](/powertalk-chat-sdk-documentation/powertalk-ios/get-started.md#step-5-initialize-taptalk-io-in-your-application-class)
{% endhint %}

#### Step 2: Install TapTalk.io 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 'TapTalk'` 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-ios**](https://github.com/taptalk-io/taptalk.io-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%2Fq8gO88G7PubEN7L39EYY%2Fimage.png?alt=media&amp;token=34c504d1-d389-47b0-ad07-a66a4349aefd" alt=""><figcaption></figcaption></figure>

Select **taptalk.io-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-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 **PowerTalk** is added to Frameworks and Libraries, if not, add it with the **+** button, then add PowerTalk from TapTalk Package.

<figure><img src="https://4266585843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LfVupFSqh_qZAY9OiCO%2Fuploads%2Fs7dbsg63xBQSkes5t74t%2Fimage.png?alt=media&amp;token=5124aaea-8734-4271-8896-4efc2efd4bdc" 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:

```bash
$ pod init
```

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

{% tabs %}
{% tab title="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'
use_modular_headers!

target "YourProjectName" do
    pod 'TapTalk'
end
```

{% endtab %}
{% endtabs %}

{% 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.4.1 and above,**</mark><mark style="color:red;">**&#x20;**</mark><mark style="color:red;">**`use_frameworks!`**</mark><mark style="color:red;">**&#x20;**</mark><mark style="color:red;">**is replaced with**</mark><mark style="color:red;">**&#x20;**</mark><mark style="color:red;">**`use_modular_headers!`**</mark><mark style="color:red;">**&#x20;**</mark><mark style="color:red;">**to handle some compatibility issues.**</mark>

For versions below 1.4.1, please replace **`use_modular_headers!`** 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.4.1 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
```

Since TapTalk.io use uses **`git-lfs`** (Git Large Files Storage) you will need to install **GIT LFS** to clone/install TapTalk.io SDK through **Cocoapods**.

{% hint style="warning" %}
**Note**: Make sure to install **`git-lfs`**&#x62;efore pod install, otherwise the pod install / pod update will be error&#x20;
{% endhint %}

Easiest way to install [git-lfs](https://git-lfs.github.com) is using [brew](https://brew.sh):

{% tabs %}
{% tab title="Terminal" %}

```bash
brew install git-lfs
git lfs install
```

{% endtab %}
{% endtabs %}

Next, after the **`git-lfs`** is installed, install the TapTalk.io through CocoaPods.

{% tabs %}
{% tab title="Terminal" %}

```bash
$ pod install
```

{% endtab %}
{% endtabs %}

#### Step 3: 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 4: Grant permission in your application project

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

<table data-header-hidden><thead><tr><th width="339">Information Property Key</th><th>Information Property Value</th></tr></thead><tbody><tr><td><strong>Information Property Key</strong></td><td><strong>Information Property Value</strong></td></tr><tr><td>Privacy - Camera Usage Description</td><td>$(PRODUCT_NAME) needs to request access to your camera to take profile picture and to send image chat.</td></tr><tr><td>Privacy - Contacts Usage Description</td><td>$(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.</td></tr><tr><td>Privacy - Photo Library Additions Usage Description</td><td>$(PRODUCT_NAME) needs to request access to your photo library to save photo.</td></tr><tr><td>Privacy - Photo Library Usage Description</td><td>$(PRODUCT_NAME) needs to request access to your photo library to take profile picture and to send image chat.</td></tr><tr><td>Privacy - Location When In Use Usage Description</td><td>$(PRODUCT_NAME) needs to request access to your location to send location chat.</td></tr></tbody></table>

{% hint style="info" %}
**Note:** You can change **Information Property Value** based on your own words and will be appears when the application needs the permission.
{% endhint %}

![](https://4266585843-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LfVupFSqh_qZAY9OiCO%2F-MHKsq4vOlouRa03adbb%2F-MHLISj3JHnpzjIeKv5r%2F8b43524-Screen_Shot_2019-08-28_at_13.57.43.png?alt=media\&token=b918d137-bd53-43fc-84df-ae605c44b0c9)

#### Step 5: 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](/powertalk-chat-sdk-documentation/powertalk-ios/background-process-in-taptalk.io.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-MHKsq4vOlouRa03adbb%2F-MHLIm1-VkzIwjxQilqS%2Feaab744-Screen_Shot_2019-08-28_at_13.37.54.png?alt=media\&token=02281a47-665d-4403-8062-8fb0fe48c64b)

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-MHKsq4vOlouRa03adbb%2F-MHLItjSE_HAsYniTXmS%2F979a00b-Screen_Shot_2019-08-28_at_13.44.36.png?alt=media\&token=ed490114-336d-4b7c-9777-7a6ddd88a521)

#### Step 6: Initialize Taptalk.io in your Application class

In order to use TapTalk.io, you must first initialize a TapTalk.io instance by passing the `APP_KEY_ID`, `APP_KEY_SECRET`, `APP_BASE_URL`, and `IMPLEMENTATION_TYPE` assigned to your application to the `initWithAppKeyID:appKeySecret:apiURLString:implementationType:` method as a parameter. Generally, initialization is implemented in the **appDelegate** `application:didFinishLaunchingWithOptions:` method.

{% hint style="warning" %}
**Note:** To get **BASE\_URL** you can follow our documentation on [how to get Base URL](/powertalk-chat-sdk-documentation/powertalk-server-api/base-url.md) on TapTalk.io.
{% endhint %}

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

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

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

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Initialize TapTalk
    [[TapTalk sharedInstance] initWithAppKeyID:APP_KEY_ID 
                                  appKeySecret:APP_KEY_SECRET 
                                  apiURLString:APP_BASE_URL 
                            implementationType:IMPLEMENTATION_TYPE];
}
```

{% endcode %}
{% endtab %}

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

```swift
import PowerTalk

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
    // Initialize TapTalk
    TapTalk.sharedInstance().initWithAppKeyID(
        APP_KEY_ID,
        appKeySecret: APP_KEY_SECRET,
        apiURLString: APP_BASE_URL,
        implementationType: IMPLEMENTATION_TYPE
    )
    
    return true
}
```

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

{% hint style="info" %}
**Parameters**\
**APP\_KEY\_ID**: (String) application key ID\
**APP\_KEY\_SECRET**: (String) application key Secret\
**APP\_BASE\_URL**: (String) base API URL\
**IMPLEMENTATION\_TYPE**: (enum) found in TapTalkImplentationType, more detailed information below
{% endhint %}

{% hint style="info" %}
**IMPLEMENTATION\_TYPE**\
TapTalkImplementationType consists of 3 types which are:\
**`TapTalkImplementationTypeUI`**: used for implementation with only TapUI\
**`TapTalkImplementationTypeCore`**: used for implementation with only TapCore\
**`TapTalkImplementationTypeCombine`**: used for implementation with both of TapCore and TapUI combined
{% endhint %}

{% hint style="info" %}
**Note**: In the [Event Delegate](/powertalk-chat-sdk-documentation/powertalk-ios/event-delegate.md) page, you can find detailed information on the usages of TapTalk iOS SDK's delegates and callbacks.
{% endhint %}

You may also call `initWithAppKeyID:appKeySecret:apiURLString:implementationType:success:` to obtain callback once the initialization is finished.

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

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

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

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Initialize TapTalk
    [[TapTalk sharedInstance] initWithAppKeyID:APP_KEY_ID 
                                  appKeySecret:APP_KEY_SECRET 
                                  apiURLString:APP_BASE_URL 
                            implementationType:IMPLEMENTATION_TYPE
                                       success:^{
        // Initialization finished
    }];
    
    return YES;
}
```

{% endcode %}
{% endtab %}

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

```swift
import PowerTalk

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
    // Initialize TapTalk
    TapTalk.sharedInstance().initWithAppKeyID(
        APP_KEY_ID,
        appKeySecret: APP_KEY_SECRET,
        apiURLString: APP_BASE_URL,
        implementationType: IMPLEMENTATION_TYPE
    ) {
        // Initialization finished
    }
    return true
}
```

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

#### Step 7: 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. You can follow the instructions in [Implement Application Delegate page](/powertalk-chat-sdk-documentation/powertalk-ios/implement-application-delegate.md).

#### Step 8: Authenticate to TapTalk.io

In order to use the abilities of the iOS SDK in your client app, a TapTalk instance must be initiated in each client app through user authentication with TapTalk.io server. An authenticated user account allows the instance to communicate and interact with the server. To authenticate your user with the server, follow the instructions in [Authentication page](/powertalk-chat-sdk-documentation/powertalk-ios/authentication.md).

### Initialize Google Places API Key (Optional)

To enable location search result preview while sending location message, a Google Places API Key is required. To obtain the API key for your application, you can check [the documentation](https://developers.google.com/places/web-service/get-api-key) provided by Google. To initialize, insert your obtained key using the `initializeGooglePlacesApiKey()` method.

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

```objective-c
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
    // Initialize Google Places API Key
    [[TapTalk sharedInstance] initializeGooglePlacesAPIKey:GOOGLE_PLACES_API_KEY];
    
    return YES;
}
```

{% endcode %}
{% endtab %}

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

```swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
    
    // Initialize Google Places API Key
    TapTalk.sharedInstance().initializeGooglePlacesAPIKey(GOOGLE_PLACES_API_KEY)
    
    return true
}
```

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

{% hint style="info" %}
**Parameters**\
**GOOGLE\_PLACES\_API\_KEY**: (String) Google Places API Key
{% endhint %}

## Bridge to React Native

#### **Step 1: Create a method in AppDelegate to navigate to PowerTalk Chat View**

After the configurations above are completed, we will add a method named `navigateToPowerTalk` in the project's AppDelegate to navigate to PowerTalk 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 "PowerTalk.h"

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

@interface AppDelegate () <TapTalkDelegate>

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

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Implement TapTalk didFinishLaunchingWithOptions here    
    [[TapTalk sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
    
    RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
    RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                     moduleName:@"PowerTalkReactNative"
                                              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 TapTalk
    [[TapTalk sharedInstance] initWithAppKeyID:...];
    
    NSSetUncaughtExceptionHandler(&handleExceptions);
    
    return YES;
}

// Method to open chat view
- (void)navigateToPowerTalk {
    // Initialize TapTalk room list view controller here
    TAPRoomListViewController *roomListViewController = [[TapUI sharedInstance] roomListViewController]; 
    UINavigationController *roomListNavigationController = [[UINavigationController alloc] initWithRootViewController:roomListViewController];
  
    // Present room list view
    [self presentViewController:roomListViewController animated:YES completion:^{
        // Completion
    }];
}

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

@end
```

{% endcode %}
{% endtab %}

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

```swift
import React
import PowerTalk

class AppDelegate: UIResponder, UIApplicationDelegate, TapTalkDelegate {

    // Add a UINavigationController variable
    var navigationController: UINavigationController?
    
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
        // Implement TapTalk didFinishLaunchingWithOptions here    
        TapTalk.sharedInstance().application(application, didFinishLaunchingWithOptions:launchOptions)
    
        let bridge = RCTBridge(delegate: self, launchOptions: launchOptions)
        let rootView = RCTRootView(
            bridge: bridge,
            moduleName: "PowerTalkReactNative",
            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 TapTalk
        TapTalk.sharedInstance().initWithAppKeyID(...)
        
        NSSetUncaughtExceptionHandler(handleException)
        
        return true
    }
        
    // Method to open chat view
    public func navigateToPowerTalk() {
        // Initialize TapTalk room list view controller here
        let roomListViewController = TapUI.sharedInstance().roomListViewController()
        let roomListNavigationController = UINavigationController(rootViewController: roomListViewController)
        
        // Present room list view
        self.present(roomListNavigationController, animated:true) {
            // Completion
        }
    }
    
    // Add delegate function to handle exceptions
    let handleException: @convention(c) (NSException) -> Void = { exception in
        // Implement TapTalk.io handleException method
        TapTalk.sharedInstance().handle(exception)
    }
}
```

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

For Objective-C, 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)navigateToPowerTalk;
</strong>
@end
</code></pre>

{% endtab %}
{% endtabs %}

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

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

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

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

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

NS_ASSUME_NONNULL_BEGIN

@interface PowerTalkStarterModule : NSObject <RCTBridgeModule>

@end

NS_ASSUME_NONNULL_END
```

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

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

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

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

@implementation PowerTalkStarterModule

RCT_EXPORT_MODULE(PowerTalkStarter);

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

RCT_EXPORT_METHOD(getActivityName:(RCTResponseSenderBlock) callback) {
  callback(@[@"PowerTalkStarter (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 3. Open PowerTalk 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 `navigateToPowerTalk()` method to open PowerTalk 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 `navigateToPowerTalk()` to open PowerTalk chat view. Here we will be using a button's  `onPress()` method as an example.

```javascript
<Button
    onPress={() => NativeModules.PowerTalkStarter.navigateToPowerTalk()}
    title='Launch PowerTalk'
/>
```

{% hint style="info" %}
**Note**: You can check a more complete implementation guide in the [PowerTalk iOS](/powertalk-chat-sdk-documentation/powertalk-ios.md) section.
{% endhint %}
