"Has product" and "On purchase product" actions not working

Ideas and discussion about publishing and distributing your games

Post » Thu Apr 14, 2016 3:57 pm

Hello!
My configuration: Cranberry IAP plugin, Intel XDK, iOS.
I have a sandbox account and a collection of products in the itunes connect.
Actions "Request store listing" and "Purchase product" works fine.
But "Has product" and "On purchase product" do not act at all.
Under my sandbox user in any layout I run "Has product" every 3 seconds - no reaction.
Сan not find the reason. Everything looks right.
I will glad to any hints.
B
16
S
6
G
1
Posts: 115
Reputation: 1,964


Post » Sat Apr 16, 2016 11:13 am

When importing Intel XDK gives this error .
Image
Maybe this is the reason?

Also, when the installed build , iPhone regularly asks password.
And no longer do so when the build is removed.
B
16
S
6
G
1
Posts: 115
Reputation: 1,964

Post » Sat Apr 16, 2016 12:33 pm

I am no iOS expert, but according to recent C2 Cordova export this is the only thing that you should have in your intelxdk.config.additions.xml

Code: Select all
<!-- Change the debuggable preference to true to build a remote CDT debuggable app for -->
<!-- Crosswalk apps on Android 4.0+ devices and Cordova apps on Android 4.4+ devices. -->
<preference name="debuggable" value="false" />
<!-- IMPORTANT: set the debuggable preference to false before you build for the store! -->

<platform name="ios">
    <!-- below requires the splash screen plugin, otherwise ignored -->
    <!-- docs: https://github.com/apache/cordova-plugin-splashscreen -->
    <preference name="AutoHideSplashScreen" value="true" />
    <preference name="FadeSplashScreen" value="false"/>
    <preference name="FadeSplashScreenDuration" value="2"/>
    <preference name="ShowSplashScreenSpinner" value="false"/>

    <!-- below requires the status bar plugin, otherwise ignored -->
    <!-- docs: https://github.com/apache/cordova-plugin-statusbar -->
    <!-- see http://devgirl.org/2014/07/31/phonegap-developers-guid -->
    <preference name="StatusBarOverlaysWebView" value="false" />
    <preference name="StatusBarBackgroundColor" value="#000000" />
    <preference name="StatusBarStyle" value="lightcontent" />
</platform>


If you don't use www subdirectory in your Intel XDK project folder then this file gets overriden and you have to set it up everytime before the build. I wrote a tutorial about it http://tobyr.wtfgamesgroup.com/how-to-b ... -properly/. It's for Android Crosswalk but you will get the point because it's the same thing for iOS just different options.

Also let me know which library do you use in IntelXDK for IAP? Is it this one https://github.com/cranberrygame/cordov ... nt-iap.git or some other?
ImageImageImage
B
27
S
16
G
80
Posts: 1,014
Reputation: 44,747


Post » Sat Apr 16, 2016 1:40 pm

I do not remember how to come to this link http://cranberrygame.github.io/request_ ... a_plugins/
(now I did it from your link). Next, I bought a plug, and received a link to Google Drive with c2addons.
Possibly on them to understand what is library?


I do not use the www folder. Only export from Construct and import to XDK.
B
16
S
6
G
1
Posts: 115
Reputation: 1,964

Post » Sat Apr 16, 2016 2:00 pm

The contents of the intelxdk.config.additions.xml that from the Construct 2

<intelxdk:plugin intelxdk:name="cordova-plugin-inappbrowser" intelxdk:value="cordova-plugin-inappbrowser" />
<intelxdk:plugin intelxdk:name="https://github.com/cranberrygame/cordova-plugin-payment-iap" intelxdk:value="https://github.com/cranberrygame/cordova-plugin-payment-iap" />
<intelxdk:plugin intelxdk:name="uk.co.ilee.gamecenter" intelxdk:value="uk.co.ilee.gamecenter" />

Apparently , the library is https://github.com/cranberrygame/cordov ... ayment-iap
B
16
S
6
G
1
Posts: 115
Reputation: 1,964

Post » Sat Apr 16, 2016 2:26 pm

How come you had Cordova IAP C2 plugin before purchasing? Didn't you buy it second time now?

Anyway...
1. Add all plugins manually with plugin manager in Intel XDK (together with https://github.com/cranberrygame/cordov ... ayment-iap)
2. Just before building an app you should remove everything from your additions.xml if you don't use www directory
3. Paste there the code I included in the post above

As I said before I am no iOS expert, but this is suggested by Intel XDK to not include modules with additions. xml but with plugin manager.

If this still won't work for you then I can't help further as I don't even have an iOS device to test, so maybe some iOS developer can give some additional hints.
ImageImageImage
B
27
S
16
G
80
Posts: 1,014
Reputation: 44,747

Post » Sat Apr 16, 2016 2:56 pm

I absolutely do not remember how to come to this link http://cranberrygame.github.io/request_ ... a_plugins/
But most likely from here https://github.com/cranberrygame/cordov ... ayment-iap
No, I have bought a plug-in once on March 20 2016 :)

The algorithm of actions is clear! I start....

Thank you, BackendFreak!
B
16
S
6
G
1
Posts: 115
Reputation: 1,964

Post » Sat Apr 16, 2016 4:39 pm

Same.

I have used an option "Use new Intel XDK project format" and have received
Image
Image
It seems that the manual method could give.

The behavior is exactly the same as it was before.
Purchases work. "Has product", "On purchase product" and "Restore purchases"actions
do not do anything .
B
16
S
6
G
1
Posts: 115
Reputation: 1,964

Next

Return to Distribution and Publishing

Who is online

Users browsing this forum: No registered users and 1 guest