1

Ok so i grabbed the code from AppsFlyer Cordova plugin:

    AppsFlyerProperties.getInstance().set(AppsFlyerProperties.LAUNCH_PROTECT_ENABLED, false);
    AppsFlyerLib instance = AppsFlyerLib.getInstance();

    try{
        final JSONObject options = args.getJSONObject(0);

        devKey = options.optString(AF_DEV_KEY, "");
        isConversionData = options.optBoolean(AF_CONVERSION_DATA, false);

        if(devKey.trim().equals("")){
            callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, NO_DEVKEY_FOUND));
        }

        isDebug = options.optBoolean(AF_IS_DEBUG, false);

        instance.setDebugLog(isDebug);

        if(isDebug == true){
            System.out.println("AppsFlyer Here 0");
            Log.d("AppsFlyer", "Starting Tracking");
        }

        trackAppLaunch();
        instance.startTracking(c.getApplication(), devKey);

        if(isConversionData == true){
            if(mAttributionDataListener == null) {
                mAttributionDataListener = callbackContext;
            }

            if(mConversionListener == null){
                mConversionListener = callbackContext;
            }

            registerConversionListener(instance);
            sendPluginNoResult(callbackContext);

        }
        else{
            callbackContext.success(SUCCESS);
        }

    }
    catch (JSONException e){
        e.printStackTrace();
    }

registerConversionListener

private void registerConversionListener(AppsFlyerLib instance){
        instance.registerConversionListener(cordova.getActivity().getApplicationContext(), new AppsFlyerConversionListener(){

        @Override
        public void onAppOpenAttribution(Map<String, String> attributionData) {
        }

        @Override
        public void onAttributionFailure(String errorMessage) {
            handleError(AF_ON_ATTRIBUTION_FAILURE, errorMessage);
        }

        @Override
        public void onInstallConversionDataLoaded(Map<String, String> conversionData) {
                    // Delay here up to some minutes
        }

OnInstallCoversionDataLoaded callback is delayed up to some minutes. Can anyone advise how to fix this?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Rendy
  • 5,572
  • 15
  • 52
  • 95
  • @MaximShoustin It's not I intentionally want to do the delay, but it's from AppsFlyer SDK. It could be SDK problem, I use 4.3.0 of cordova plugin currently. – Rendy Aug 16 '18 at 06:31
  • The `onInstallConversionDataLoaded ` callback should be called 1-2 seconds after launch event is sent, a.e. `instance.startTracking()` – Maxim Shoustin Aug 16 '18 at 07:45
  • Unfortunately on that Cordova plugin version happens up to some minutes and on Android only – Rendy Aug 16 '18 at 08:07
  • have you found a solution? I'm facing with the same issue with the latest cordova plugin `4.4.11`... – Alberto Maluje Nov 07 '18 at 15:53
  • @Rendy can you check latest 4.4.17 version? if you are still facing the same issue, please comment, tnx – Maxim Shoustin Apr 02 '19 at 08:26
  • Hi @AlbertoMaluje and Maxim sorry I cannot confirm on later version, my application only can use 4.3.0 because of limited Cordova version – Rendy Apr 03 '19 at 08:56

0 Answers0