# React Native

## Prerequisites

Please have the following handy before beginning the integration:

* **Application identifier** generated on the Apxor dashboard for your app\
  \
  ([Read more on how to fetch the application identifier from Apxor dashboard](/getting-started-with-apxor/adding-a-new-app.md))
* **App Bundle Id :** Every app has a unique application ID that looks like `com.example.myapp`. This id uniquely identifies the app on the device and also on the app store.\
  \
  [(Know more about bundle ids here)](https://developer.android.com/studio/build/configure-app-module)
* **The list of events** to setup triggers and track goals, user properties that allows to personalize messages and to target better.\
  \
  ([Read more on how you can setup here](/getting-started-with-apxor/api-guides/react-native.md))

## React Native Integration

[Check here the latest release notes.](/getting-started-with-apxor/release-notes.md#react-native)

<details>

<summary>For React Native version 0.60.0 and higher</summary>

Run the following commands

```bash
$ yarn add react-native-apxor-sdk react-native-apxor-rtm-plugin
```

* `react-native-apxor-sdk` is to track events and navigatiocodens
* `react-native-apxor-rtm-plugin` helps to create and display Walkthrough messages

</details>

<details>

<summary>For React Native version 0.59.0 and lower</summary>

Run the following commands

```shell
$ npm install react-native-apxor-sdk react-native-apxor-rtm-plugin --save
```

```shell
$ react-native link react-native-apxor-sdk react-native-apxor-rtm-plugin
```

1. Open `android/app/src/main/java/[...]/MainActivity.java`

   * Add following imports statements at the top of the file

   ```js
     import com.apxor.reactnativesdk.RNApxorSDKPackage;
     import com.apxor.reactnativesdk.RNApxorRTMPackage;
   ```

   ```java
   @Override
   protected List<ReactPackage> getPackages() {
       return Arrays.<ReactPackage>asList(
               new MainReactPackage(),
               ...
               new RNApxorSDKPackage(), <- ApxorSDK Package
               new RNApxorRTMPackage(), <- ApxorSDK RTM Plugin Package
               ...
       );
   }
   ```
2. Append the following lines to `android/settings.gradle`:

   ```groovy
   include ':react-native-apxor-sdk'
   project(':react-native-apxor-sdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-apxor-sdk/android')
   include ':react-native-apxor-rtm-plugin'
   project(':react-native-apxor-rtm-plugin').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-apxor-rtm-plugin/android')
   ```

</details>

## Android Integration <a href="#android-integration" id="android-integration"></a>

### Step 1: Add Apxor Repository

Add Maven URL in root/project level `build.gradle`

**`Path: <project>/build.graddle` :**

```js
// Top-level build file where you can add configuration options 
// common to all sub-projects/modules.

buildscript {
    allprojects {
        repositories {
            maven {
                url "https://repo.apxor.com/artifactory/list/libs-release-android/"
            }
        }
    }
    // ....
}
```

### Step 2: Add dependencies

Add the following into the build.gradle file in app-level

**`Path: <project>/<app-module>/build.gradle`**:

#### **2.1 ApxorSDK dependencies (mandatory)**

```groovy
dependencies {
//...

    // Event tracking and a must-have dependency for other plugins
    implementation 'com.apxor.androidx:apxor-android-sdk-core:3.2.5@aar'


    // Add these for Realtime Actions and Surveys
    implementation 'com.apxor.androidx:apxor-android-sdk-qe:1.8.9@aar'
    implementation 'com.apxor.androidx:apxor-android-sdk-rtm:2.7.5@aar'
    implementation 'com.apxor.androidx:surveys:2.3.0@aar'


    // Helper plugin to create walkthroughs
    implementation 'com.apxor.androidx:wysiwyg:1.6.5@aar'
    
    // Add the below two dependencies to establish an SSE connection for WYSIWYG
    implementation 'com.squareup.okhttp3:okhttp:4.9.0'
    implementation 'com.launchdarkly:okhttp-eventsource:2.5.0'
    
//...
}
```

#### **2.2 Add exoplayer in your app (optional)**

<details>

<summary>Add exoplayer in your app</summary>

Exoplayer enables you to configure Picture In Picture videos from the Apxor dashboard; if you are already using the exoplayer in your app, this step is not needed; otherwise, add the following dependency in the application  `build.gradle` file. To use video pip templates, this is necessary.

<img src="/files/BMQoL6soL1X6E8GmUgTs" alt="" data-size="original">

<mark style="background-color:blue;">**For com.apxor.androidx:apxor-android-sdk-rtm:2.3.6\@aar version onwards**</mark>

```gradle
dependencies {
  //... 

  implementation 'androidx.media3:media3-exoplayer:1.1.1'
  implementation 'androidx.media3:media3-ui:1.1.1'


  //...
  }
```

<mark style="background-color:blue;">**For com.apxor.androidx:apxor-android-sdk-rtm:2.3.5\@aar and below**</mark>

```gradle
dependencies {
  //... 

  implementation 'com.google.android.exoplayer:exoplayer:2.14.0'

  //...
  }
```

</details>

#### **2.3 Enable uninstall tracking for your users (optional)**

<details>

<summary>Enable uninstall tracking for your users</summary>

Apxor uses your Firebase server key to send silent push notifications to track uninstalls and measure the outcomes of your campaign. To enable this, please do the following:

<mark style="background-color:blue;">**For Firebase Version < 22.0.0**</mark>

```gradle
dependencies {
  // Add this to track uninstalls from the Apxor dashboard
  implementation 'com.google.firebase:firebase-messaging:20.1.0'
  implementation('com.apxor.androidx:apxor-android-sdk-push:1.2.8@aar') {
    exclude group: 'com.google.firebase'
  }
}
```

Please handle the notifications like the following:

```gradle
public class MyFirebaseMessagingService extends FirebaseMessagingService {
    @Override
    public void onMessageReceived(RemoteMessage remoteMessage) {
        // Creating Notification Channel
        ApxorPushAPI.createNotificationChannel(this.getApplicationContext(), "Apxor", "Apxor", "Apxor");
        if (remoteMessage.getFrom().equals(YOUR_FCM_SENDER_ID)) {
            // Push Notification receiver with your Sender ID
        } else {
            // Check if Push Notification received from Apxor
            if (ApxorPushAPI.isApxorNotification(remoteMessage)) {
                ApxorPushAPI.handleNotification(remoteMessage, getApplicationContext());
            } else {
                // Silent or Data push notification, which you can send through Apxor dashboard
            }
        }
    }
}
```

<mark style="background-color:blue;">**For Firebase Version >= 22.0.0**</mark>

```gradle
dependencies {
  // Add this to track uninstalls from the Apxor dashboard
  implementation('com.apxor.androidx:apxor-android-sdk-push-v2:1.3.1@aar') {
    exclude group: 'com.google.firebase'
  }
}
```

[Read here](/getting-started-with-apxor/firebase-credentials-optional.md) on how to get your Firebase sender ID and also FCM server key to share it with apxor to configure uninstall tracking.

</details>

After completing the expandable section, integrate Apxor Push with @react-native-firebase

Add the following block wherever you have `AppRegistry.registerComponent(appName, () => App);`. Ideally, it's located in your `src/index.js` or `src/index.tsx`.

```javascript
import messaging from "@react-native-firebase/messaging";
import RNApxorSDK from "react-native-apxor-sdk";

messaging().setBackgroundMessageHandler(async (remoteMessage) => {
  if (!RNApxorSDK.handlePushNotification(remoteMessage)) {
    // To ignore silent push notifications
    if (!remoteMessage.data && !remoteMessage.notification) {
      return;
    }
    console.log("You need to handle this push notification");
  }
});

AppRegistry.registerComponent(appName, () => App);
```

### Step 3: Add the following in proguard-rules.pro

{% hint style="info" %}
**Note**

If you use proguard to obfuscate the classes, you have to add the following to ignore obfuscation for Apxor SDK classes
{% endhint %}

Configure the below rules in your `proguard-rules.pro` file

**`Path: <project>/<app-module>/gradle.properties`**:

```java
-keep class com.apxor.** { *; }
-dontwarn com.apxor.**
```

{% hint style="info" %}
**Note:**

If you use `androidx` libraries, add the following property in `gradle.properties` file

```properties
android.enableJetifier = true
```

{% endhint %}

### Step 4: Disable Dexing Artifact Transformation

{% hint style="info" %}
**Note**

In Android Gradle Plugin 3.5.0, we use Gradle artefact transforms for desugaring and dexing, enabling greater parallelism and caching. This process depends on libraries having accurate Maven information since dependencies specified in POM files are used to set up the desugaring classpath. If we encounter issues with missing dependencies during desugaring, it's necessary to disable parallel transformation to facilitate the process by adding the following property:
{% endhint %}

Add the following to `gradle.properties` file

**`Path: <project>/<app-module>/gradle.properties`**:

```java
android.enableDexingArtifactTransform = false
```

### Step 5: Initialize Apxor Android SDK <a href="#initialize-apxor-android-sdk" id="initialize-apxor-android-sdk"></a>

* Add following `meta-data` tag inside your `application` tag in your `AndroidManifest.xml` file

  ```xml
  <application>
      <!-- You must replace your app-id in android:value attribute -->
      <meta-data android:name="APXOR_APP_ID" android:value="APP_ID" />
  </application>
  ```

{% hint style="info" %}
Click here to [Add New App](/getting-started-with-apxor/adding-a-new-app.md) and [how to get the app id](/getting-started-with-apxor/adding-a-new-app.md#step-5-copy-the-application-identifier)
{% endhint %}

### You are all set: Verify your SDK integration <a href="#ensuring-apxorsdk-is-initialised-successfully" id="ensuring-apxorsdk-is-initialised-successfully"></a>

We have to verify for two things as follows :

#### **SDK Initialization**

On running your android project lookout for the following log in logcat :

```java
ApxorSDK(v3**) successfully initialized for: APP_ID
```

<figure><img src="/files/7hLMlroJFuHWhmh7schm" alt=""><figcaption></figcaption></figure>

#### **Plugin Initialization**

By default, only error logs are enabled. To see debug logs for plugin initialization and to confirm tracking event triggers, user properties. Please run the below command in terminal

```java
adb shell setprop log.tag.Apxor VERBOSE
```

<figure><img src="/files/sRoXlvsMhggAWYRwLrnC" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note**

Apxor uploads data only when the app is minimized to the background. If you are running from Android Studio (emulators or devices), do not stop the app, just press on the "home" button in order for data to be uploaded.
{% endhint %}

## iOS Integration <a href="#ios-integration" id="ios-integration"></a>

### Step 1: Initialize Apxor iOS SDK

<details>

<summary>Auto initialize SDK (Recommended)</summary>

1. Add the following inside your **`application`** plist file.
2. Open your application's **Info.plist** as source code.

<img src="/files/A2eDZBOplAFoGRpOqnRa" alt="" data-size="original">

3. Copy paste the below piece of code, to create an entry for ApxorSDK

```
<key>Apxor</key>
<dict>
    <key>Core</key>
    <string>YOUR_APP_ID</string>
    <key>APXSurveyPlugin</key>
    <true/>
    <key>APXRTAPlugin</key>
    <true/>
    <key>APXPushPlugin</key>
    <true/>
    <key>APXWYSIWYGPlugin</key>
    <true/>
    // other plugins which you are using
</dict>
```

4. To add the **APXWYSIWYGPlugin**, add the following to your application's `.podspec` file:

```
pod 'Apxor-WYSIWYG', '1.02.73'
```

</details>

{% hint style="info" %}
**Note**

* If you are unable to find our plugins in your pods, then do<mark style="background-color:orange;">**`pod update`**</mark>
  {% endhint %}

<details>

<summary>Manually initialize SDK</summary>

1. Call **`ApxorSDK.initialize`** method in your **`Application`** class

```
//...
#import "ApxorSDK/ApxorSDK.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
    [ApxorSDK initializeApxorWithID:@"<YOUR_APP_ID>"];
    // ... your code
}
```

2. Open your application's **Info.plist** as source code.

<img src="/files/A2eDZBOplAFoGRpOqnRa" alt="" data-size="original">

3. Copy paste the below piece of code, to create an entry for ApxorSDK.

```
<key>Apxor</key>
<dict>
    <key>APXSurveyPlugin</key>
    <true/>
    <key>APXRTAPlugin</key>
    <true/>
    <key>APXPushPlugin</key>
    <true/>
    <key>APXWYSIWYGPlugin</key>
    <true/>
    // other plugins which you are using
</dict>
```

</details>

{% hint style="info" %}
**Note**

To get your app ID, please email us at <mark style="color:blue;">**<contact@apxor.com>**</mark> or contact your assigned CSM
{% endhint %}

## Configuring Test Device

* First, you need to configure your app to ensure there is a URL Scheme with your application's bundle identifier as the value.
* If your app already has a URL Scheme with your application's bundle identifier as the value, you can skip this step.

### Configure URL Scheme

* To configure URL scheme, go to your project settings, select **`Targets`**. Click on the **`Info`** tab.
* Select the **`URL Types`**, and click on the **`+`** button to add a new URL Scheme.
* Add a new URL Scheme with your **`bundle identifier`** as the value.
* Your bundle identifier will be in the format, **`com.xxxx.xxxx`**
* Use the image below for reference.

<figure><img src="/files/h0DXDpIUwnWJcE5UUtIf" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note**

Make sure the URL scheme has the value of your **bundle identifier** that was provided in the dashboard while registering with us. Also, the app must have same **bundle identifier.**
{% endhint %}

### Handling the deep link

<details>

<summary>Using AppDelegate</summary>

* You'd need to enable Apxor to handle Apxor specific deeplinks.
* In your application's **`AppDelegate`** file, in the function **`application(_:open:options:)`**, add the following code at the beginning,

```swift
// ObjC
NSString *urlStr = url.absoluteString;
if ([urlStr containsString:@"add-test-device"]) {
  [ApxorSDK handleDeeplink:url];
}
```

```objectivec
// Swift
/*
  Apxor's code to handle deeplinks
  */
let urlStr = url.absoluteString
if (urlStr.contains("add-test-device")) {
    ApxorSDK.handleDeeplink(url)
}
```

* This will ensure the Apxor specific deep links are handle by our SDK.

</details>

<details>

<summary>Using SceneDelegate</summary>

* You'd need to enable Apxor to handle Apxor specific deeplinks.
* In your application's **`SceneDelegate`** file, add the following code at the beginning,

```objectivec
// ObjC
- (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts {
  for(UIOpenURLContext *x in URLContexts) {
    NSURL *url = x.URL;
    if([[url absoluteString] containsString:@"add-test-device"])
    {
      [ApxorSDK handleDeeplink:url];
    }
    break;
  }
}
```

```swift
// Swift
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
  let url = URLContexts.first?.url
  let urlStr = url?.absoluteString
  if (urlStr!.contains("add-test-device")) {
    ApxorSDK.handleDeeplink(url!)
  }
}
```

</details>

### You are all set: Verify your SDK Integration

Lookout for the following log

<figure><img src="/files/lZ7MDzf7ZBl4IbnUyCRW" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/jNo4ltENh343LgxdAxyz" alt=""><figcaption></figcaption></figure>

## Add-Ons

### APIs

Add the following import statement in every component where you use Apxor APIs

```java
import RNApxorSDK from "react-native-apxor-sdk";
```

### Identifying Users <a href="#userid" id="userid"></a>

The Apxor SDK automatically captures device IDs and this is used to identify users uniquely by Apxor. Apart from this, you can log a custom user identifier that you use to uniquely identify users in your app.

This identifier would be very instrumental especially when exporting data of a certain campaign or survey to your analytics system to create a cohort and measure the results of the campaign.

Similarly, when you are importing data to Apxor from your system that your marketing/product / data science team has identified and wants to run campaigns specifically to them the `custom user identifier` will serve as the bridge to communicate between your systems and Apxor effectively.

Here is how you can set your user identifier for Apxor to recognize your users :

```javascript
// Syntax
RNApxorSDK.setUserIdentifier("STRING");

// Example
RNApxorSDK.setUserIdentifier("<unique_user_id>");
```

### Setting up campaign triggers, capturing data for targeting and goal tracking[​](http://localhost:3000/docs/android-sdk/Tracking#setting-up-campaign-triggerscapturing-data-for-targetting-and-goal-tracking) <a href="#setting-up-campaign-triggerscapturing-data-for-targetting-and-goal-tracking" id="setting-up-campaign-triggerscapturing-data-for-targetting-and-goal-tracking"></a>

The product/marketing or the growth team lists out the use cases with an idea of when to launch and to whom to launch. To do this we need to capture data in the form of events. Let us consider the following use case as an example :

<figure><img src="/files/cjD16dAViQgcMYKKhg53" alt=""><figcaption></figcaption></figure>

### **App Events**[**​**](http://localhost:3000/docs/android-sdk/Tracking#app-events)

In the above scenario, we want to trigger the campaign for users who have spent 'x' seconds and haven't tapped on a product. To understand that if the user has tapped the product we should log an event along with its attributes as follows to capture data:

<figure><img src="/files/pwqGbcAFBkZQWXuNvL64" alt=""><figcaption></figcaption></figure>

Similarly if you want to send promotions to users who have viewed at least five products of the category shoes in the last three days or you want to measure how many people added an item to a cart from the campaign as a goal all this information is captured in the form of events.

These types of events are classified as `app events` - the data that is transferred to the servers at Apxor where you can segment users based on historic behaviour or measure your goals as specified above.

Here is how we track app events :

```javascript
// Syntax
RNApxorSDK.logAppEvent(event_name, properties);

// Example
RNApxorSDK.logAppEvent("ADD_TO_CART", {
  userId: "johnwick@example.com",
  value: 1299,
  item: "Sony Head Phone 1201",
});
```

### User Attributes <a href="#user-attributes" id="user-attributes"></a>

#### Personalizing and targetting by user persona[​](http://localhost:3000/docs/android-sdk/Tracking#personalising-and-targetting-by-user-persona) <a href="#personalising-and-targetting-by-user-persona" id="personalising-and-targetting-by-user-persona"></a>

We can personalize the messaging copy in the experiences we build for the user or target based on his persona using information that is centric to individual users. Let us consider the following example where we know the user is an `English` with `Gold` membership.

This information helps to tailor content in English to that specific user and gives us the flexibility to different messaging to different membership tiers. This is how the information captured here is used for segmenting.

Similarly capturing attributes like `Name` can help to personalize your message copy where it reads **Hi {username} can't find your product?** where the username is replaced by the attribute value of the property from the nudges dashboard along with providing meaningful defaults in their absence.

<figure><img src="/files/kwd028HZ6jg2J3mAGyFH" alt=""><figcaption></figcaption></figure>

This is how you log user information to Apxor :

```javascript
// Syntax
RNApxorSDK.setUserCustomInfo(properties);

// Example
RNApxorSDK.setUserCustomInfo({
  Age: 10,
  Name: "John Wick",
});
```

### Client Events[**​**](http://localhost:3000/docs/android-sdk/Tracking#client-events) <a href="#client-events" id="client-events"></a>

In the below scenario, let's assume you want to launch a survey when the soft back button is pressed asking the user for product feedback. In this, we don't need to capture the data of how many people pressed the back button which is useless and it bloats your event storage as it is a high-frequency event which increases your cost unnecessarily. This data point doesn't potentially answer any of your product questions and hence there is no ROI in storing data from this event.<br>

So for such scenarios where we need the behavioral data to launch a campaign or to collect feedback, which doesn't provide ROI on storing for measuring goals, answering your product questions or segmenting your target audience, we log these events as `Client Events` which involves zero transfer of data and is used only to set up your triggers on behavioral information from the user.

<figure><img src="/files/aJ3Mv29Z26IODheNEIVE" alt=""><figcaption></figcaption></figure>

```javascript
// Syntax
RNApxorSDK.logClientEvent(event_name, properties);

// Example
RNApxorSDK.logClientEvent("ADD_TO_CART", {
  userId: "johnwick@example.com",
  value: 1299,
  item: "Sony Head Phone 1201",
});
```

### Handle custom redirection using Key-Value pairs <a href="#handle-custom-redirection-using-key-value-pairs" id="handle-custom-redirection-using-key-value-pairs"></a>

If your app wants to redirect users based on simple key-value pairs instead using Deeplink URLs or Activity, you can follow below approach

```java
import android.app.Application;
import com.apxor.androidsdk.core.ApxorSDK;
import com.apxor.androidsdk.core.RedirectionListener;

import org.json.JSONArray;

public class MyApplication extends Application {
  @Override
  public void onCreate() {

    // Register a redirection listener ONLY ONCE in your app
    // If you register in multiple places, ONLY the last value will be available.
    // Whenever you register a new one, it will override the existing listener
    Apxor.setRedirectionListener(new RedirectionListener() {
      @Override
      public void onActionComplete(JSONArray keyValuePairs) {
        int length = keyValuePairs.length();

        /**
         * [
         *      {
         *          "name": "YourKey",
         *          "value": "YourValue"
         *      },
         *      ....
         * ]
         */
        try {
          for (int i = 0; i < length; i++) {
            JSONObject pair = keyValuePairs.getJSONObject(i);
            String key = pair.getString("name");
            // Values are always String type. You need to convert based on your need
            String value = pair.getString("value");

            // Your logic continues from here
          }
        } catch (JSONException e) {

        }
      }
    });
  }
}
```

### Track Screen

In the scenario discussed in this guide, how will we know if the user has spent thirty seconds on the home screen and did not click on the product? For this reason, it is important to use track the screens to set them up as triggers and also to capture the time spent on the screens.

<figure><img src="/files/T7Xr6AIf4U1AWAnQruYJ" alt=""><figcaption></figcaption></figure>

By using the following API to track the screens in the app you can setup campaigns on inactivity or time spent on those screens:

```java
RNApxorSDK.trackScreen("HomeScreen");
```

### Track Navigation <a href="#track-navigation" id="track-navigation"></a>

**If you are already using a navigation library like&#x20;**<mark style="background-color:yellow;">**`@react-navigation`**</mark>**,  please follow below mentioned steps for Apxor SDK to automatically track screen navigation**

```typescript
import { useNavigationContainerRef } from "@react-navigation/native"

const navigationRef = useNavigationContainerRef()

return (
  <NavigationContainer
    ref={navigationRef}
    onReady={() => {
      const currentRoute = navigationRef?.current?.getCurrentRoute()
      if (currentRoute) {
        RNApxorSDK.trackScreen(currentRoute.name)
      }
    }}
    onStateChange={() => {
      const currentRoute = navigationRef?.current?.getCurrentRoute()
      if (currentRoute) {
        RNApxorSDK.trackScreen(currentRoute.name)
      }
    }}
  >
   // your screens and navigators
  </NavigationContainer>
)

```

{% hint style="info" %}
**Note**

1. You will need it on both `onReady` and `onStateChange` as the SDK needs to log navigation events on the initial app launch and also on futher navigations between screens.
2. The `NavigationContainer` need **not** be straight from `@react-navigation`. It can be from any 3rd party wrapper around `NavigationContainer` (like BugSnag)
   {% endhint %}

**Otherwise use the following API to track navigations on every screen/route change**

```java
// Syntax
RNApxorSDK.logNavigationEvent(screen_name);

// Example
RNApxorSDK.logNavigationEvent("LoginScreen");
```

#### Handle Deeplinks <a href="#handle-deeplinks" id="handle-deeplinks"></a>

Follow the instructions given in [here](https://reactnative.dev/docs/linking) to enable deeplinks in your application.

Whenever Apxor React Native SDK sends the deeplink URL to the app, the following callback will be executed and you have to interpret the URL and navigate the user to the necessary page or tab.

Add the following code snippet in your root component to handle deeplink URLs

```javascript
import { Linking } from "react-native";

function YourRootComponent(props) {
  // Use `componentDidMount` for Class components
  useEffect(() => {
    Linking.addEventListener("url", (event) => {
      const { url } = event;

      // Your custom function which interprets the URL
      // and redirect users to the necessary page or tab
      handleDeeplinkURL(url);
    });
  }, []);
}
```

### Yeah! You are ready to create your first [Campaign](/product-guides/create-a-campaign/mobile.md) or [Survey](/product-guides/create-a-survey/legacy.md)

### Yeah! You are ready to create your first [Campaign](/product-guides/create-a-campaign/mobile.md) or [Survey](/product-guides/create-a-survey/legacy.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guides.apxor.com/getting-started-with-apxor/sdk/react-native.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
