# APP

**First, to add Google Ads to your app, you need to have a Google AdMob account. You must create a Google AdMob account.**

⇒ Google Adds Document  :  <https://docs.page/invertase/react-native-google-mobile-ads>\
⇒ Google AdMob Account : <https://admob.google.com/signup?sac=true> <br>

#### **1. Setting up Google AdMob**

\
**1.**  Before you are able to display ads to your users, you must have a [Google AdMob account](https://apps.admob.com/). Under the "Apps" menu item, create or choose an existing Android/iOS app. Each app platform exposes a unique account ID which needs to be added to the project.

{% hint style="warning" %}
Attempting to build your app without configuring a valid App ID for this package will cause the app to crash on start or fail to build.
{% endhint %}

Under the "App settings" menu item, you can find the "App ID":

<figure><img src="https://prismic-io.s3.amazonaws.com/invertase%2F52dd6900-108c-47a6-accb-699fde963b99_new+project+(13).jpg" alt=""><figcaption></figcaption></figure>

\
**2.** The app IDs for Android and iOS need to be inserted into your app's native code. For bare React Native projects, you can add the app IDs to the `app.json` file\
\
**Example**:&#x20;

```json
{
  "name": "TaxidoUserApp",
  "displayName": "TaxidoUserApp",
    "react-native-google-mobile-ads": {
        "android_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx",
         "ios_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx"
  }
}
```

\
**3.** The app IDs for Android and iOS need to be inserted into your app's native code. For bare React Native projects, you can add the app IDs to the AndroidManifest.xml file<br>

```xml
<application> 
         <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="ca-app-pub-XXXXXXXXXXXXXXXXXXXXXX" />     
</application>
```

\
**4.** After you complete all the setup, clear the cache and delete the node modules. Then restart the app by following the steps below.&#x20;

```
1. Install node modules

Run:
npm install
or
npm install --legacy-peer-deps

```

#### **2. For Android**

```
cd android
./gradlew clean
./gradlew assembleDebug
```

Or you can run directly:

```
cd android
./gradlew clean
cd ..
npx react-native run-android
```
