Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Cordova Plugin Purchase and using it with Google Play Developer Console

I am using the Cordova Plugin Purchase in my Cordova project. I have tried installing it using Cordova CLI 5.1 and now 6.0.0. I have added my billing key from the developer console in two locations just to see if one worked. Added it to the fetch.json as a variable

"cc.fovea.cordova.purchase": {
    "source": {
        "type": "git",
        "url": "https://github.com/j3k0/cordova-plugin-purchase.git",
        "subdir": "."
    },
    "is_top_level": true,
  "variables": {
    "BILLING_KEY": "MY_KEY"
  }

and to the config.xml

 <plugin name="cc.fovea.cordova.purchase" version="4.0.0" src="https://github.com/j3k0/cordova-plugin-purchase.git">
<param name="BILLING_KEY" value="MY_KEY" />

Also, in my AndroidManifest.xml I added:

<uses-permission android:name="com.android.vending.BILLING" />

I have followed the steps located on the setup and help screens at the plugins site, but I have still not been able to upload an APK which adds the billing permission. When uploaded it does not say there are any new added permissions and even if I click save anyway and then navigate to the In-app Products tab I still get the message saying, "To add in-app products, you need to add the BILLING permission to your APK."

I have read thru many questions on stack overflow and on the web, but I feel like I am missing a step somewhere. Any ideas or more detailed walk thru's that I might be missing?

Update: I have updated to Visual Studio Tools for Apache Cordova 6 and tried to re-install the package. Still no billing permission and when I try to add it myself nothing happens....

like image 925
DigitalMystery Avatar asked Oct 31 '22 09:10

DigitalMystery


1 Answers

After many attempts and hours wasted I switched to a different plugin that has been very easy to install and work with. The only downside as of now is that it does not support windows phone. I could use one that works on all, but this was very easy to set up. I know this does not truly answer my question on the above plugin, but it was the best route I found for now. Below are the links to the location on github and Alex's blog site for more instructions.

Cordova Plugin InAppPurchase

Alex Disler Blog

UPDATE 6/10

After I saw the update for Visual Studio Apache Cordova 10 was released I decided I would attempt this one more time..... And it now works. They even give you the ability to add parameters which is why I assume it works. Still not sure why it might have worked for others, but either way if you have the same trouble just update to CLI 6.2.0

Apache Cordova Release 10

like image 200
DigitalMystery Avatar answered Nov 27 '22 20:11

DigitalMystery