How do I add In App Purchases for Android?

Get help using Construct 2

Post » Wed Dec 09, 2015 6:24 am

Hi all,

I was hoping someone can point me in the right direction. What is the recommended way to export your game for Android and have IAP with the Google Play store? I see that CocoonJS is a popular way, but isn't there a way to do this through Intel XDK using the Crosswalk Build? Anyways, I'm at a loss for finding the correct way to do this. There seems to be a lot of options out there, but I don't want to waste time going down the wrong path...
B
11
S
2
Posts: 28
Reputation: 704

Post » Wed Dec 09, 2015 10:18 am

In the tutorials : How to use AdMobs and IAP official plugins on Android Crosswalk/Intel XDK.

CocoonJS support has been officially dropped more than a year ago now.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
289
S
112
G
94
Posts: 7,333
Reputation: 69,287

Post » Wed Dec 09, 2015 8:23 pm

awesome, and thank you!
B
11
S
2
Posts: 28
Reputation: 704

Post » Wed Mar 16, 2016 7:06 pm

What order do you put them in, though? On Store Listing Success can't be made as a sub-event, so how do you know it's being called?

If purchase successful > go to Layout X

Global variable = x, check purchase if true, go to Layout X (If the device is already connected to the internet.)

Click button, check purchase if true, go to Layout X. (If they are not connected to the internet, the player would need to connect their device to the internet before clicking the button.)

^ How to do those three things?
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Mon Jun 06, 2016 6:37 pm

Kyatric wrote:In the tutorials : How to use AdMobs and IAP official plugins on Android Crosswalk/Intel XDK.

CocoonJS support has been officially dropped more than a year ago now.


Hello Kyatric. I noticed plenty of the users are turning to Cadburry Games' IAP plugin.
Is C2's IAP plugin still up-to-date?

Sorry if I have to ask but I can't test right now because I'm using an unstable connection.
Image Image Image
B
29
S
11
G
27
Posts: 730
Reputation: 17,002

Post » Mon Jun 06, 2016 9:02 pm

@MPPlantOfficial: As far as I'm aware it still should be.

@Phoenixbowman: "On Store Listing Success" is an event that will be triggered once the action "Request store listing" has been executed. Than on the tick of execution where the listing is returned and is true the condition will trigger.

Purchase successful happens after you have used the action "Purchase product".

In your second case you should rather be looking for the "Has product" condition rather than "Purchase successful", since you want apparently to check if your user already has bought a specific product in the past, not right now.
Same for your third case.

To check whether they are connected to internet or not, you should handle that test yourself, using the Browser plugin and the condition "Is online".
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
289
S
112
G
94
Posts: 7,333
Reputation: 69,287

Post » Tue Jun 07, 2016 8:41 am

Kyatric wrote:@MPPlantOfficial: As far as I'm aware it still should be.



Hey Kyatric. Tried to build today. Build Failed.

Here's the log:

Plugin "cordova-plugin-device" (1.1.1) installed.
Plugin "com.smartmobilesoftware.androidinappbilling" (3.0.2) installed.
Plugin "cordova-admob-sdklibs" (2.1.4) installed.
Plugin "cordova-plugin-admob-simple" (3.0.4) installed.
Plugin "cordova-plugin-whitelist" (1.2.1) installed.
Error: Plugin cc.fovea.cordova.purchase failed to install.
Error: Plugin com.mcm.plugins.androidinappbilling failed to install.

Plugin "cordova-plugin-inappbrowser" (1.4.0) installed.
Plugin "cordova-plugin-crosswalk-webview" (1.5.0) installed.

Will try to install this cc.fovea thing but it failed last week.
Image Image Image
B
29
S
11
G
27
Posts: 730
Reputation: 17,002

Post » Tue Jun 07, 2016 8:50 am

Tried another build. I found the CC. fovea thing and inputted my Billing Key and I'm getting this:

Plugin "cordova-plugin-device" (1.1.1) installed.
Plugin "com.smartmobilesoftware.androidinappbilling" (3.0.2) installed.
Plugin "cordova-admob-sdklibs" (2.1.4) installed.
Plugin "cordova-plugin-admob-simple" (3.0.4) installed.
Error: Plugin Purchase failed to install.
Plugin "cordova-plugin-whitelist" (1.2.1) installed.
Error: Plugin com.mcm.plugins.androidinappbilling failed to install.
Plugin "cordova-plugin-inappbrowser" (1.4.0) installed.
Plugin "cordova-plugin-crosswalk-webview" (1.5.0) installed.
Image Image Image
B
29
S
11
G
27
Posts: 730
Reputation: 17,002

Post » Tue Jun 07, 2016 8:55 am

I am still facing this issue ???

let me know if there is any other solution to this ????
Image
B
36
S
13
G
1
Posts: 99
Reputation: 3,051

Post » Tue Jun 07, 2016 9:00 am

miketolsa wrote:I am still facing this issue ???

let me know if there is any other solution to this ????



Check out my thread here which no one wants to reply to:

build-failed-all-plugins-present_t177252

EVEN IF you find the whole mcm.plugin thing, the build will still fail.
Guess this is why people are turning to the cadburygames plugin.
Image Image Image
B
29
S
11
G
27
Posts: 730
Reputation: 17,002

Next

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, unxcellent and 4 guests