Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@config-plugins/react-native-branch retrieve Android AD_ID #237

Open
raffiot opened this issue Jun 4, 2024 · 2 comments
Open

@config-plugins/react-native-branch retrieve Android AD_ID #237

raffiot opened this issue Jun 4, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@raffiot
Copy link

raffiot commented Jun 4, 2024

Summary

Hello 👋
I'm using "@config-plugins/react-native-branch": "^7.0.0" and "react-native-branch": "^6.1.0" in my expo managed mobile app.
However in my branch events (Install, Reinstall, Login etc.) I don’t see any AD_ID attached to the android events in Liveview tab.
When I run npx expo prebuild I see the correct parameters:

//./android/app/src/main/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
  ...
  <uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
  ...
</manifest>
//./android/app/src/proguard-rules.pro
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# react-native-reanimated
-keep class com.swmansion.reanimated.** { *; }
-keep class com.facebook.react.turbomodule.** { *; }

# Add any project specific keep options here:

# @generated begin expo-build-properties - expo prebuild (DO NOT MODIFY)
-keep class com.google.android.gms.** { *; }
-dontwarn com.crashlytics.android.answers.shim.**
-dontwarn com.google.firebase.appindexing.**
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient {
 com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context);
}
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info {
java.lang.String getId();
boolean isLimitAdTrackingEnabled();
}
# @generated end expo-build-properties

And I have the correct settings in Google Play Console
image

Let me know if you need any additional details.
Thanks for your help!

Config Plugin

@config-plugins/react-native-branch

What platform(s) does this occur on?

Android

SDK Version

50.0.14

Reproducible demo

Create an expo managed app with the following configuration

//app.config.ts
export default {
  expo: {
    
    android: {
      
      permissions: ['com.google.android.gms.permission.AD_ID']
   }
   plugins: [
     [
       'expo-build-properties',
       {
         android: {
           compileSdkVersion: 34,
           targetSdkVersion: 34,
           minSdkVersion: 31,
           extraProguardRules:
              '-keep class com.google.android.gms.** { *; }\n-dontwarn com.crashlytics.android.answers.shim.**\n-dontwarn com.google.firebase.appindexing.**\n-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient {\n com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context);\n}\n-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info {\njava.lang.String getId();\nboolean isLimitAdTrackingEnabled();\n}', // Used by branch to collect AD_ID
          },
          ios: { deploymentTarget: '13.4' },
        },
    ],
   [
        '@config-plugins/react-native-branch',
        {
          // We add a default value to avoid the alert of empty API key, because the command eas submit fails otherwise
          apiKey:
            process.env.EXPO_PUBLIC_BRANCH_API_KEY ||
            'ignore-empty-apikey-alert',
          iosAppDomain: process.env.EXPO_PUBLIC_BRANCH_IOS_APP_DOMAIN,
        },
    ],
    
  ]
}
@raffiot raffiot added the bug Something isn't working label Jun 4, 2024
@raffiot
Copy link
Author

raffiot commented Jun 4, 2024

PS: I checked also on my Android device In Settings>Privacy>Ads and I have an existing Advertising ID ✔️

@pgill-rbi
Copy link

@raffiot did you ever get a solution to this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants