In-App Purchases, Billing Keys and Steak


#1
  • Cocoon Version:
    ‘Latest’ before 3.0 update took the compiler down for maintenance.

  • Basic description of the problem:
    I’m testing out the demo app for Cocoon’s own IAPs plugin, which I think is called Valentia.
    I have added my own products, changed the package name and successfully uploaded to the Playstore.
    Upon downloading the app from Playstore, I am not able to Fetch Products from the store or view any of the IAPs I have created.

One possible cause is that I haven’t included my Billing Key anywhere in the app or config file.
I have looked around the documentation and I can’t see where this key would be added.
Any information about where to add my billing key would be appreciated.
If you have no idea about IAPs or billing keys, I’m also keen to know what you like to drink when you eat steak. I usually go for a red wine, sometimes switching it up with a dark beer.

  • Device info:
    Android, API level 18

  • Steps will reproduce the problem:

  1. Compile the app in Webview+
  2. Upload to Playstore then install on device.
  3. Run and click Fetch Products.
  4. Squeal in indignant frustration when nothing appears.
  • Webview engine(s):
    Webview+.
    I haven’t tried the others, as I need Webview+ to ultimately incorporate the IAPs in my game made using CreateJS.

  • Used plugins (if relevant):


#2

Little update which might shed further light on my situation.

I am able to upload the compiled app to Playstore, but when I upload the APK I receive this message:

You uploaded an APK or Android App Bundle that does not have BILLING permission, or has a BILLING permission that is limited to specific sdk versions. BILLING permission is required for selling in-app products.

Does this indicate that the IAP plugin may only work for a limited range of SDK levels?


#3

In Construct 2, the plugin “CocoonIAP” does add the billing permission to the game / app. So this is nothing to add in your cocoon project.
I’m not sure how this works when you code your game in CreateJS, though.

Best
Andy


#4

Hi Andy, thanks for responding.

I am writing my game in HTML Javascript, using CreateJS as my graphics and sound plugin.
I have added the CocoonIAP plugin when I use the online compiler.
Is there an extra permission I need to add manually in the config.xml file?

The config file already includes and cordova-plugin-whitelist, but nothing which clearly states a billing permission.
Perhaps the plugin only works when added in Construct.

Thanks,

Stuart.


#5

Hi,
basically the plugin should add the permission it self when you using it.
Please see this “plugin.xml” file from the “InApp” Plugin.

<config-file target="app/src/main/AndroidManifest.xml" parent="/manifest">
            <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
            <uses-permission android:name="com.android.vending.BILLING" />
        </config-file>

So, once you install the " In-App Purchases for Google Play" in your cocoon project, it will add the BILLING permission to your apk.

You find the plugin at “Settings -> Plugins -> Cocoon”

Best,
Andy


#6

Have you been able to export a build since 3.0.0 update with working IAP? I also have a project built in C2 and I had IAP working fine before and now they will not work with the exact same configuration, having the plugin installed in cocoon. I’m also getting the billing error from google play. This is beyond frustrating.


#7

Yes, I have also problems to built at the moment with WebView+, but Canvas+ is working (at least it was yesterday). I’m using “latest”, what should be 2.3.0 as far as I can remember.

What error do you get for your build?

Best,
Andy


#8

Will try it in Canvas+ on those configurations.
I don’t get an error in the compiler, and it compiles without problems.
However, when the APK is uploaded in the Console it states that Billing permission is missing.
The app also sticks on “loading…” when you start it on device.

I don’t have any lines like that added in my config.xml.
This is on a HTML-only app, not made in Construct.
The only relevant lines in my config file are the plugin name and BILLING_ID parameter.

Thanks for keeping us informed @andy_reitberger, and thanks @nlb.nathan for showing me I’m not the only one.


#9

Yeah, like cyril said I’m not getting any compilation errors, but billing permission is no longer added and IAPs don’t work. Does your C2 export have billing permission when you upload it to google play? @andy_reitberger


#10

Has anyone had successful IAP with google play working after update? Would it be possible to compile with the old version now? This is breaking my project :confused: