AppsFlyerSDK / appsflyer-flutter-plugin

Flutter Plugin for AppsFlyer SDK
MIT License
148 stars 116 forks source link

Unexpected character (at character 1) The data couldn’t be read because it isn’t in the correct format. #233

Open zcwessels opened 2 years ago

zcwessels commented 2 years ago

Describe the bug AppsflyerSDK not initialising.

To Reproduce

static initializeAppsFlyer({required String devKey, required String appleAppId, bool isDebug = false, bool disableAdvertisingIdentifier = true}) async {
    Map appsFlyerOptions = {
      "afDevKey": devKey, //This value is correct.
      "afAppId": appleAppId,  //This value is correct.
      "isDebug": isDebug,
      "timeToWaitForATTUserAuthorization": 50.0,
      "disableAdvertisingIdentifier": disableAdvertisingIdentifier,
    };

    _appsflyerSdk = AppsflyerSdk(appsFlyerOptions);

    _appsflyerSdk.onInstallConversionData((res) {
      print("onInstallConversionData: $res");
      onInstallConversionDataResult = res;
    });

    _appsflyerSdk.onAppOpenAttribution((res) {
      print("onAppOpenAttribution: $res");
      onAppOpenAttributionResult = res;
    });

    _appsflyerSdk.onDeepLinking((DeepLinkResult res) {
      print("onDeepLinking: $res");
      onDeepLinkingResult = res;
    });

    await _appsflyerSdk.initSdk(
      registerConversionDataCallback: true,
      registerOnAppOpenAttributionCallback: true,
      registerOnDeepLinkingCallback: true,
    );
  }

  static logAppsFlyerEvent({required String name, required Map eventValues}) {
    try {
      _appsflyerSdk.logEvent(name, eventValues);
    } catch (error) {
      print(error.toString());
    }
  }

Expected behavior The sdk should initialise.

Smartphone (please complete the following information):

nandanurseptama commented 1 year ago

Have you try to use 'AppsFlyerOptions' class on appsFlyerOptions variable ?

MrOlolo commented 1 year ago

Up. The same error at different apps with different appsflyer versions

onfound commented 1 year ago

The same issue reproduce iOS 16.0 iPhone 13 Pro

zcwessels commented 1 year ago

Have you try to use 'AppsFlyerOptions' class on appsFlyerOptions variable ?

I have it still has the same issue

Theunodb commented 1 year ago

It seems that if you are on the ZERO plan you cant log mobile attribution. You need to be on a GROWTH plan or higher for it to work. Turning on DEBUG mode when initialising, and running the app in xcode gives a forbidden error

MrOlolo commented 1 year ago

It seems that if you are on the ZERO plan you cant log mobile attribution. You need to be on a GROWTH plan or higher for it to work. Turning on DEBUG mode when initialising, and running the app in xcode gives a forbidden error

You're right. Seems like they changed plans without any notice. But i'm not sure because i never check this plans before:/

image