21
Views
3
Comments
Appsflyer

Hello guys, Has anyone ever had to implement the cordova appsflyer plugin?

2019-01-07 16-04-16
Siya
 
MVP

Could find this GitHub page where there is a clone of appsflyer Cordova plugin is available.  May be some one from OutSystems Experts answer this.

btw you can follow the instruction here on how to integrate.

2023-01-19 12-23-07
Abhinav Shilwant

Hi Bruno,

Yes, I have experience implementing the Cordova AppsFlyer plugin. Here’s a basic outline of the process:

1) Install the Plugin: You can add the AppsFlyer plugin to your Cordova project by using the following command:

cordova plugin add https://github.com/AppsFlyerSDK/cordova-plugin.git

2) Configure the Plugin: After installation, configure it by initializing the SDK with your AppsFlyer Dev Key and App ID (iOS) in the onDeviceReady function. For example:

var options = {

    devKey: 'your-dev-key',

    appId: 'your-app-id', // for iOS only

    isDebug: true // Optional for debugging

};

window.plugins.appsFlyer.initSdk(options, function(result) {

    console.log(result);

}, function(error) {

    console.error(error);

});

3) Track Events: Once the plugin is initialized, you can track events as needed. For example:

var eventName = 'af_purchase';

var eventValue = { revenue: '100', currency: 'USD' };

window.plugins.appsFlyer.trackEvent(eventName, eventValue);

4) iOS and Android Setup: Ensure that you’ve followed the setup steps for both platforms in the AppsFlyer Cordova documentation. This includes adding the necessary permissions in your AndroidManifest.xml and Info.plist.

If you encounter specific issues during the setup, feel free to ask for more detailed assistance!

Best,

Abhinav

2025-10-10 00-19-44
Bruno Rendeiro

@Abhinav Shilwant 

1) I have already created my plugin following the instructions provided   here.

2)I am already using initSdk and then startSdk (all of this is in an action that is being called in OnApplicationReady). 

3)Now, here’s my problem. I am trying to do the following: 

Question: Is it logEvent or trackEvent? 

After using logEvent, I am receiving a 404 error. Do I need to create these events in the Appsflyer dashboard? Or do I need to configure the events I want to use in Appsflyer somewhere else? 

4)I’m not getting this. Is it necessary to create these permissions? Aren’t they automatically created in the Cordova code? I noticed that I am getting an error in logcat about "com.google.android.gms.ads.identifier.AdvertisingIdClient". Is this the permission that’s missing in the Cordova plugin? 



thanks

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.