DevDmitryHub / cordova-plugin-appsflyer

AppsFlyer plugin for Cordova (Phonegap)
3 stars 2 forks source link

Appsflyer and BackButton conflict on Cocoonjs #1

Closed thanhdeptrai closed 8 years ago

thanhdeptrai commented 8 years ago

Hi,

I'm experiencing a problem related to this Appsflyer plugin and BackButton on CocoonJS.

Normally, I add a callback for backbutton this way: document.addEventListener("backbutton",callback, false); And it works perfectly, After that, I tried window.plugins.appsFlyer.initSdk(args); I see that the appsflyer work normally, but then I notice that after init the SDK for AppsFlyer, the backbutton callback don't work anymore. No matter what I do, press the back button always close the app. And this ONLY happens after call initSdk

DevDmitryHub commented 8 years ago

Are you sure that you make subscribe and initSdk on 'deviceready' event? Also you should check that initSdk in your case is successful and it doesn't throw errors.

thanhdeptrai commented 8 years ago

Yes I did initSdk after the 'deviceready' event. The initSdk doesn't throw any error, either.

There is a small problem, though, window.CustomEvent = function(type, config) { var e = document.createEvent("CustomEvent"); e.initCustomEvent(type, true, true, config.detail); return e; } When the event 'onInstallConversionDataLoaded' is fired, the CocoonJS CustomEvent don't have initCustomEvent function, so I have to replace it. But I think this doesn't related to initSdk, since right after calling initSdk, the backbutton cause the app to close.

thanhdeptrai commented 8 years ago

Hi,

I can't seem to know what the problems is about CocoonJS or with your plugin yet.

I've ask this on CocoonJS's forum: Link topic but they seem to point out the library AF-Android-SDK-v3.3.0.jar which could be the problem.

I'm really confuse about the source of the problem right now. Please tell me if there's some other information you need.

thanhdeptrai commented 8 years ago

Hi ..... Is there something we can do about this.....

DevDmitryHub commented 8 years ago

I am not owner AF-Android-SDK, so I don't know about used implementation inside SDK. You can try ask AF support about it. Also try to downgrade or upgrade AF-Android-SDK version.

thanhdeptrai commented 8 years ago

Thank you for your reply. I'll check out your solutions then!

DevDmitryHub commented 8 years ago

Also can you publish anywhere a part of your source code with these listeners?