AppsFlyerSDK / appsflyer-flutter-plugin

Flutter Plugin for AppsFlyer SDK
MIT License
144 stars 114 forks source link

appId and afAppId ignored for Android #163

Closed mpiparo closed 2 years ago

mpiparo commented 2 years ago

Describe the bug observed using appsflyer_sdk: 6.4.0

I apologize if I missed this in the docs, but it appears that the appId option whether set in within the option Map as "afAppId" or as the "appId" attribute in the AppsFlyerOptions object, is ignored for Android during the _validateMapOptions and _validateAFOptions calls. With the app id for android being set assuming from platform env APPLICATION_ID perhaps?

Please clarify if this is expected behavior and if the appId/afAppId options is ignored for Android.

To Reproduce Steps to reproduce the behavior:

  1. Set either "afAppId" in options map or "appId" in AppsFlyerOptions
  2. Call initSDK
  3. inspect url in debug output: 'https://dlsdk.appsflyer.com/v1.0/android/[app_id]?...
  4. notice [app_id] does not match what was set in options

Expected behavior app_id in url would match what is set as appId in options

Smartphone (please complete the following information):

Additional context

In my specific case my build process appends ".dev" to android package name for development environment, so I am not able to test appsFlyer functionality without creating a new app in AppsFlyer with the .dev added, but would prefer to override the appId passed to AppsFlyer (without the ".dev") by setting in the options.

ge-af commented 2 years ago

Hi @mpiparo Thank you for reaching out to us.

The appId parameter is being used only for iOS, as it should be populated by the Apple App Id. On the Android SDK we take the packageName directly from the application's configurations itself (What's configured in build.gradle file) ,thus it cannot be changed by an SDK public API.

It's recommended to create another debug app on the AppsFlyer's dashboard in order to differentiate any production data from testing data. Please review this article.

If you have any additional questions, we would kindly ask you to submit a support ticket to support@appsflyer.com in order to provide optimal support.

darylgo commented 2 years ago

Hi @mpiparo Thank you for reaching out to us.

The appId parameter is being used only for iOS, as it should be populated by the Apple App Id. On the Android SDK we take the packageName directly from the application's configurations itself (What's configured in build.gradle file) ,thus it cannot be changed by an SDK public API.

It's recommended to create another debug app on the AppsFlyer's dashboard in order to differentiate any production data from testing data. Please review this article.

If you have any additional questions, we would kindly ask you to submit a support ticket to support@appsflyer.com in order to provide optimal support.

I think setAppId() should also support Android. For example, modifying applicationId will cause in-app purchases or third-party login failures.