poiuytrez / AndroidInAppBilling

Android App Billing plugin for Cordova
173 stars 144 forks source link

Plugin not working in PhoneGap 3.5. #82

Open ewpdesign opened 9 years ago

ewpdesign commented 9 years ago

I have upgraded to PhoneGap 3.5 and now the plugin is no longer working. Is the plugin compatible with PhoneGap 3.5? If so, can you refer me to some documentation on implementing plugins in 3.5? Thank you.

poiuytrez commented 9 years ago

This is the main guide: http://docs.phonegap.com/en/3.5.0/guide_hybrid_plugins_index.md.html

However, as it is a minor version that's weird that they broke the compatibility.

aL3xa commented 9 years ago

@ewpdesign can you please put output of errors that you get from error callback? For instance, I'm using PhoneGap v3.6 and I get this when I try to run init() method. While using full example and tapping the Initialize the billing plugin, I get alert with following message:

ERROR:
Problem setting up in-app billing: IabResult: Error checking for billing v3 support. (response: 3:Billing Unavailable)

It appears that response code suggests that Billing API version is not supported for the type requested. FTR, I'm using Android v2.3.5 and PlayStore v4.9.13.

Does this match your problem or should I file a new issue/RTFM? :smile:

ewpdesign commented 9 years ago

I'm not getting any errors that I am aware of. The first thing I noticed is that the packages do not show up in the src directory in eclipse like they did previously. I cannot find any plugin folders. I have rebuilt the project from scratch in Eclipse at least three times, thinking that I had done something wrong. (I upgraded to Eclipse 4.2 in the process of upgrading to Phonegap 3.5.) I figured that maybe it was going to display differently so I went ahead and built the APK anyway and loaded it on my phone. The plugin just doesn't respond. Please keep in mind that my experience is limited and that this is my first app, although I was able (after 10 months of trying) to get it completed and in the app store. I wish I could provide a better answer, but this is all I've got.

aL3xa commented 9 years ago

Hi @ewpdesign , thanks for lengthy reply. The problem that I've been having with the plugin was related only to country of residence (Serbia, FWIW). Once I installed & connected via VPN (TunnelBear), flushed Google Play and app data, billing plugin worked like a charm.

Note that I don't use Eclipse, but simple CLI (zsh) and Emacs. The only problem I had so far was with Android's versionCode (it was defaulting to 100), but I created a post_prepare hook to assign it manually and save AndroidManifest.xml. I can post a hook script if you need it.

So once again, with PhoneGap v3.6.0-0.21.18 and plugin v3.0.1 it works like a charm.

ewpdesign commented 9 years ago

Thank you aL3xa. I REALLY appreciate your comments. At least I know that is probably an Eclipse issue at this point, and there's some hope. I'll keep searching. Good luck!