---
agentTools:
  projectIndex: https://docs.nvecta.com/llms.txt
---

# Android Integration

[block:html]
{
  "html": "<span style=\"color: orange; font-weight: bold; font-size: 18px;\">◉ For react-native-notifyvisitors ^4.4.1 and higher, please use the configurations provided below.</span>"
}
[/block]

Add the permissions mentioned below to your app’s manifest.xml file.

```xml
<manifest….>
   <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
   <uses-permission android:name="android.permission.WAKE_LOCK"/>
   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
   <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
   <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
   <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
   <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
```

## Configure AndroidManifest.xml

[block:html]
{
  "html": "<span style=\"color: orange; font-weight: bold; font-size: 18px;\">◉ For react-native-notifyvisitors ^4.4.0 and earlier, please use the configurations provided below.</span>"
}
[/block]

Add the permissions mentioned below to your app’s manifest.xml file.

```xml
<manifest….>
   <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
   <uses-permission android:name="android.permission.WAKE_LOCK"/>
   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
   <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
   <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
   <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
   <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>

 <application>
    <meta-data
        android:name="notifyvisitors_bid"
        android:value="xxxx" />
    <meta-data
        android:name="notifyvisitors_bid_e"
        android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/>
 </application>
</manifest>
```

> 📘 Note:
>
> Kindly login to your NotifyVisitors account to see your credentials.

## Initialize SDK

[block:html]
{
  "html": "<span style=\"color: orange; font-weight: bold; font-size: 18px;\">◉ For react-native-notifyvisitors ^4.4.1 and higher, please use the configurations provided below.</span>"
}
[/block]

A. Incorporate our registration method into the onCreate() function of your application class. If you haven't created your own yet, go ahead and set one up.

```Text Java
package com.example;

import android.app.Application;
import com.rn_notifyvisitors.RNNotifyvisitorsModule;

public class ApplicationClass extends Application {

   // NOTE: Replace the below with your own NOTIFYVISITORS_BRAND_ID & NOTIFYVISITORS_BRAND_ENCRYPTION_KEY
   private String NOTIFYVISITORS_BRAND_ENCRYPTION_KEY = "##################################";
   private int NOTIFYVISITORS_BRAND_ID = #####;
  
   @Override
   public void onCreate() {
       super.onCreate();
       
       RNNotifyvisitorsModule.register(this, NOTIFYVISITORS_BRAND_ID, NOTIFYVISITORS_BRAND_ENCRYPTION_KEY);

       SoLoader.init(this, false);
   }
}
```
```Text Kotlin
package com.example

import android.app.Application
import com.rn_notifyvisitors.RNNotifyvisitorsModule

class MyApplication : Application() {

   // NOTE: Replace the below with your own NOTIFYVISITORS_BRAND_ID & NOTIFYVISITORS_BRAND_ENCRYPTION_KEY
   private val NOTIFYVISITORS_BRAND_ENCRYPTION_KEY: String = "##################################"
   private val NOTIFYVISITORS_BRAND_ID: Int = #####

   override fun onCreate() {
       super.onCreate()

       RNNotifyvisitorsModule.register(this, NOTIFYVISITORS_BRAND_ID, NOTIFYVISITORS_BRAND_ENCRYPTION_KEY);

       SoLoader.init(this, false)
   }
}
```

B. Set **android:allowBackup** to false.

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/ef7902a-Screenshot_2023-08-28_at_8.34.18_AM.png",
        "",
        "application class "
      ],
      "align": "center",
      "border": true,
      "caption": "initialize application class and allow backup"
    }
  ]
}
[/block]

[block:html]
{
  "html": "<span style=\"color: orange; font-weight: bold; font-size: 18px;\">◉ For react-native-notifyvisitors ^4.4.0 and earlier, please use the configurations provided below.</span>"
}
[/block]

A. **If you have an Application class** Otherwise skip this step.

Import below package

```java
import com.rn_notifyvisitors.RNNotifyvisitorsModule;
```

Call the above method in **onCreate()**

```java
RNNotifyvisitorsModule.register(this);

//Example

public void onCreate() {
    super.onCreate();
    RNNotifyvisitorsModule.register(this);
    SoLoader.init(this, /* native exopackage */ false);
}

```

B. **If you don't have an Application class**. Then add the below line to your **app manifest.xml**.

```xml
android:name="com.notifyvisitors.notifyvisitors.NotifyVisitorsApplication"
```

C. Set **android:allowBackup** to false.

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/ef7902a-Screenshot_2023-08-28_at_8.34.18_AM.png",
        "",
        "application class "
      ],
      "align": "center",
      "border": true,
      "caption": "initialize application class and allow backup"
    }
  ]
}
[/block]