Hi all,
I’m getting this error trying to use sdkbox iap on android with Google Play.
-
I’ve initialised the IAP plugin in Appdelegate
-
Created a listener and in the ctor called
sdkbox::IAP::setDebug(true);
sdkbox::IAP::setListener(this);
Do I need to do anything special in Google Play Console? Does the store listing need to be fully completed?
sdkbox_config.json
{
"android": {
"iap": {
"items": {
"remove_ads": {
"type": "non_consumable",
"id": "com.cocos2dx.non1"
},
"coin_package": {
"id": "com.cocos2dx.plugintest2"
},
"double_coin": {
"type": "non_consumable",
"id": "com.cocos2dx.non2"
},
"coin_package2": {
"id": "com.cocos2dx.plugintest3"
}
},
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq7eIGu7dRcBRBSC05cYvxjBMd7cqq9w6++1er+cqO2tyWPtWB4vuTkliq4k/Fkylx5UMfptdOYOW8ENgQyVucs/NyuOAGmve4j5JFhLPcLa6LjO2HUSY6zk04DRR9Zw7YPET4WAezZTz8jYMGhPG08HYltVj8cmSpSFWd1nI0pGOJoLQIMkIkXplgnPQRbMpuOu70vnQQBS1RFcoFT7OjaV8U0cfJzMoS1TMkGqaJKks2T+qOBNTtkXzge92EnvYIkhpCfN98dj6aQmETNp5yj5Fa+jcbAVF8dy5xymJwioL89XQKfKkGR+P6ESMoBEPfIZYIlMU8EUwmC+UKGLujQIDAQAB"
}
},
"ios": {
"iap": {
"items": {
"remove_ads": {
"type": "non_consumable",
"id": "com.cocos2dx.non1"
},
"double_coin": {
"type": "non_consumable",
"id": "com.cocos2dx.non2"
},
"coin_package": {
"id": "com.cocos2dx.plugintest2"
},
"coin_package2": {
"id": "com.cocos2dx.plugintest3"
}
}
}
}
}
EDIT
Tried to compile the sample for Android but im getting an error:
[armeabi] SharedLibrary : libcocos2dcpp.so
/Users/dmorton/Downloads/sdkbox-sample-iap-master/cpp/proj.android/../../../sdkbox-cocos2d-x-binary/cocos/editor-support/cocostudio/prebuilt-mk/../../../../prebuilt/android/armeabi/libcocostudio.a(CCActionNode.o):function std::vector<cocos2d::Vector<cocostudio::ActionFrame*>*, std::allocator<cocos2d::Vector<cocostudio::ActionFrame*>*> >::_M_range_check(unsigned int) const: error: undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
/Users/dmorton/Downloads/sdkbox-sample-iap-master/cpp/proj.android/../../../sdkbox-cocos2d-x-binary/cocos/editor-support/cocostudio/prebuilt-mk/../../../../prebuilt/android/armeabi/libcocostudio.a(CCArmature.o):function std::vector<std::string, std::allocator<std::string> >::_M_range_check(unsigned int) const: error: undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
/Users/dmorton/Downloads/sdkbox-sample-iap-master/cpp/proj.android/../../../sdkbox-cocos2d-x-binary/cocos/editor-support/cocostudio/prebuilt-mk/../../../../prebuilt/android/armeabi/libcocostudio.a(CCArmature.o):function std::vector<cocos2d::Vec2, std::allocator<cocos2d::Vec2> >::_M_range_check(unsigned int) const: error: undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
/Users/dmorton/Downloads/sdkbox-sample-iap-master/cpp/proj.android/../../../sdkbox-cocos2d-x-binary/cocos/editor-support/cocosbuilder/prebuilt-mk/../../../../prebuilt/android/armeabi/libcocosbuilder.a(CCNodeLoader.o):function std::vector<cocos2d::Value, std::allocator<cocos2d::Value> >::_M_range_check(unsigned int) const: error: undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [obj/local/armeabi/libcocos2dcpp.so] Error 1
make: Leaving directory `/Users/dmorton/Downloads/sdkbox-sample-iap-master/cpp/proj.android'
Error running command, return code: 2.
EDIT
No luck with the sample project but I think the problem is with XCode and the ios simulator. I have compiled my project and run it on Android, got the Error Authentication thingy which is related to me not Publishing my Alpha APK to the store before testing the IAPs
As for XCode and iOS does anyone know if I need to sign up for the Developer license with Apple in order to use IAP in the simulator? Will I need to set up IAP on iTunes Connect also??
EDIT
Ok seems obvious now but when running the ios simulator the sdkbox_config.json IAP ios
object is read and used. So this confirms that to test my app on the iOS simulator I need to set up my Apple developer account, lame.
I’m going to continue testing on my Android device for the Google Play Store, APK alpha version currently pending approval for publishing.
Final EDIT
Forgot to mention that I could only get the IAPs working with Googles test products and not with the ones from the sdkbox samples. These are the testing products for Android.
android.test.purchased : Buying this item will cause a successful purchase response.
android.test.canceled : Buying this item will act as if the user had canceled the purchase.
android.test.refunded : Buying this item will act as if the purchase was refunded.
android.test.item_unavailable : Buying this item will act as if this item was not added to the Google Developer Console for your game.
And my sdkbox_config.json
{
"iap": {
"coin_package": {
"id": "android.test.purchased"
}
},
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq7eIGu7dRcBRBSC05cYvxjBMd7cqq9w6++1er+cqO2tyWPtWB4vuTkliq4k/Fkylx5UMfptdOYOW8ENgQyVucs/NyuOAGmve4j5JFhLPcLa6LjO2HUSY6zk04DRR9Zw7YPET4WAezZTz8jYMGhPG08HYltVj8cmSpSFWd1nI0pGOJoLQIMkIkXplgnPQRbMpuOu70vnQQBS1RFcoFT7OjaV8U0cfJzMoS1TMkGqaJKks2T+qOBNTtkXzge92EnvYIkhpCfN98dj6aQmETNp5yj5Fa+jcbAVF8dy5xymJwioL89XQKfKkGR+P6ESMoBEPfIZYIlMU8EUwmC+UKGLujQIDAQAB"
}
},
"ios": {
"iap": {
"items": {
"coin_package": {
"id": "android.test.purchased"
}
}
}
}
}