la-haus / flutter-segment

Segment.io library for flutter
MIT License
22 stars 138 forks source link

advertising_id not being picked up in segment context #64

Open fpun opened 1 year ago

fpun commented 1 year ago

Context I am trying to send app events from an Android app developed in Flutter to Facebook by using the flutter-segment library.

Config I have checked that I use Advertising ID on the Play Console in the App Content section I have added <uses-permission android:name="com.google.android.gms.permission.AD_ID"/> to the manifest

Issue When running my app locally with Android Studio Emulator in debug mode with "flutter run", advertising_id is surfaced correctly in the segment context object. However when running the app locally in the same conditions but in release mode with "flutter run --release" (or deploying the app to the Play Store), advertising_id is missing from the context.

Am I missing anything?

AjleyArroyo commented 1 year ago

I have the same problem but clevertap

AjleyArroyo commented 1 year ago

Context I am trying to send app events from an Android app developed in Flutter to Facebook by using the flutter-segment library.

Config I have checked that I use Advertising ID on the Play Console in the App Content section I have added <uses-permission android:name="com.google.android.gms.permission.AD_ID"/> to the manifest

Issue When running my app locally with Android Studio Emulator in debug mode with "flutter run", advertising_id is surfaced correctly in the segment context object. However when running the app locally in the same conditions but in release mode with "flutter run --release" (or deploying the app to the Play Store), advertising_id is missing from the context.

Am I missing anything?

Add implementation 'com.google.android.gms:play-services-ads-identifier:16+'' or greater version to the dependencies section of your build.gradle file. You might already have it.

Add the following line in your Proguard settings: XML

-keep class com.google.android.gms.ads.identifier.* { ; }