Hi, I have make it work on iOS, same code in Android not work…
I have followed this tutorial:
http://blog.cocos2d-x.org/2015/06/integrate-iap-for-google-play-with-sdkbox/
step by step.
I’m using cocos2d 3.8.1
and SDKBOX v1.0.0.11 (strange thing… I used sdkbox update in command line and seems that had installed 1.0.0.18… however IPA package are up to date 2.3.3.4)
my sdkbox_config.json
{
"android": {
"iap": {
"items": {
"01_Premium": {
"id": "it.enigma.jackpot.premium"
},
"02_Premium_plus": {
"id": "it.enigma.jackpot.premium_plus"
},
"03_avventura": {
"type": "non_consumable",
"id": "it.enigma.jackpot.avventura5"
}
},
"key": "my_key_without_spaces"
}
},
"ios": {
"iap": {
"items": {
"01_Premium": {
"type": "non_consumable",
"id": "it.enigma.Jackpot.Premium"
},
"02_Premium_plus": {
"type": "non_consumable",
"id": "it.enigma.Jackpot.premium_plus"
},
"03_avventura": {
"type": "non_consumable",
"id": "it.enigma.Jackpot.avventura5"
},
"04_sopravvivenza": {
"type": "non_consumable",
"id": "it.enigma.Jackpot.sopravvivenza5"
},
"05_controtempo": {
"type": "non_consumable",
"id": "it.enigma.Jackpot.countertime5"
},
"06_3_aiuti": {
"type": "consumable",
"id": "it.enigma.Jackpot.3aiuti"
},
"07_10_aiuti": {
"type": "consumable",
"id": "it.enigma.Jackpot.10aiuti"
},
"08_30_aiuti": {
"type": "consumable",
"id": "it.enigma.Jackpot.30aiuti"
}
}
}
}
}
and here eclipse log
10-20 19:17:52.445: D/IAP(6668): creating Products list:
10-20 19:17:52.445: I/IAP(6668): init Google store again, skip
10-20 19:17:52.445: I/IAP(6668): init Google IAP
10-20 19:17:52.445: I/IAP(6668): IAB helper created.
10-20 19:17:52.445: D/IAP(6668): Starting setup.
10-20 19:17:52.445: D/IAP(6668): Starting in-app billing setup.
10-20 19:17:52.450: I/IAP(6668): Billing service connected.
10-20 19:17:52.450: D/IAP(6668): Checking for in-app billing 3 support.
10-20 19:17:52.455: I/Finsky(3844): [7] com.google.android.finsky.billing.iab.m.a(158): it.enigma.Jackpot: Account from first account - [0LUwmiVDsHAVgk_eB2_Q8g7FD8g]
10-20 19:17:52.455: D/IAP(6668): In-app billing version 3 supported for it.enigma.Jackpot
10-20 19:17:52.460: I/Finsky(3844): [28] com.google.android.finsky.billing.iab.m.a(158): it.enigma.Jackpot: Account from first account - [0LUwmiVDsHAVgk_eB2_Q8g7FD8g]
10-20 19:17:52.460: D/IAP(6668): Subscriptions AVAILABLE.
10-20 19:17:52.460: D/IAP(6668): Setup finished.
10-20 19:17:52.460: D/IAP(6668): Setup successful. Querying inventory.
10-20 19:17:52.460: D/IAP(6668): Requesting Products: 'it.enigma.jackpot.premium,it.enigma.jackpot.premium_plus,it.enigma.jackpot.avventura5'
10-20 19:17:52.460: D/IAP(6668): NetWork reachable : true
10-20 19:17:52.460: D/IAP(6668): Starting async operation: refresh inventory
10-20 19:17:52.460: D/IAP(6668): Refreshing products: 'it.enigma.jackpot.premium,it.enigma.jackpot.premium_plus,it.enigma.jackpot.avventura5'
10-20 19:17:52.460: D/IAP(6668): Requesting Products: 'it.enigma.jackpot.premium,it.enigma.jackpot.premium_plus,it.enigma.jackpot.avventura5'
10-20 19:17:52.460: D/IAP(6668): NetWork reachable : true
10-20 19:17:52.460: D/IAP(6668): Refreshing products: 'it.enigma.jackpot.premium,it.enigma.jackpot.premium_plus,it.enigma.jackpot.avventura5'
10-20 19:17:52.460: D/IAP(6668): Requesting Products: 'it.enigma.jackpot.premium,it.enigma.jackpot.premium_plus,it.enigma.jackpot.avventura5'
10-20 19:17:52.460: D/IAP(6668): NetWork reachable : true
10-20 19:17:52.460: E/IAP(6668): Query inventory state exception. Please retry in a few seconds.
10-20 19:17:52.460: D/IAP(6668): Ending async operation: refresh inventory
10-20 19:17:52.460: D/IAP(6668): Querying owned items, item type: inapp
10-20 19:17:52.460: D/IAP(6668): Package name: it.enigma.Jackpot
10-20 19:17:52.460: D/IAP(6668): Calling getPurchases with continuation token: null
10-20 19:17:52.460: D/IAP(6668): Starting async operation: refresh inventory
10-20 19:17:52.470: I/Finsky(3844): [8] com.google.android.finsky.billing.iab.m.a(158): it.enigma.Jackpot: Account from first account - [0LUwmiVDsHAVgk_eB2_Q8g7FD8g]
10-20 19:17:52.470: D/IAP(6668): Owned items response: 0
10-20 19:17:52.470: D/IAP(6668): Continuation token: null
10-20 19:17:52.470: D/IAP(6668): Querying SKU details.
10-20 19:17:52.470: D/IAP(6668): Querying owned items, item type: inapp
10-20 19:17:52.470: D/IAP(6668): Package name: it.enigma.Jackpot
10-20 19:17:52.470: D/IAP(6668): Calling getPurchases with continuation token: null
10-20 19:17:52.475: I/Finsky(3844): [7] com.google.android.finsky.billing.iab.m.a(158): it.enigma.Jackpot: Account from first account - [0LUwmiVDsHAVgk_eB2_Q8g7FD8g]
10-20 19:17:52.480: I/Finsky(3844): [28] com.google.android.finsky.billing.iab.m.a(158): it.enigma.Jackpot: Account from first account - [0LUwmiVDsHAVgk_eB2_Q8g7FD8g]
10-20 19:17:52.480: D/IAP(6668): Owned items response: 0
10-20 19:17:52.480: D/IAP(6668): Continuation token: null
10-20 19:17:52.480: D/IAP(6668): Querying SKU details.
10-20 19:17:52.485: I/Finsky(3844): [8] com.google.android.finsky.billing.iab.m.a(158): it.enigma.Jackpot: Account from first account - [0LUwmiVDsHAVgk_eB2_Q8g7FD8g]
10-20 19:17:52.485: D/IAP(6668): Querying owned items, item type: subs
10-20 19:17:52.485: D/IAP(6668): Package name: it.enigma.Jackpot
10-20 19:17:52.485: D/IAP(6668): Calling getPurchases with continuation token: null
10-20 19:17:52.490: I/Finsky(3844): [28] com.google.android.finsky.billing.iab.m.a(158): it.enigma.Jackpot: Account from first account - [0LUwmiVDsHAVgk_eB2_Q8g7FD8g]
10-20 19:17:52.490: D/IAP(6668): Owned items response: 0
10-20 19:17:52.495: D/IAP(6668): Continuation token: null
10-20 19:17:52.495: D/IAP(6668): Querying SKU details.
10-20 19:17:52.500: I/Finsky(3844): [7] com.google.android.finsky.billing.iab.m.a(158): it.enigma.Jackpot: Account from first account - [0LUwmiVDsHAVgk_eB2_Q8g7FD8g]
10-20 19:17:52.500: D/IAP(6668): Querying owned items, item type: subs
10-20 19:17:52.500: D/IAP(6668): Package name: it.enigma.Jackpot
10-20 19:17:52.500: D/IAP(6668): Calling getPurchases with continuation token: null
10-20 19:17:52.505: I/Finsky(3844): [28] com.google.android.finsky.billing.iab.m.a(158): it.enigma.Jackpot: Account from first account - [0LUwmiVDsHAVgk_eB2_Q8g7FD8g]
10-20 19:17:52.505: D/IAP(6668): Owned items response: 0
10-20 19:17:52.505: D/IAP(6668): Continuation token: null
10-20 19:17:52.505: D/IAP(6668): Querying SKU details.
10-20 19:17:52.510: I/Finsky(3844): [8] com.google.android.finsky.billing.iab.m.a(158): it.enigma.Jackpot: Account from first account - [0LUwmiVDsHAVgk_eB2_Q8g7FD8g]
10-20 19:17:52.510: D/IAP(6668): Ending async operation: refresh inventory
10-20 19:17:52.515: D/IAP(6668): Ending async operation:
10-20 19:17:52.525: D/IAP(6668): Query inventory finished.
10-20 19:17:52.525: D/IAP(6668): Query inventory was successful.
10-20 19:17:52.525: D/IAP(6668): GooglePlay Request result : 0 msg : Product request successful. data :[]
10-20 19:17:52.525: D/IAP(6668): Query inventory finished.
10-20 19:17:52.525: D/IAP(6668): Query inventory was successful.
10-20 19:17:52.525: D/IAP(6668): GooglePlay Request result : 0 msg : Product request successful. data :[]
AndroidManifest
<?xml version='1.0' encoding='UTF-8'?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="it.enigma.Jackpot" android:installLocation="auto" android:versionCode="1" android:versionName="1.0">
<uses-sdk android:minSdkVersion="9" />
<uses-feature android:glEsVersion="0x00020000" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<meta-data android:name="android.app.lib_name" android:value="cocos2dcpp" />
<activity android:configChanges="orientation" android:label="@string/app_name" android:name="org.cocos2dx.cpp.AppActivity" android:screenOrientation="landscape" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
</application>
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.android.vending.BILLING" />
</manifest>
I have tested in 2 devices, exporting signed apk, uploaded and installed the same apk using adb install
I’m stuck here for many days…
Where should I point my attention?
thanks