Git Product home page Git Product logo

appsflyer-flutter-plugin's Introduction

appsflyer-flutter-plugin

pub package Coverage

🛠 In order for us to provide optimal support, we would kindly ask you to submit any issues to [email protected]

When submitting an issue please specify your AppsFlyer sign-up (account) email , your app ID , production steps, logs, code snippets and any additional relevant information.

  • Android AppsFlyer SDK v6.14.0
  • iOS AppsFlyer SDK v6.14.3

If you have used one of the removed/changed APIs, please check the integration guide for the updated instructions.

  • From version 6.11.2, the setPushNotification will not work in iOS. Please use our new API sendPushNotificationData when receiving a notification on flutter side.

  • From version 6.8.0, the enableLocationCollection has been removed from the plugin.

  • From version 6.4.0, UDL (Unified deep link) now as a dedicated class with getters for handling the deeplink result. Check the full UDL guide. setSharingFilter & setSharingFilterForAllPartners APIs are deprecated. Instead use the new API setSharingFilterForPartners.

  • From version 6.3.5+2, Remove stream from the plugin (no change is needed if you use callbacks for handling deeplink).

  • From version 6.2.3+2, Flutter 2 is supported, including null safety. 6.2.4-flutterv1 will use iOS SDK 6.2.4 with Flutter V1.

  • From version 6.0.0, we have renamed the following APIs:

Before v6 v6
trackEvent logEvent
stopTracking stop
validateAndTrackInAppPurchase validateAndLogInAppPurchase
  • From version 6.1.2+4, we have renamed the following APIs:
Before v6.1.2+4 v6.1.2+4
validateAndLogInAppPurchase validateAndLogInAppIosPurchase/validateAndLogInAppAndroidPurchase

Important notice

  • Switch ConversionData and OnAppOpenAttribution to be based on callbacks instead of streams from plugin version 6.0.5+2.

AD_ID permission for Android

In v6.8.0 of the AppsFlyer SDK, we added the normal permission com.google.android.gms.permission.AD_ID to the SDK's AndroidManifest, to allow the SDK to collect the Android Advertising ID on apps targeting API 33. If your app is targeting children, you need to revoke this permission to comply with Google's Data policy. You can read more about it here.

📖 Guides

appsflyer-flutter-plugin's People

Contributors

adamkoch avatar af-do avatar af-fess avatar af-margot avatar afdima avatar al-af avatar amit-kremer93 avatar gm-appsflyer avatar liaz-af avatar mgonzalezc avatar misterfourtytwo avatar pazlavi avatar rostopira avatar roughike avatar sdurban avatar shaharaf avatar shaharc1990 avatar shinriyo avatar sokoloff06 avatar vagrantrobbie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

appsflyer-flutter-plugin's Issues

Failed assertion: line 45 pos 12: 'devKey != null': is not true. #69

After initializing the appsflyersdk, but i'm getting an issue.
final AppsFlyerOptions options = AppsFlyerOptions(
afDevKey: DotEnv().env['DEVKEY'],
showDebug: true);
_appsflyerSdk = AppsflyerSdk(options);
_appsflyerSdk.initSdk();

Error:
'package:appsflyer_sdk/src/appsflyer_sdk.dart': Failed assertion: line 46 pos 12: 'devKey != null': is not true.

iOS Compile error: 'AppsFlyerTracker.h' file not found

Hi,

I'm getting this error when trying to compile the app for iOS:

Xcode's output:
↳
    In file included from /Users/ricardocampos/.pub-cache/hosted/pub.dartlang.org/appsflyer_sdk-1.0.7/ios/Classes/AppsflyerSdkPlugin.m:1:
    /Users/ricardocampos/.pub-cache/hosted/pub.dartlang.org/appsflyer_sdk-1.0.7/ios/Classes/AppsflyerSdkPlugin.h:2:9: fatal error: 'AppsFlyerFramework/AppsFlyerLib/AppsFlyerTracker.h' file not found
    #import <AppsFlyerFramework/AppsFlyerLib/AppsFlyerTracker.h>

Any idea?

Thanks!

Crash on iOS10 with NSRangeException

Describe the bug
Our many customers using iOS10 crash a lot with NSRangeException in appsflyer sdk.
13 customers crash 204 times.

To Reproduce
Steps to reproduce the behavior:

  1. Crash randomly in iOS10 device.

Expected behavior
No crash

Screenshots
No

Desktop (please complete the following information):

  • OS: None
  • Browser None
  • Version None

Smartphone (please complete the following information):

  • Device: iPhone6 or something
  • OS: iOS10.x
  • Browser None
  • Version 1.2.0

Additional context
http://support.appsflyer.com/hc/requests/206850

NSRangeException
*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array
0 CoreFoundation | ___exceptionPreprocess + 124
-- | --
1 libobjc.A.dylib | objc_exception_throw + 56
2 CoreFoundation | -[__NSArrayM removeObjectAtIndex:]
3 Runner | -[AppsFlyerTracker getEventParameters:] + 5264
4 Runner | -[AppsFlyerTracker callServerWithEventName:value:isEvent:isIAd:completion:] + 1428
5 libdispatch.dylib | __dispatch_client_callout + 16
6 libdispatch.dylib | __dispatch_continuation_pop + 448
7 libdispatch.dylib | __dispatch_source_latch_and_call + 204
8 libdispatch.dylib | __dispatch_source_invoke + 804
9 libdispatch.dylib | __dispatch_queue_serial_drain + 560
10 libdispatch.dylib | __dispatch_queue_invoke + 884
11 libdispatch.dylib | __dispatch_queue_override_invoke + 344
12 libdispatch.dylib | __dispatch_root_queue_drain + 540
13 libdispatch.dylib | __dispatch_worker_thread3 + 124
14 libsystem_pthread.dylib | _pthread_wqthread + 1096
15 libsystem_pthread.dylib | start_wqthread + 4

Device type top5 and OS version top5
appsflyer_NSRangeException

App data not showing on af

I've got this in my main.dart to test if an app open would register with af:

Future<void> initSdk() {
    return appsflyerSdk.initSdk().then((onValue) {
      print(onValue.toString());
    }).catchError((onError) {
      print(onError.toString());
    });
  }

  void sendEvent(String eventName, Map eventValues) async {
    bool result;
    try {
      result = await appsflyerSdk.trackEvent(eventName, eventValues);
    } on Exception catch (e) {}
    setState(() {
      print("Result trackEvent: $result");
    });
  }

@override
  void initState() {
    super.initState();
    initSdk().then((res) {
      sendEvent("app open", {
        "af_platform": Theme.of(context).platform.toString(),
        "af_action": "open",
        "af_date": DateTime.now().toIso8601String()
      });
     });
  }

Yet, I don't see anything in the af dashboard after I start the app on my simulator. Shouldn't it be reflected in the events tab or somewhere? Or am I doing something wrong? Thanks

Init Sdk and getting installs

I have successfully connected appsflyer to my app to get clicks and impressions. To get installs, i tried to install referrer to my manifest file. But it doesnt work, i dont have any numbers in my dashboard. I decided that the main problem is that i didnt init sdk.

My code to init appsflyer:

AppsflyerSdk _appsflyerSdk;
final AppsFlyerOptions options = AppsFlyerOptions(
afDevKey: DotEnv().env["DEV_KEY"],
appId: DotEnv().env["APP_ID"],
showDebug: true);
_appsflyerSdk = AppsflyerSdk(options);
_appsflyerSdk.initSdk(registerConversionDataCallback: true, registerOnAppOpenAttributionCallback: true);

I expected my app will build and i am going to test my installs. And for the first time my app has built successfully and i started testing it. I've added devices to test the app as i read in documentation. Anyway i didnt get any numbers in my dashboard. And now when i try to launch my app - i am getting this issue, when debug says:

D/AppsFlyer_6.1.4( 5744): Install referrer is allowed
D/AppsFlyer_6.1.4( 5744): Connecting to Install Referrer Library...
#56 pc 004ce62f /apex/com.android.art/lib/libart.so (art::JNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, char*)+735) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#57 pc 003f8a8e /apex/com.android.art/lib/libart.so (art::(anonymous namespace)::CheckJNI::CallMethodV(char const*, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, char*, art::Primitive::Type, art::InvokeType)+2846) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#58 pc 003e60b9 /apex/com.android.art/lib/libart.so (art::(anonymous namespace)::CheckJNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, char*)+73) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#59 pc 0008f90e /system/lib/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+62) (BuildId: 588f2cd5873ff4273bb25b25edb82606)
#60 pc 00098c8e /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vectorandroid::String8 const&, bool)+910) (BuildId: 588f2cd5873ff4273bb25b25edb82606)
#61 pc 00003804 /system/bin/app_process32 (main+1588) (BuildId: c5eedbfb6130af84c3db8e121fb1202e)
#62 pc 000522e3 /apex/com.android.runtime/lib/bionic/libc.so (__libc_init+115) (BuildId: a690ed60a8b6a282b41dd991389b5fdb)
Lost connection to device.
Exited (sigterm)

Failed assertion: line 45 pos 12: 'devKey != null': is not true.

I'am trying to init my appsflyersdk, but i'm getting an issue.
final AppsFlyerOptions options = AppsFlyerOptions(
afDevKey: DotEnv().env['DEVKEY'],
appId: DotEnv().env[APPID],
showDebug: true);
_appsflyerSdk = AppsflyerSdk(options);
_appsflyerSdk.initSdk();

I pasted this code to my initState.
[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: 'package:appsflyer_sdk/src/appsflyer_sdk.dart': Failed assertion: line 45 pos 12: 'devKey != null': is not true.

E/flutter (13160): #12 _CustomZone.run (dart:async/zone.dart:1093:19)
E/flutter (13160): #13 _CustomZone.runGuarded (dart:async/zone.dart:997:7)
E/flutter (13160): #14 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1037:23)
E/flutter (13160): #15 _rootRun (dart:async/zone.dart:1190:13)
E/flutter (13160): #16 _CustomZone.run (dart:async/zone.dart:1093:19)
E/flutter (13160): #17 _CustomZone.bindCallback. (dart:async/zone.dart:1021:23)
E/flutter (13160): #18 Timer._createTimer. (dart:async-patch/timer_patch.dart:18:15)
E/flutter (13160): #19 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:397:19)
E/flutter (13160): #20 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:428:5)
E/flutter (13160): #21 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

What can i do? It seems like it doesn't see my key.

enableUninstallTracking is missing

why the following methods are commented?

AppsflyerSdkPlugin.m
lse if([@"enableUninstallTracking" isEqualToString:call.method]){
//
}

AppsflyerSdkPlugin.java
// private void enableUninstallTracking(MethodCall call, Result result) {
// String senderId = (String) call.argument("senderId");
// AppsFlyerLib.getInstance().enableUninstallTracking(senderId);
// result.success(null);
// }

however the method call is in the appsflyer_sdk.dart

void enableUninstallTracking(String senderId) {
_methodChannel
.invokeMethod("enableUninstallTracking", {'senderId': senderId});
}

No default values for parameters of initSdk

Input params for initSdk are optional, however they don't have default values and are not checked for null. Omitting either of them results in the below exception. I'm not sure if there are any further repercussions as the result of that exception.
This happens on the latest version of the plugin: 5.2.0+1.

E/flutter (32469): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: Failed assertion: boolean expression must not be null
E/flutter (32469): #0      AppsflyerSdk.initSdk.<anonymous closure> (package:appsflyer_sdk/src/appsflyer_sdk.dart:147:11)
E/flutter (32469): #1      _rootRunUnary (dart:async/zone.dart:1134:38)
E/flutter (32469): #2      _CustomZone.runUnary (dart:async/zone.dart:1031:19)
E/flutter (32469): #3      _FutureListener.handleValue (dart:async/future_impl.dart:140:18)
E/flutter (32469): #4      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:682:45)
E/flutter (32469): #5      Future._propagateToListeners (dart:async/future_impl.dart:711:32)
E/flutter (32469): #6      Future._complete (dart:async/future_impl.dart:516:7)
E/flutter (32469): #7      new Future.delayed.<anonymous closure> (dart:async/future.dart:313:16)
E/flutter (32469): #8      _rootRun (dart:async/zone.dart:1122:38)
E/flutter (32469): #9      _CustomZone.run (dart:async/zone.dart:1023:19)
E/flutter (32469): #10     _CustomZone.runGuarded (dart:async/zone.dart:925:7)
E/flutter (32469): #11     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
E/flutter (32469): #12     _rootRun (dart:async/zone.dart:1126:13)
E/flutter (32469): #13     _CustomZone.run (dart:async/zone.dart:1023:19)
E/flutter (32469): #14     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:949:23)
E/flutter (32469): #15     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:23:15)
E/flutter (32469): #16     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
E/flutter (32469): #17     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
E/flutter (32469): #18     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
E/flutter (32469):

init sdk error

init sdk on ios,I get this:
[VERBOSE-2:ui_dart_state.cc(177)] Unhandled Exception: 'package:appsflyer_sdk/src/appsflyer_sdk.dart': Failed assertion: line 132 pos 14: 'exp.hasMatch(appID)': is not true.
#0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:46:39)
#1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:36:5)
#2 AppsflyerSdk._validateMapOptions (package:appsflyer_sdk/src/appsflyer_sdk.dart:132:14)
#3 AppsflyerSdk.initSdk. (package:appsflyer_sdk/src/appsflyer_sdk.dart:205:28)
#4 _rootRunUnary (dart:async/zone.dart:1198:47)
#5 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#6 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#7 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#8 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#9 Future._complete (dart:async/future_impl.dart:519:7)

validateAndLogInAppPurchase on iOS will crash sometimes on validation error.

Executing validateAndLogInAppPurchase with information that will cause an error will cause the app to crash.

To Reproduce
Steps to reproduce the behavior:

  1. Purchase something (in my case auto-renewable subscription and in Sandbox mode)
  2. Pass the information to validateAndLogInAppPurchase, but do not set Sandbox mode for AppFlyer.
  3. Crash

Expected behavior
No crash.

Smartphone (please complete the following information):

  • Device: iPhone 11 Pro Max
  • OS: iOS 14.2
  • Browser: Safari

Additional context
The crash is

NSInvalidArgumentException
*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]

It happens because -(void)onValidateFail:(NSError*)error{ is executed with error being nil, which according to the AppsFlyer iOS SDK is valid.
In the next line, you're attempting to make a dictionary using that error.description which is nil.

v^1.2.2 iOS initSdk(...) returns error ```type 'String' is not a subtype of type 'Map<dynamic, dynamic>'```

Describe the bug
I have updated to the latest version of appsflyer_sdk from 1.2.1 to 1.2.2 and now receive the error

type 'String' is not a subtype of type 'Map<dynamic, dynamic>'

in my app as well as the example app

I have attached my flutter doctor for extra reference:

[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.3 19D76, locale en-NZ)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
[✓] Android Studio (version 3.5)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.3.3)
[✓] VS Code (version 1.38.1)
[✓] Connected device (2 available)

• No issues found!

After running pod install

Downloading dependencies
Using AppsFlyerFramework (5.1.0)
Using Flutter (1.0.0)
Using appsflyer_sdk (1.1.3)
Generating Pods project
Integrating client project

EDIT:

I should probably add a code sample of where this is happening

_appsFlyerSdk = AppsflyerSdk(AppsFlyerOptions(
        afDevKey: appsFlyerSDKDevKey,
        appId: appsFlyerAppId,
        showDebug: doDebug
    ));   
try {
      await _appsFlyerSdk.initSdk(true, true);
      return null;
    } catch(error) {
     /* HERE ------ > */ print("error = $error");
      return null;
    }

error = type 'String' is not a subtype of type 'Map<dynamic, dynamic>'

ios error: cannot find 'AppsFlyerTracker' in scope #220

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Example on android do not send data

On ios all ok, on android i've got errors:

E/AppsFlyer_5.4.1(11248): Failed resolution of: Lcom/google/android/gms/common/GoogleApiAvailability; E/AppsFlyer_5.4.1(11248): java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/GoogleApiAvailability; E/AppsFlyer_5.4.1(11248): at com.appsflyer.internal.v.ι(:65) E/AppsFlyer_5.4.1(11248): at com.appsflyer.AppsFlyerLibCore.ɩ(:1766) E/AppsFlyer_5.4.1(11248): at com.appsflyer.AppsFlyerLibCore.Ι(:1603) E/AppsFlyer_5.4.1(11248): at com.appsflyer.AppsFlyerLibCore.ι(:99) E/AppsFlyer_5.4.1(11248): at com.appsflyer.AppsFlyerLibCore$e.run(:3307) E/AppsFlyer_5.4.1(11248): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462) E/AppsFlyer_5.4.1(11248): at java.util.concurrent.FutureTask.run(FutureTask.java:266) E/AppsFlyer_5.4.1(11248): at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) E/AppsFlyer_5.4.1(11248): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) E/AppsFlyer_5.4.1(11248): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) E/AppsFlyer_5.4.1(11248): at com.appsflyer.AFExecutor$1$1.run(:31) E/AppsFlyer_5.4.1(11248): at java.lang.Thread.run(Thread.java:919) E/AppsFlyer_5.4.1(11248): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.GoogleApiAvailability" on path: DexPathList[[zip file "/data/app/com.appsflyer.appsflyersdkexample-UpFCLAqFexRxa--C6g3IWQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.appsflyer.appsflyersdkexample-UpFCLAqFexRxa--C6g3IWQ==/lib/arm64, /data/app/com.appsflyer.appsflyersdkexample-UpFCLAqFexRxa--C6g3IWQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/product/lib64]] E/AppsFlyer_5.4.1(11248): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196) E/AppsFlyer_5.4.1(11248): at java.lang.ClassLoader.loadClass(ClassLoader.java:379) E/AppsFlyer_5.4.1(11248): at java.lang.ClassLoader.loadClass(ClassLoader.java:312) E/AppsFlyer_5.4.1(11248): ... 12 more E/AppsFlyer_5.4.1(11248): com.google.android.gms.ads.identifier.AdvertisingIdClient E/AppsFlyer_5.4.1(11248): java.lang.ClassNotFoundException: com.google.android.gms.ads.identifier.AdvertisingIdClient E/AppsFlyer_5.4.1(11248): at java.lang.Class.classForName(Native Method) E/AppsFlyer_5.4.1(11248): at java.lang.Class.forName(Class.java:454) E/AppsFlyer_5.4.1(11248): at java.lang.Class.forName(Class.java:379) E/AppsFlyer_5.4.1(11248): at com.appsflyer.internal.v.ι(:70) E/AppsFlyer_5.4.1(11248): at com.appsflyer.AppsFlyerLibCore.ɩ(:1766) E/AppsFlyer_5.4.1(11248): at com.appsflyer.AppsFlyerLibCore.Ι(:1603) E/AppsFlyer_5.4.1(11248): at com.appsflyer.AppsFlyerLibCore.ι(:99) E/AppsFlyer_5.4.1(11248): at com.appsflyer.AppsFlyerLibCore$e.run(:3307) E/AppsFlyer_5.4.1(11248): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462) E/AppsFlyer_5.4.1(11248): at java.util.concurrent.FutureTask.run(FutureTask.java:266) E/AppsFlyer_5.4.1(11248): at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) E/AppsFlyer_5.4.1(11248): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) E/AppsFlyer_5.4.1(11248): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) E/AppsFlyer_5.4.1(11248): at com.appsflyer.AFExecutor$1$1.run(:31) E/AppsFlyer_5.4.1(11248): at java.lang.Thread.run(Thread.java:919) E/AppsFlyer_5.4.1(11248): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.ads.identifier.AdvertisingIdClient" on path: DexPathList[[zip file "/data/app/com.appsflyer.appsflyersdkexample-UpFCLAqFexRxa--C6g3IWQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.appsflyer.appsflyersdkexample-UpFCLAqFexRxa--C6g3IWQ==/lib/arm64, /data/app/com.appsflyer.appsflyersdkexample-UpFCLAqFexRxa--C6g3IWQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/product/lib64]] E/AppsFlyer_5.4.1(11248): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196) E/AppsFlyer_5.4.1(11248): at java.lang.ClassLoader.loadClass(ClassLoader.java:379) E/AppsFlyer_5.4.1(11248): at java.lang.ClassLoader.loadClass(ClassLoader.java:312) E/AppsFlyer_5.4.1(11248): ... 15 more I/AppsFlyer_5.4.1(11248): WARNING: Google Play Services is missing.

I used Pixel 2 and example project with my afDevKey.

App not running in IOS

/Users/apple/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/appsflyer_sdk-1.1.3/ios/Classes/AppsflyerSdkPlugin.m:272:32: error: no visible @interface for 'FlutterViewController' declares the selector 'sendOnChannel:message:binaryReply:'
[flutterViewController sendOnChannel:channel message:dataFromDict binaryReply:^(NSData * _Nullable reply) {
~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Get OneLink attribution parameters while app is in background

Hi,
We implemented OneLink and we are trying to redirect the user to different pages in the app based on the attribution parameters added to the OneLink custom links. This is working great when the app is closed or when it's installed from said link, as we are getting both the onInstallConversionDataLoaded and onAppOpenAttribution events, but we are not receiving anything if the app is in background and brought in foreground using OneLink. Has anyone encountered this issue before? Is there any way we could achieve this?

This is the flutter doctor -v output:

[√] Flutter (Channel stable, 1.22.3, on Microsoft Windows [Version 10.0.18363.1198], locale en-US)
• Flutter version 1.22.3 at D:\Flutter\flutter
• Framework revision 8874f21e79 (4 weeks ago), 2020-10-29 14:14:35 -0700
• Engine revision a1440ca392
• Dart version 2.10.3

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at C:\Users\Florin\AppData\Local\Android\sdk
• Platform android-30, build-tools 29.0.3
• Java binary at: D:\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
• All Android licenses accepted.

[√] Android Studio (version 3.6)
• Android Studio at D:\Android Studio
• Flutter plugin version 45.1.1
• Dart plugin version 192.8052
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

Flutter Android release build failure

Describe the bug
I have just tried to build a release version of my app containing the appsflyer_sdk but it fails. I have been able to build and install using debug successfully.

My current output is

FAILURE: Build failed with an exception.  

* What went wrong:  
A problem occurred configuring root project 'appsflyer_sdk'.  
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.  

* Try:  
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.  

* Get more help at https://help.gradle.org  

BUILD FAILED in 1m 7s  

The plugin appsflyer_sdk could not be built due to the issue above.  

My output from flutter doctor is

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.1 19B88, locale en-NZ)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
[✓] Android Studio (version 3.5)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.3)
[✓] VS Code (version 1.38.1)
[✓] Connected device (1 available)

• No issues found!

Missing callback on setAppInviteOneLinkId method (iOS only)

Describe the bug
iOS build of the plugin is not calling callback of setAppInviteOneLinkId method.

To Reproduce
This code will work on android and not on iOS:

image

Expected behavior
iOS plugin needs to call the callback function, so the chaining call will work.

Additional context
I opened a PR #53 two weeks ago but didn't reported as an issue.

MethodChannel delivery error

The Flutter side method is inconsistent with the native receiving processing method

in Flutter:
image

in Android:
image

in iOS:
image

flutter build apk error

flutter build apk

Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 13.5s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin appsflyer_sdk...
Running Gradle task 'assembleAarRelease'...
Running Gradle task 'assembleAarRelease'... Done 2.0s

FAILURE: Build failed with an exception.

Task 'assembleAarRelease' not found in root project 'appsflyer_sdk'.

  • Try:
    Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run wit
  • Get more help at https://help.gradle.org

BUILD FAILED in 1s

The plugin appsflyer_sdk could not be built due to the issue above.
Could not find an option named "debu".

4.5 second sleep upon initialization

Describe the bug
There is a 4.5-second sleep in the library initialization:

 Future<Map> initSdk(bool registerConversionDataCallback,bool registerOnAppOpenAttributionCallback) async {
    sleep(const Duration(milliseconds: 4500));
    ....
}

To Reproduce

  1. Use SDK

Expected behavior
There is no delay in SDK initialization

Info

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, v1.15.19, on Microsoft Windows [Version 10.0.18362.719], locale en-US)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Chrome - develop for the web
[√] Android Studio (version 3.6)
[√] VS Code (version 1.39.1)
[√] Connected device (2 available)

• No issues found!

appsflyer_sdk: 1.2.2

Cannot build an app on Flutter 1.9.1

Describe the bug
It seems that appsflyer_sdk-1.1.3 is not compatible with Flutter v1.9.1+hotfix.2

To Reproduce

  1. Create a Flutter project
  2. Depend on appsflyer_sdk: 1.1.3
  3. Run flutter build ios --simulator
  4. See error:
/Library/flutter/.pub-cache/hosted/pub.dartlang.org/appsflyer_sdk-1.1.3/ios/Classes/AppsflyerSdkPlugin.m:272
    :32: error: no visible @interface for 'FlutterViewController' declares the selector 'sendOnChannel:message:binaryReply:'
            [flutterViewController sendOnChannel:channel message:dataFromDict binaryReply:^(NSData * _Nullable reply) {
             ~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.

Expected behavior
The app is built successfully

Screenshots
N/A

Desktop (please complete the following information):

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.9.1+hotfix.2, on Mac OS X 10.14.6 18G95, locale en-RU)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
[✓] Android Studio (version 3.5)
[✓] IntelliJ IDEA Community Edition (version 2018.1)
[✓] VS Code (version 1.31.1)
[✓] Connected device (1 available)

Smartphone (please complete the following information):
N/A (building for simulator)

Additional context
The plugin works with the previous stable version of Flutter (1.7.8+hotfix.4)

Problem tracking event

Method trackEvent for login is not working for me. Could you please see if I've done it right? I tried to follow the example, but it always goes straight to CATCH. Help me pls?

Future _trackLogin() async {
Map eventValues = {
"af_customer_user_id": "123456789"
};
try {
var result = await afSdk.trackEvent("af_login", eventValues);
print("LOGIN $result");
} catch (e) { print(e.toString()); }
}

ERROR:
I/flutter (13259): NoSuchMethodError: The method 'trackEvent' was called on null.
I/flutter (13259): Receiver: null
I/flutter (13259): Tried calling: trackEvent("af_login", _LinkedHashMap len:1)

i'd like to know how to implement correctly so I can get the conversion data.

the code below shows how I structured to get conversion data and deeplink installs.
even with the listen() method, it doesn't bring me the data, it's like the method is not working.
can u help me? am I doing it right?

--------------------- CODE -------------------

AppsflyerSdk sdk;

@OverRide
void initState() {

super.initState();
sdk = AppsflyerSdk(
  widget.appsFlyerOptions,
);

initializeAppsFlyer();

}

initializeAppsFlyer() {

try {
  var result = sdk.initSdk();

  sdk.registerConversionDataCallback().listen((data) => onSuccess(data));
  sdk.registerOnAppOpenAttributionCallback().listen((data) => onSuccess(data));

} catch (e) {
  print('error initializing SDK: ' + e.toString());
}
return;

}

void onSuccess(result) {
var conversionData = jsonDecode(result);

if (conversionData.data.is_first_launch == true) {

  if(conversionData.data.af_status == 'Non-organic') {

    var mediaSource = conversionData.data.media_source;
    var campaign = conversionData.data.campaign;

    print('This is a Non-Organic install. Media source: ' + mediaSource + ' Campaign: ' + campaign);
  } else if(conversionData.data.af_status == 'Organic') {
    print('Organic Install');
  }

} else if (conversionData.data.is_first_launch == false) {
  print("Not first launch ");
}

}

onAppOpenAttribution not defined in latest version

Version 6.0.5+1 on pub.dev throws
The method 'onAppOpenAttribution' isn't defined for the type 'AppsflyerSdk'.

In fact, when looking at the code on the pubspec the function is not on appsflyer_sdk.dart. However, it still appears on the documentation.

Is it deprecated or replaced?

: java.lang.UnsupportedOperationException: The new embedding does not support the old FlutterView.

java.lang.UnsupportedOperationException: The new embedding does not support the old FlutterView.
02-18 17:01:53.921 30822 30822 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2678)
02-18 17:01:53.921 30822 30822 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2743)
02-18 17:01:53.921 30822 30822 E AndroidRuntime: at android.app.ActivityThread.-wrap12(ActivityThread.java)
02-18 17:01:53.921 30822 30822 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1490)
02-18 17:01:53.921 30822 30822 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
02-18 17:01:53.921 30822 30822 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
02-18 17:01:53.921 30822 30822 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6165)
02-18 17:01:53.921 30822 30822 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
02-18 17:01:53.921 30822 30822 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
02-18 17:01:53.921 30822 30822 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
02-18 17:01:53.921 30822 30822 E AndroidRuntime: Caused by: java.lang.UnsupportedOperationException: The new embedding does not support the old FlutterView.
02-18 17:01:53.921 30822 30822 E AndroidRuntime: at io.flutter.embedding.engine.plugins.shim.ShimRegistrar.view(ShimRegistrar.java:82)
02-18 17:01:53.921 30822 30822 E AndroidRuntime: at com.appsflyer.appsflyersdk.AppsflyerSdkPlugin.(AppsflyerSdkPlugin.java:58)
02-18 17:01:53.921 30822 30822 E AndroidRuntime: at com.appsflyer.appsflyersdk.AppsflyerSdkPlugin.registerWith(AppsflyerSdkPlugin.java:69)
02-18 17:01:53.921 30822 30822 E AndroidRuntime: at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:17)
02-18 17:01:53.921 30822 30822 E AndroidRuntime: at com.word.jump.wordrelax.crossword.MainActivity.configureFlutterEngine(MainActivity.java:11)
02-18 17:01:53.921 30822 30822 E AndroidRuntime: at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(FlutterActivityAndFragmentDelegate.java:185)
02-18 17:01:53.921 30822 30822 E AndroidRuntime: at io.flutter.embedding.android.FlutterActivity.onCreate(FlutterActivity.java:418)
02-18 17:01:53.921 30822 30822 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6687)
02-18 17:01:53.921 30822 30822 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1140)
02-18 17:01:53.921 30822 30822 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2631)

因为Appsflyer没有升级到1.12 版本造成的,希望尽快升级一下、

iOS build error

The following error occurs when running ios with appsflyer 6.0.2+1. Working fine on 5.4.1+1.

Failed to build iOS app
Error output from Xcode build:

Could not build the precompiled application for the device.

Error launching application on iPhone.
** BUILD FAILED **

Xcode's output:

/Users/h11e/hmpr/appsflyer-flutter-plugin/example/ios/Runner/AppDelegate.m:4:9: fatal error: 'AppTrackingTransparency/AppTrackingTransparency.h' file not found
#import <AppTrackingTransparency/AppTrackingTransparency.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description

non-organic unable to count

D/AppsFlyer_5.4.3( 3912): Install referrer is not allowed
D/AppsFlyer_5.4.3( 3912): Initializing AppsFlyer SDK: (v5.4.3.50)
I/AppsFlyer_5.4.3( 3912): Sending first launch for this session!
I/AppsFlyer_5.4.3( 3912): Starting AppsFlyer Tracking: (v5.4.3.50)
I/AppsFlyer_5.4.3( 3912): Build Number: 50
I/AppsFlyer_5.4.3( 3912): appsflyer_backup_rules.xml detected, using AppsFlyer defined backup rules for AppsFlyer SDK data
I/AppsFlyer_5.4.3( 3912): sendTrackingWithEvent from activity: android.app.Application
I/AppsFlyer_5.4.3( 3912): Trying to fetch GAID..
D/AppsFlyer_5.4.3( 3912): Failed resolution of: Lcom/google/android/gms/common/GoogleApiAvailability;
D/AppsFlyer_5.4.3( 3912): com.google.android.gms.ads.identifier.AdvertisingIdClient
I/AppsFlyer_5.4.3( 3912): WARNING: Google Play Services is missing.
I/AppsFlyer_5.4.3( 3912): ******* sendTrackingWithEvent: Launch
I/AppsFlyer_5.4.3( 3912): Initialising KeyStore..
I/AppsFlyer_5.4.3( 3912): Creating a new key with alias: com.appsflyer,KSAppsFlyerId=1600001075578-3836234870645651066,KSAppsFlyerRICounter=0
W/AppsFlyer_5.4.3( 3912): Exception while collecting facebook's attribution ID.
D/AppsFlyer_5.4.3( 3912): WARNING: Google play services is unavailable.
I/AppsFlyer_5.4.3( 3912): IMEI was not collected.
D/AppsFlyer_5.4.3( 3912): WARNING: Google play services is unavailable.
I/AppsFlyer_5.4.3( 3912): Android ID was not collected.

Init AppsFlyer in a background process on Android device causes a NullPointerException

Describe the bug
Init AppsFlyer in a background process on Android device causes a NullPointerException

To Reproduce
Steps to reproduce the behavior:

  1. Use Firebase messaging for sending a push notification in the background process
    FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
  2. init AppsFlyer in background process (backgroundMessageHandler):
appsflyerSdk = AppsflyerSdk(appsFlyerOptions);
await appsflyerSdk.initSdk(
  registerConversionDataCallback: true,
  registerOnAppOpenAttributionCallback: true,
  registerOnDeepLinkingCallback: true,
);
  1. Error:
E/MethodChannel#af-api: Failed to handle method call
    java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.Context.getApplicationContext()' on a null object reference
        at com.appsflyer.AppsFlyerLibCore.start(:921)
        at com.appsflyer.AppsFlyerLibCore.start(:902)
        at com.appsflyer.AppsFlyerLibCore.start(:897)
        at com.appsflyer.appsflyersdk.AppsflyerSdkPlugin.initSdk(AppsflyerSdkPlugin.java:586)
        at com.appsflyer.appsflyersdk.AppsflyerSdkPlugin.onMethodCall(AppsflyerSdkPlugin.java:128)
        at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
        at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
        at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:336)
        at android.os.Looper.loop(Looper.java:197)
        at android.app.ActivityThread.main(ActivityThread.java:8016)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)

Expected behavior
No error.

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/bun/supplier/IIdentifierListener;

Hello, I am using the appsflyer with the following versions:
appsflyer_sdk: ^ 6.0.3 + 5
AppsFlyer SDK: (v5.4.3.50)

The first time I run the project I get the following error in console

I/zygote64(31889): Rejecting re-init on previously-failed class java.lang.Class<com.appsflyer.oaid.OaidClient$1>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/bun/supplier/IIdentifierListener;
I/zygote64(31889): at java.util.Map com.appsflyer.AppsFlyerLibCore.ɩ(com.appsflyer.AFEvent) (:50514)
I/zygote64(31889): at void com.appsflyer.AppsFlyerLibCore.ι(com.appsflyer.AFEvent) (:1626)
I/zygote64(31889): at void com.appsflyer.AppsFlyerLibCore.ǃ(com.appsflyer.AppsFlyerLibCore, com.appsflyer.AFEvent) (:102)
I/zygote64(31889): at void com.appsflyer.AppsFlyerLibCore$b.run() (:3347)
I/zygote64(31889): at java.lang.Object java.util.concurrent.Executors$RunnableAdapter.call() (Executors.java:457)
I/zygote64(31889): at void java.util.concurrent.FutureTask.run() (FutureTask.java:266)
I/zygote64(31889): at void java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run() (ScheduledThreadPoolExecutor.java:301)
I/zygote64(31889): at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1162)
I/zygote64(31889): at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:636)
I/zygote64(31889): at void com.appsflyer.AFExecutor$3$3.run() (:31)
I/zygote64(31889): at void java.lang.Thread.run() (Thread.java:784)
I/zygote64(31889): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.bun.supplier.IIdentifierListener" on path: DexPathList[[zip file "/data/app/ec.tipti-xsOhqU9T5ub_7XXTfqaDow==/base.apk"],nativeLibraryDirectories=[/data/app/ec.tipti-xsOhqU9T5ub_7XXTfqaDow==/lib/arm64, /data/app/ec.tipti-xsOhqU9T5ub_7XXTfqaDow==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /product/lib64]]
I/zygote64(31889): at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:93)

I/zygote64(31889): at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
I/zygote64(31889): at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
I/zygote64(31889): at java.util.Map com.appsflyer.AppsFlyerLibCore.ɩ(com.appsflyer.AFEvent) (:50514)
I/zygote64(31889): at void com.appsflyer.AppsFlyerLibCore.ι(com.appsflyer.AFEvent) (:1626)
I/zygote64(31889): at void com.appsflyer.AppsFlyerLibCore.ǃ(com.appsflyer.AppsFlyerLibCore, com.appsflyer.AFEvent) (:102)
I/zygote64(31889): at void com.appsflyer.AppsFlyerLibCore$b.run() (:3347)
I/zygote64(31889): at java.lang.Object java.util.concurrent.Executors$RunnableAdapter.call() (Executors.java:457)
I/zygote64(31889): at void java.util.concurrent.FutureTask.run() (FutureTask.java:266)
I/zygote64(31889): at void java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run() (ScheduledThreadPoolExecutor.java:301)
I/zygote64(31889): at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1162)

I/zygote64(31889): at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:636)
I/zygote64(31889): at void com.appsflyer.AFExecutor$3$3.run() (:31)
I/zygote64(31889): at void java.lang.Thread.run() (Thread.java:784)

When I rerun the project the error stops showing

In my project I am using the following
Ubuntu 18.04.5 LTS
Flutter 1.22.0
Dart 2.10.0
Android Studio 4.1

And the device that I use to run the project is the following. Huawei P10 lite, this has Android 8.1

Any idea why I get this error the first time I run the project?

Conversion data callback reports all installs as organic

In-organic installs (Facebook Ads) showing up on Appsflyer dashboard correctly,
but conversion data callback reports all installs as organic.
(Tested only in Android)

final appsflyerSdk = AppsflyerSdk(AppsFlyerOptions(
  afDevKey: "MYDEVKEY",
  appId: Platform.isIOS ? "IOSKEY" : "ANDROIDKEY",
  showDebug: true,
));

  appsflyerSdk
      .initSdk(
    registerConversionDataCallback: true,
  )
      .then((_) {
    appsflyerSdk.conversionDataStream.listen((data) {
      logger.d(data);
      if (data != null) {
        amplitudeAnalytics.setUserProperties({"conversion_data": data});
      }
    });
  });

Crash on iOS10 with NSRangeException

Our many customers using iOS10 crash a lot with NSRangeException in appsflyer sdk.
13 customers crash 204 times.

Stack Info:

NSRangeException
*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array

0 CoreFoundation ___exceptionPreprocess + 124
1 libobjc.A.dylib objc_exception_throw + 56
2 CoreFoundation -[__NSArrayM removeObjectAtIndex:]
3 Runner -[AppsFlyerTracker getEventParameters:] + 5264
4 Runner -[AppsFlyerTracker callServerWithEventName:value:isEvent:isIAd:completion:] + 1428
5 libdispatch.dylib __dispatch_client_callout + 16
6 libdispatch.dylib __dispatch_continuation_pop + 448
7 libdispatch.dylib __dispatch_source_latch_and_call + 204
8 libdispatch.dylib __dispatch_source_invoke + 804
9 libdispatch.dylib __dispatch_queue_serial_drain + 560
10 libdispatch.dylib __dispatch_queue_invoke + 884
11 libdispatch.dylib __dispatch_queue_override_invoke + 344
12 libdispatch.dylib __dispatch_root_queue_drain + 540
13 libdispatch.dylib __dispatch_worker_thread3 + 124
14 libsystem_pthread.dylib _pthread_wqthread + 1096
15 libsystem_pthread.dylib start_wqthread + 4

截屏2019-12-0810 55 55

To disable ASIdentifierManager in OS

Appstore doesn't accept appsflyer even I disabled IDFA.
It seems there is a problem with Adsupport, how can I solve this?
Thanks

Regarding Guideline 1.3, we continue to notice that your app references the ASIdentifierManager API, which provides access to a user's IDFA, in the following location(s) in your binary:

• /System/Library/Frameworks/AdSupport.framework/AdSupport

It would be appropriate to remove all instances of “ASIdentifierManager” from your app, even if they are not utilized in your app's functionality.

please perfect your ReadMe doc

the read me doc just some API
the key info: such as when init af sdk, i dont know
does it mean, i can init it whenever i like? just ensure the init action before i use af?
the example exist the same problem, just told us how to use api
But When ,and the best practice , I dont know

what does this mean

D/AppsFlyer_5.4.5(30426): [GCD-A03] Server retrieving attempt finished
I/AppsFlyer_5.4.5(30426): [GCD-B01] URL: https://gcdsdk.appsflyer.com/install_data/v4.0/(xxx[app id])?devkey=c********************f&device_id=xxxxxxxxxxxxxxx(this is device id)
D/AppsFlyer_5.4.5(30426): [GCD-A02] Calling onConversionFailure with:
D/AppsFlyer_5.4.5(30426): Error connection to server: 403
D/AppsFlyer_5.4.5(30426): [GCD-A03] Server retrieving attempt finished

The new embedding does not support the old FlutterView.

i have created a project and when i try to run it, it gives me this error
can anybody help me solve this as i need it urgently?
thanks in advance

`2020-03-11 13:03:34.968 5235-5235/com.example.flutter_appflyer E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.flutter_appflyer, PID: 5235
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.flutter_appflyer/com.example.flutter_appflyer.MainActivity}: java.lang.UnsupportedOperationException: The new embedding does not support the old FlutterView.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.UnsupportedOperationException: The new embedding does not support the old FlutterView.
at io.flutter.embedding.engine.plugins.shim.ShimRegistrar.view(ShimRegistrar.java:82)
at com.appsflyer.appsflyersdk.AppsflyerSdkPlugin.(AppsflyerSdkPlugin.java:58)
at com.appsflyer.appsflyersdk.AppsflyerSdkPlugin.registerWith(AppsflyerSdkPlugin.java:69)
at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:17)
at com.example.flutter_appflyer.MainActivity.configureFlutterEngine(MainActivity.kt:10)
at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(FlutterActivityAndFragmentDelegate.java:185)
at io.flutter.embedding.android.FlutterActivity.onCreate(FlutterActivity.java:418)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:193) 
at android.app.ActivityThread.main(ActivityThread.java:6669) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 

Crash on iOS10 with NSRangeException

Describe the bug
Our many customers using iOS10 crash a lot with NSRangeException in appsflyer sdk.
13 customers crash 204 times.

To Reproduce
Steps to reproduce the behavior:

  1. Crash randomly in iOS10 device.

Expected behavior
No crash

Smartphone (please complete the following information):

  • Device: iPhone6
  • OS: iOS10.x
  • Version
  • appsflyer_sdk (1.2.0):
    • AppsFlyerFramework (= 4.10.4)
    • Flutter
  • AppsFlyerFramework (4.10.4)

Additional context

NSRangeException
*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array

0 CoreFoundation ___exceptionPreprocess + 124
1 libobjc.A.dylib objc_exception_throw + 56
2 CoreFoundation -[__NSArrayM removeObjectAtIndex:]
3 Runner -[AppsFlyerTracker getEventParameters:] + 5264
4 Runner -[AppsFlyerTracker callServerWithEventName:value:isEvent:isIAd:completion:] + 1428
5 libdispatch.dylib __dispatch_client_callout + 16
6 libdispatch.dylib __dispatch_continuation_pop + 448
7 libdispatch.dylib __dispatch_source_latch_and_call + 204
8 libdispatch.dylib __dispatch_source_invoke + 804
9 libdispatch.dylib __dispatch_queue_serial_drain + 560
10 libdispatch.dylib __dispatch_queue_invoke + 884
11 libdispatch.dylib __dispatch_queue_override_invoke + 344
12 libdispatch.dylib __dispatch_root_queue_drain + 540
13 libdispatch.dylib __dispatch_worker_thread3 + 124
14 libsystem_pthread.dylib _pthread_wqthread + 1096
15 libsystem_pthread.dylib start_wqthread + 4

appsflyer_NSRangeException

Null safety support

Just so it is tracked.

We are in the progress of moving a package over to null safety and are currently blocked by your plugin to complete this work.
Give me a shout if you need help testing anything, happy to lend a hand.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.