onInstallConversionData doesn't invoke after app installing on android

779 views Asked by At

i want to implement deffered link to the app, process link params after app first installing. onInstallConversionData method invokes when app is already installed, but not on first launch. i implemented this code in App.tsx.

       const onInstallConversionDataCanceller = appsFlyer.onInstallConversionData(
            (res: any) => {
                if (JSON.parse(res.data.is_first_launch) == true) {
                    if (res.data.af_status === 'Non-organic') {
                        const media_source = res.data.media_source;
                        const campaign = res.data.campaign;
                        console.log(
                            'This is first launch and a Non-Organic install. Media source: ' +
                                media_source +
                                ' Campaign: ' +
                                campaign,
                        );
                    } else if (res.data.af_status === 'Organic') {
                        console.log('This is first launch and a Organic Install');
                    }
                } else {
                    console.log('This is not first launch');
                }
            },
        );
        appsFlyer.initSdk(
            {
                devKey: 'key',
                isDebug: false, // set to true if you want to see data in the logs
                appId: '1234567', // iOS app id
            },
            (result: any) => {
                console.log(result);
            },
            (error: any) => {
                console.error(error);
            },
        );
        return () => {
            onInstallConversionDataCanceller();
            console.log('unregister onInstallConversionDataCanceller');
            onAppOpenAttributionCanceller();
            console.log('unregister onAppOpenAttributionCanceller');
        };

also i have onNewIntent implementation inside MainActivity class:

    public void onNewIntent(Intent intent) {
         super.onNewIntent(intent);
         setIntent(intent);
    }
0

There are 0 answers