appsflyer-flutter-plugin icon indicating copy to clipboard operation
appsflyer-flutter-plugin copied to clipboard

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

Open zcwessels opened this issue 3 years ago • 6 comments

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):

  • Device: iPhone 14 Pro
  • OS: iOS 16.0

zcwessels avatar Sep 22 '22 06:09 zcwessels

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

nandanurseptama avatar Oct 12 '22 03:10 nandanurseptama

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

MrOlolo avatar Oct 13 '22 15:10 MrOlolo

The same issue reproduce iOS 16.0 iPhone 13 Pro

onfound avatar Oct 13 '22 16:10 onfound

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

I have it still has the same issue

zcwessels avatar Oct 17 '22 11:10 zcwessels

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

Theunodb avatar Oct 17 '22 12:10 Theunodb

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

MrOlolo avatar Oct 17 '22 14:10 MrOlolo