AppsFlyer Android onInstallConversionDataLoaded delay callback

1.1k views Asked by At

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?

0

There are 0 answers