Hi ,I have used IAB for google play and I tested ,and it is all fine. I have used the a similar code for amazon. Except I have not set the key this time. I have not tested it .But when I submitted the product for amazon,
Amazon get this: 1. Install and launch the app. 2. Tap on Unlock Now. 3. "An Error occurred while processing your purchase" is displayed.
Do I use the IAP title in the general information when I set the product?
second, yes you don't need to provide key for amazon and you need to use sku as product ID
third, it is really easy to test amazon iaps, all you need is to download JSON data from amazon website (in the same place, where you created inapp purchases) and place it on the device in sdcard root folder. And then you need to install app tester on your device: http://www.amazon.com/Amazon-App-Tester/dp/B00BN3YZM2/
It works great on Amazon devices, unfortunately I don't know about simple Android devices.
@ar2rsawseen Thanks for the fast response. I will try this. Do I pass the SKU as a string? By the way I have not been here for a while. How are you doing? What other exciting projects you are involved in with now?
I am now mostly working for Countly, and have couple of side projects, so practically no time for gamedev for now, but still have plenty of game ideas I want to create eventually, just for the sake of creating them
How is your game, Sea of Giants doing? Any insights on stats you can provide, because it is really interesting to see how such big and polished game is doing on todays market
I am now mostly working for Countly, and have couple of side projects, so practically no time for gamedev for now, ...
Hello That is great to hear,By the way what is your real name I just know you by your forum name my name is Bo. The game done pretty well on amazon and Google play,on iOS is ok. I am playing around with some advertising methods. At the moment I am looking for a partner in business ,so I can take it this to next level. I am not just looking for any partner, somebody who got some skills and talent. if are interested ,maybe we can talk. Thanks
i bet something wrong with the files you added to xcode. Delete them and try again. Make sure you added all needed frameworks to your project, check linker option and build settings.
The problem was that I'd created a new version of IabIos.mm and I'd renamed the old version as IabIo-sold.mm. The problem was that I saw all the time "IabIo-sold.mm" (with the "sold" word) and I was thinking was something to do with the plugin...
I delete that file and the project was built correctly.
I have a test user (iTunes Connect) and I have built a GiderosPlayer changing the name to the one of my game (bundle, etc). There isn't user logged in the device. I run my game with that GiderosPlayer and iab.isAvailable is executed but it doesn't ask for iTunes Store login. And after isAvailable and requestProducts calls are ok (without ask for the store login) I call to purchase an item. Then the "cannot connect to store" error is showed (Purchase_Error event is raised).
How could I achieve a correct test environment with GiderosPlayer for IAP?
I did not rename my app but just flipped a flag gdr_initialize(..., false) to gdr_initialize(..., true) - this will make it as a player. http://docs.giderosmobile.com/deployment.html
Then deploy the player to your actual device and run your gideros app from gideros studio.
if it does not work, check your setup on itunes. I posted a few links above in my previous posts that explain what can go wrong.
@SimplesApps I ended up using the same iOS app and by flipping that flag it will become a player.
Right, these articles helped me a lot but if you were able to request product details successfully, I am not sure why it does not work with purchases. Double check you use correct product ID and product has a screenshot uploaded and activated for sale.
Go to your device settings and find app store settings - make sure to sign out from your current account and use your test accounts only.
@boriskey The in-app product is not yet activated for sale because it's the first iap for the app. I can't submit for review until I submit the new app version for review (that will include the in-app management).
I suppose I could test it anyway before I can submit for review with the new app version. If not it will be a death lock…
Neither Apple developer documentation is not clear.
You need to create a product, upload a screenshot (can be anything at this point) so the product will change status to "ready for review". Then on the app itunes page, you need to check the box somewhere to enable that product (Cleared for Sale I think). So it is a two step process and it is described very well in the link I gave above.
This is done before you submit your app for review and yes, you can test it prior to submission.
But I am puzzled that you said earlier that you can fetch product info from itunes but cannot make the purchase. This is not normal but I am not sure what could go wrong. My app was approved just 2 weeks ago and both purchase and restore work fine.
@boriskey Yes, I added the product correctly to iTunes Connect; the status is "Ready to Submit" and it's approved for sale. I've created a new app version adding the product to the IAP section (the product will be submitting with the app version).
The problem is that I call IsAvailable() and the Event.AVAILABLE is reached (although there is no login prompt). After that I call requestProducts() and the Event.PRODUCTS_COMPLETE is reached (although with 0 products received…). After that I call purchase("product") and then the error "Cannot connect to iTunes Store" is issued.
Yesterday I updated the iap's (delete and create them again) in iTunes Connect and today they are working (I guess I had to wait some time to be updated from Apple's servers), as http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/ indicates in the "8. Wait a Few Hours" section…
The login to store is prompted when I call to the purchase method.
@boriskey I used the iabios.mm you fixed but I'm having a similar issue when there are multiple products (I have two). The Event.PRODUCTS_COMPLETE are raised every time and they're accumulated (1st call it's ok: one list, 2nd call: two time the list,…). I guess they're in the queue and they have to be finished (or released).
I have two products and the Event.PRODUCTS_COMPLETE is raised with the previous accumulated calls. I guess they're in the queue and they have to be finished (or released). It's the same issue that @boriskey fixed but related to the products complete events.
Please, let me know if you had the same issue and how did you solve it?
@SimplesApps I have only one product and it worked fine for me. You can try to put a logging print out in every method and run it step by step and see what happens. I am also not an iOS guy unfortunately.
Using google billing for IAB, purchased a product ID 'p1' but hadn't set it as a consumable. Now PURCHASE_COMPLETE gets called for 'p1' everytime a new instance of IAB is initiated. Possible to manually set it as consumed?
Ok. Integrated iab with crashlytics. Crashlytics shows many crashes Most important:
java.lang.NoClassDefFoundError: com/giderosmobile/android/player/HTTPThread at com.giderosmobile.android.player.HTTPManager.Get(HTTPManager.java:20) at com.giderosmobile.android.player.HTTPManager.ghttp_Get(HTTPManager.java:125) at com.giderosmobile.android.player.GiderosApplication.nativeDrawFrame(GiderosApplication.java) at com.giderosmobile.android.player.GiderosApplication.onDrawFrame(GiderosApplication.java:492) at com.giderosmobile.android.GiderosRenderer.onDrawFrame(sostavslovoActivity.java:252) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1516) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240) Caused by: java.lang.NullPointerException at com.giderosmobile.android.plugins.iab.frameworks.google.IabHelper.startSetup(IabHelper.java:267) at com.giderosmobile.android.plugins.iab.frameworks.IabGoogle.init(IabGoogle.java:66) at com.giderosmobile.android.plugins.iab.Iab.setup(Iab.java:153) at com.giderosmobile.android.player.GiderosApplication.nativeDrawFrame(GiderosApplication.java) at com.giderosmobile.android.player.GiderosApplication.onDrawFrame(GiderosApplication.java:492) at com.giderosmobile.android.GiderosRenderer.onDrawFrame(sostavslovoActivity.java:252) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1516) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
and
java.lang.NullPointerException at com.giderosmobile.android.plugins.iab.frameworks.google.IabHelper.queryPurchases(IabHelper.java:851) at com.giderosmobile.android.plugins.iab.frameworks.google.IabHelper.queryInventory(IabHelper.java:549) at com.giderosmobile.android.plugins.iab.frameworks.google.IabHelper.queryInventory(IabHelper.java:527) at com.giderosmobile.android.plugins.iab.frameworks.google.IabHelper$2.run(IabHelper.java:622) at java.lang.Thread.run(Thread.java:841)
Comments
Likes: vitalitymobile
I have used the a similar code for amazon.
Except I have not set the key this time.
I have not tested it .But when I submitted the product for amazon,
Amazon get this:
1. Install and launch the app.
2. Tap on Unlock Now.
3. "An Error occurred while processing your purchase" is displayed.
Do I use the IAP title in the general information when I set the product?
And what is the best way to test this?
I have found this:
https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/testing-iap-2.0
https://github.com/gideros/giderosplugins/tree/master/IAB
because it supports amazon IAP 2.0
second, yes you don't need to provide key for amazon and you need to use sku as product ID
third, it is really easy to test amazon iaps, all you need is to download JSON data from amazon website (in the same place, where you created inapp purchases) and place it on the device in sdcard root folder.
And then you need to install app tester on your device:
http://www.amazon.com/Amazon-App-Tester/dp/B00BN3YZM2/
It works great on Amazon devices, unfortunately I don't know about simple Android devices.
Thanks for the fast response.
I will try this.
Do I pass the SKU as a string?
By the way I have not been here for a while.
How are you doing?
What other exciting projects you are involved in with now?
I am now mostly working for Countly, and have couple of side projects, so practically no time for gamedev for now, but still have plenty of game ideas I want to create eventually, just for the sake of creating them
How is your game, Sea of Giants doing? Any insights on stats you can provide, because it is really interesting to see how such big and polished game is doing on todays market
That is great to hear,By the way what is your real name I just know you by your forum name
my name is Bo.
The game done pretty well on amazon and Google play,on iOS is ok.
I am playing around with some advertising methods.
At the moment I am looking for a partner in business ,so I can take it this to next level.
I am not just looking for any partner, somebody who got some skills and talent.
if are interested ,maybe we can talk.
Thanks
But currently I have really a lot on my plate, so unfortunately not looking any additional projects to join
I'm adding IAP for the iOS version of my game (Action Basket) using the IAB plugin.
First of all, I'm building the GiderosPlayer with the IAB plugin but I get these errors:
duplicate symbol _OBJC_IVAR_$_IabIos._iap in:
/Users/I/Library/Developer/Xcode/DerivedData/GiderosiOSPlayer-abjvdvkstriuvgbuldkajbesizee/Build/Intermediates/GiderosiOSPlayer.build/Debug-iphoneos/GiderosiOSPlayer.build/Objects-normal/armv7s/IabIo-sold.o
/Users/I/Library/Developer/Xcode/DerivedData/GiderosiOSPlayer-abjvdvkstriuvgbuldkajbesizee/Build/Intermediates/GiderosiOSPlayer.build/Debug-iphoneos/GiderosiOSPlayer.build/Objects-normal/armv7s/IabIos.o
duplicate symbol _OBJC_IVAR_$_IabIos._prods in:
/Users/I/Library/Developer/Xcode/DerivedData/GiderosiOSPlayer-abjvdvkstriuvgbuldkajbesizee/Build/Intermediates/GiderosiOSPlayer.build/Debug-iphoneos/GiderosiOSPlayer.build/Objects-normal/armv7s/IabIo-sold.o
/Users/I/Library/Developer/Xcode/DerivedData/GiderosiOSPlayer-abjvdvkstriuvgbuldkajbesizee/Build/Intermediates/GiderosiOSPlayer.build/Debug-iphoneos/GiderosiOSPlayer.build/Objects-normal/armv7s/IabIos.o
duplicate symbol _OBJC_IVAR_$_IabIos._prodKeys in:
/Users/I/Library/Developer/Xcode/DerivedData/GiderosiOSPlayer-abjvdvkstriuvgbuldkajbesizee/Build/Intermediates/GiderosiOSPlayer.build/Debug-iphoneos/GiderosiOSPlayer.build/Objects-normal/armv7s/IabIo-sold.o
/Users/I/Library/Developer/Xcode/DerivedData/GiderosiOSPlayer-abjvdvkstriuvgbuldkajbesizee/Build/Intermediates/GiderosiOSPlayer.build/Debug-iphoneos/GiderosiOSPlayer.build/Objects-normal/armv7s/IabIos.o
duplicate symbol _OBJC_METACLASS_$_IabIos in:
/Users/I/Library/Developer/Xcode/DerivedData/GiderosiOSPlayer-abjvdvkstriuvgbuldkajbesizee/Build/Intermediates/GiderosiOSPlayer.build/Debug-iphoneos/GiderosiOSPlayer.build/Objects-normal/armv7s/IabIo-sold.o
/Users/I/Library/Developer/Xcode/DerivedData/GiderosiOSPlayer-abjvdvkstriuvgbuldkajbesizee/Build/Intermediates/GiderosiOSPlayer.build/Debug-iphoneos/GiderosiOSPlayer.build/Objects-normal/armv7s/IabIos.o
duplicate symbol _OBJC_CLASS_$_IabIos in:
/Users/I/Library/Developer/Xcode/DerivedData/GiderosiOSPlayer-abjvdvkstriuvgbuldkajbesizee/Build/Intermediates/GiderosiOSPlayer.build/Debug-iphoneos/GiderosiOSPlayer.build/Objects-normal/armv7s/IabIo-sold.o
/Users/I/Library/Developer/Xcode/DerivedData/GiderosiOSPlayer-abjvdvkstriuvgbuldkajbesizee/Build/Intermediates/GiderosiOSPlayer.build/Debug-iphoneos/GiderosiOSPlayer.build/Objects-normal/armv7s/IabIos.o
ld: 5 duplicate symbols for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Please, you know how these errors could be fixed?
Thanks.
https://play.google.com/store/apps/developer?id=SimplesApps
http://www.amazon.com/gp/mas/dl/android?p=com.simplesapps.actionbasket
https://itunes.apple.com/artist/david-rodriguez/id763996989
https://play.google.com/store/apps/developer?id=SimplesApps
http://www.amazon.com/gp/mas/dl/android?p=com.simplesapps.actionbasket
https://itunes.apple.com/artist/david-rodriguez/id763996989
The problem was that I'd created a new version of IabIos.mm and I'd renamed the old version as IabIo-sold.mm. The problem was that I saw all the time "IabIo-sold.mm" (with the "sold" word) and I was thinking was something to do with the plugin...
I delete that file and the project was built correctly.
Many thanks.
https://play.google.com/store/apps/developer?id=SimplesApps
http://www.amazon.com/gp/mas/dl/android?p=com.simplesapps.actionbasket
https://itunes.apple.com/artist/david-rodriguez/id763996989
@boriskey @jdbc How do you test your games with IAP?
I have a test user (iTunes Connect) and I have built a GiderosPlayer changing the name to the one of my game (bundle, etc). There isn't user logged in the device. I run my game with that GiderosPlayer and iab.isAvailable is executed but it doesn't ask for iTunes Store login. And after isAvailable and requestProducts calls are ok (without ask for the store login) I call to purchase an item. Then the "cannot connect to store" error is showed (Purchase_Error event is raised).
How could I achieve a correct test environment with GiderosPlayer for IAP?
Many thanks.
https://play.google.com/store/apps/developer?id=SimplesApps
http://www.amazon.com/gp/mas/dl/android?p=com.simplesapps.actionbasket
https://itunes.apple.com/artist/david-rodriguez/id763996989
http://docs.giderosmobile.com/deployment.html
Then deploy the player to your actual device and run your gideros app from gideros studio.
if it does not work, check your setup on itunes. I posted a few links above in my previous posts that explain what can go wrong.
I was renaming the player to my app name.
Do you mean to deploy the app (instead the player) flipping the flag?
I'd readed all the posts regarding IAB and I'd changed the "IabIos.mm" with your code (this was the cause I had the problem with the duplicate symbols before):
http://giderosmobile.com/forum/discussion/comment/38788#Comment_38788
Yes, I'm testing with the player deployed to an actual device and running app from Gideros Studio but I don't know what can be wrong.
Do you refer to these two links?
http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/
http://www.cocoanetics.com/2010/02/things-i-learned-implementing-my-first-inapppurchase/
I don't know why there are no prompt for login to the store.
I'll continue checking all the process again until I find the issue.
https://play.google.com/store/apps/developer?id=SimplesApps
http://www.amazon.com/gp/mas/dl/android?p=com.simplesapps.actionbasket
https://itunes.apple.com/artist/david-rodriguez/id763996989
Right, these articles helped me a lot but if you were able to request product details
successfully, I am not sure why it does not work with purchases. Double check you use correct product ID and product has a screenshot uploaded and activated for sale.
Go to your device settings and find app store settings - make sure to sign out from your current account and use your test accounts only.
I suppose I could test it anyway before I can submit for review with the new app version.
If not it will be a death lock…
Neither Apple developer documentation is not clear.
https://play.google.com/store/apps/developer?id=SimplesApps
http://www.amazon.com/gp/mas/dl/android?p=com.simplesapps.actionbasket
https://itunes.apple.com/artist/david-rodriguez/id763996989
http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/
You need to create a product, upload a screenshot (can be anything at this point) so the product will change status to "ready for review". Then on the app itunes page, you need to check the box somewhere to enable that product (Cleared for Sale I think). So it is a two step process and it is described very well in the link I gave above.
This is done before you submit your app for review and yes, you can test it prior to submission.
But I am puzzled that you said earlier that you can fetch product info from itunes but cannot make the purchase. This is not normal but I am not sure what could go wrong. My app was approved just 2 weeks ago and both purchase and restore work fine.
The problem is that I call IsAvailable() and the Event.AVAILABLE is reached (although there is no login prompt). After that I call requestProducts() and the Event.PRODUCTS_COMPLETE is reached (although with 0 products received…). After that I call purchase("product") and then the error "Cannot connect to iTunes Store" is issued.
I'm really stuck with that problem.
I appreciate your help. Thanks for your time.
https://play.google.com/store/apps/developer?id=SimplesApps
http://www.amazon.com/gp/mas/dl/android?p=com.simplesapps.actionbasket
https://itunes.apple.com/artist/david-rodriguez/id763996989
I got it. Now the IAB in iOS is working for me!
Yesterday I updated the iap's (delete and create them again) in iTunes Connect and today they are working (I guess I had to wait some time to be updated from Apple's servers), as
http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/
indicates in the "8. Wait a Few Hours" section…
The login to store is prompted when I call to the purchase method.
@boriskey I used the iabios.mm you fixed but I'm having a similar issue when there are multiple products (I have two). The Event.PRODUCTS_COMPLETE are raised every time and they're accumulated (1st call it's ok: one list, 2nd call: two time the list,…). I guess they're in the queue and they have to be finished (or released).
https://play.google.com/store/apps/developer?id=SimplesApps
http://www.amazon.com/gp/mas/dl/android?p=com.simplesapps.actionbasket
https://itunes.apple.com/artist/david-rodriguez/id763996989
@boriskey @ar2rsawseen @jdbc Did you check the IAB plugin with more than one product?
I have two products and the Event.PRODUCTS_COMPLETE is raised with the previous accumulated calls. I guess they're in the queue and they have to be finished (or released).
It's the same issue that @boriskey fixed but related to the products complete events.
Please, let me know if you had the same issue and how did you solve it?
Thanks a lot.
https://play.google.com/store/apps/developer?id=SimplesApps
http://www.amazon.com/gp/mas/dl/android?p=com.simplesapps.actionbasket
https://itunes.apple.com/artist/david-rodriguez/id763996989
Have you checked the IAB plugin with more than one product as I explain above?
Many thanks!
https://play.google.com/store/apps/developer?id=SimplesApps
http://www.amazon.com/gp/mas/dl/android?p=com.simplesapps.actionbasket
https://itunes.apple.com/artist/david-rodriguez/id763996989
From the google billing v3 ref:
purchaseState: The purchase state of the order. Possible values are 0 (purchased), 1 (canceled), or 2 (refunded).
Likes: SinisterSoft, simwhi
Crashlytics shows many crashes
Most important:
java.lang.NoClassDefFoundError: com/giderosmobile/android/player/HTTPThread
at com.giderosmobile.android.player.HTTPManager.Get(HTTPManager.java:20)
at com.giderosmobile.android.player.HTTPManager.ghttp_Get(HTTPManager.java:125)
at com.giderosmobile.android.player.GiderosApplication.nativeDrawFrame(GiderosApplication.java)
at com.giderosmobile.android.player.GiderosApplication.onDrawFrame(GiderosApplication.java:492)
at com.giderosmobile.android.GiderosRenderer.onDrawFrame(sostavslovoActivity.java:252)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1516)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
Caused by: java.lang.NullPointerException
at com.giderosmobile.android.plugins.iab.frameworks.google.IabHelper.startSetup(IabHelper.java:267)
at com.giderosmobile.android.plugins.iab.frameworks.IabGoogle.init(IabGoogle.java:66)
at com.giderosmobile.android.plugins.iab.Iab.setup(Iab.java:153)
at com.giderosmobile.android.player.GiderosApplication.nativeDrawFrame(GiderosApplication.java)
at com.giderosmobile.android.player.GiderosApplication.onDrawFrame(GiderosApplication.java:492)
at com.giderosmobile.android.GiderosRenderer.onDrawFrame(sostavslovoActivity.java:252)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1516)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
and
java.lang.NullPointerException
at com.giderosmobile.android.plugins.iab.frameworks.google.IabHelper.queryPurchases(IabHelper.java:851)
at com.giderosmobile.android.plugins.iab.frameworks.google.IabHelper.queryInventory(IabHelper.java:549)
at com.giderosmobile.android.plugins.iab.frameworks.google.IabHelper.queryInventory(IabHelper.java:527)
at com.giderosmobile.android.plugins.iab.frameworks.google.IabHelper$2.run(IabHelper.java:622)
at java.lang.Thread.run(Thread.java:841)