In-App Purchase Setup. Please Help!

26 replies [Last post]
@RSCdev
User offline. Last seen 1 year 40 weeks ago. Offline
Joined: 6 Sep 2011

Hey guys,

I`m in the proccess of updating my app that is already live on the appstore. So am now, for the very first time, going to setup an in-app purchase for this app and will be delivering/submitting it already together the version updated of this same app for the store, got it?

OK, until this moment what I`ve done was:

1) Setup an in-app purchase for the app that is live at iTunnes connect (under Manage your in-app purchase)

2) I`m setting up right now a new user at iTC for the testing purposes required by the IAP proccess.

3) Looking at this IAP setup, still into my itunnes connect account, I can see one link that says:View or generate a shared secret -- what`s that? Do I need to check that out for some reason?

4) I`ve setup and saved my IAP, for non-consumable item, set the price tier as well, BUT I did not upload any SCREENSHOT of this IAP as they ask, SO after all, the status of my in-app purchase setup is:Waiting for Screenshot together a small red ball. Do I need to send it by obligation to get it working? What would be this screenshot as my IAP regards only a new feature of my app where the user will be able to "save" his code or whatever into the app and its value is 99c only.

So, after all I know I need to CODE it all yet in Corona, but getting some nice advice now about this setup with Apple first would help me along the way surely.

Thanks,
Rodrigo.

Replies

Sven.Lua
User offline. Last seen 2 weeks 6 days ago. Offline
Joined: 17 Jun 2011

Yes - create the shared secret

Send any screenshot of your app - later replace it with a screenshot of the IAP

...good luck with all the IAP hurdles ;)

@RSCdev
User offline. Last seen 1 year 40 weeks ago. Offline
Joined: 6 Sep 2011

@Sven.Lua - Mate, THANKS for that shot! :)

So I`ll keep walking...

Btw, do you know where am going to use that thing?

Cheers,
Rodrigo.

@RSCdev
User offline. Last seen 1 year 40 weeks ago. Offline
Joined: 6 Sep 2011

What do I do now that I`ve created the shared secret, uploaded an "test" screenshot and also created the test user in iTC.

The status of my IAP at iTC right now is "waiting for sumbmission". What does that mean? :\ Can I start to code the app to test it?

Am feeling lost.

Thanks guys,
Rodrigo.

Naomi
User offline. Last seen 15 hours 57 min ago. Offline
Joined: 6 Jun 2011

Hey, Rodrigo, my IAP doesn't include subscriptions, so I don't know what's the best approach you can take. That said, you might want to read through some of the following (they helped a lot when I worked on IAP):

http://developer.anscamobile.com/reference/in-app-purchases

http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/

You might also want to check out the InAppPurchase sample code that comes with SDK:

SampleCode > Networking > InAppPurchase

Good luck!

Naomi

@RSCdev
User offline. Last seen 1 year 40 weeks ago. Offline
Joined: 6 Sep 2011

@Naomi, you`re awesome as usual! Thanks! :)

By the way I`ll follow those threads you`ve passed above BUT just to not misunderstand you, my IAP isn`t about subscriptions. It`s all about only one new feature that will be available in the app when someone buy it, got it? (and I`ve registered as a "non-consumable" item as well)

PS: If you are speaking about "subscriptions IAP" because of that "shared secret" as we told above, HONESTLY I do not know anything about that and also I just clicked that because @Sven said to do that to get it all working for testing purposes as well.

By all of this you can see HOW MUCH am lost at this. :(

Thanks anyway,
Rodrigo.

EDIT:When I checked those links I realized that I`ve followed exactly all those steps as described there at the 2nd link by @Troy and so am stoped at the final of that. As I have the test user created and the IAP at iTunnes is just saying "Ready for submission" together a small yellow ball. :\

I am posting a small screenshot of the IAP status at iTC right now:

Naomi
User offline. Last seen 15 hours 57 min ago. Offline
Joined: 6 Jun 2011

Hey, Rodrigo, yup. I have not set up shared secret, and I had to google it to find out what it was. If you are doing non-consumable item (and it has nothing to do with subscription), you don't need it. I think you should start coding and see how things go. You might want to look at this code posted by d3mac123:

https://developer.anscamobile.com/forum/2011/10/13/app-purchases-help-needed#comment-60894

d3mac123's code along with Corona's sample code helped me sort out the IAP. When in doubt, make sure to use lots print statements and check to see how far your code executes.

Good luck!

Naomi

Edit: By the way, "ready to submit" should be fine when testing against the iTC's sandbox.

@RSCdev
User offline. Last seen 1 year 40 weeks ago. Offline
Joined: 6 Sep 2011

@WOW Naomi! What a great help! :)

Thank you so much for taking your time trying to help me - at least I do not feel so AlonE! :P

By the way was exactly it that I was hoping to listen - to try it out via coding already. So I`ll code it by now and see if after building the app I become able to see it working (hope so) or CAN I TEST IT using only the corona simulator? :\

PS: One more question in my mind is that: as this app am preparing the IAP is already live at appstore, so I`ve built it using the Distribution Certificate as its a must when ready to submit for appstore BUT now is my question: which profile would I use to build the app regarding the IAP testing? :\

PS2: About the "shared secret" I`ve setup that one as I`ve said above, but I do not think I`ll need to use that anywhere, at least concerning the non-consumable IAP am preparing right now, so thanks for Googling about it @Naomi.

One more time,
My sincere thanks,
Rodrigo.

Naomi
User offline. Last seen 15 hours 57 min ago. Offline
Joined: 6 Jun 2011

Hey, Rodrigo, you can't test IAP using simulator. You need to generate an AdHoc build (but in your case, who knows, distribution certificate may work -- but I'd start with AdHoc version just to make sure), install it on a device, and use the test user to test it. Make sure to sign out of App Store before you launch your game on device to test it. (By the way, jail broken device can't be used to test IAP.)

Good luck & good night.

Naomi

@RSCdev
User offline. Last seen 1 year 40 weeks ago. Offline
Joined: 6 Sep 2011

@Naomi, OK, I got it! So I have to test on device, that`s ok.

About the Ad-hoc build, honestly I have no idea about that as also how to make one, as in my case I`ve always used the "Team Provisioning Profile" for everything else, only not the buid for AppStore. So would you know if I would test using the Team profile or I really HAVE TO MAKE an Ad-Hoc one? :\

PS: Regarding the Distribution profile/certificate I think that we cannot use that to "install" our app in our iDevices, only for AppStore, but I would be wrong.

Hey Naomi, thanks for the helpfull "chat" here. :)

Cheers,
Rodrigo.

peach pellen
User offline. Last seen 1 year 44 weeks ago. Offline
Alumni
Joined: 12 Apr 2011

Rodrigo this post I made previously shows how to use a Distribution provisioning profile to build for your device; http://developer.anscamobile.com/forum/2012/01/10/ios-walkthrough-testing-device-0

You can install on your device using distribution if you have selected "Ad Hoc" rather than "App Store" when creating the profile.

I hope this helps, glad to see you moving along with Naomi's wonderful assistance :)

@RSCdev
User offline. Last seen 1 year 40 weeks ago. Offline
Joined: 6 Sep 2011

Haha @Peach, you`re right, @Naomi is a master one about IAP and you`re awesome too! :)

So thanks for the link BUT look, as I said this app is LIVE already and so it was built using the Distribution Profile/Certificate for STORE and not Ad Hoc because that time I was really building for release it for the jungle, SO would I test the IAP using the Team one? (I think I`ll try it out and report here for you gals). :(

Time to start to write some code and so TRY to build it using the Team provisioning profile (for testing) and if I do not get it, I`ll report here and ask some hand again. ;)

I`m very glad for all the nice help and info shared here. Thank you!

Rodrigo.

peach pellen
User offline. Last seen 1 year 44 weeks ago. Offline
Alumni
Joined: 12 Apr 2011

I am not 100% certain (Naomi would know better than me) but perhaps the development one will work for testing; there is certainly no harm in trying and I'd like to hear results :)

Naomi
User offline. Last seen 15 hours 57 min ago. Offline
Joined: 6 Jun 2011

Good morning, Rodrigo & Peach. About dev certificate, I could not get it to work. I always used AdHoc to test my game on device, but for some bizarre misunderstanding on my part, I tried using dev certificate to test IAP, and I've gotten error messages every single time, and good grief, the attempt to use dev certificate set me back a couple of weeks when working on IAP. It drove me near insane. As for the AdHoc certificate, I don't think it's all that hard to create (and I don't think it would mess up your distribution certificate that you already have for your store release.)

As Peach mentioned, go to Apple dev center, sign in, go to Provisioning Portal, click on Provisioning, select Distribution, click on New Profile, choose AdHoc (not App Store), create profile name (such as MyGame AdHoc - so that you know this is AdHoc certificate of your specific app), select an App ID of the app you've already released, and select devices you want to install the AdHoc version of your app. The rest works the same as installing App Store version of the distribution certificate.

Naomi

aaaron
User offline. Last seen 27 weeks 5 days ago. Offline
Joined: 30 Jan 2011

Hey Rodrigo I just uploaded my game with IAP last night. I did the same as you, I had an app on the store already and added IAP to an existing app. Also wanna thank you Naomi, I read your posts in the other threads and it helped me. I heard so many horror stories but I did exactly what you did Rodrigo and did some research first and hey my IAP test worked on the first try!

Whenever I built to test I just used the same provisioning profile that I used to test before I had IAP. My iPhone is jailbroken so I can confirm that it doesn't work on there, but I already read that going in so I just wanted to test that theory. IAP worked fine on my iPad which isn't jailbroken.

When I uploaded my binary I kept it in "waiting for review" status to test. I read that if you do a developer rejected status you won't be able to test.

Finally as Naomi said, go into your device settings and click on Store, then sign out. When you do your test you need to sign in using your test user.

My update is still waiting to be approved so I can't comment any further. Good luck!

Naomi
User offline. Last seen 15 hours 57 min ago. Offline
Joined: 6 Jun 2011

@aaaron, great to hear things went very smoothly for you. Also good to know that team provisioning profile works with IAP testing (if that's what you meant). And really nice to know that we can test IAP with the binary in "waiting for review" status.

Cheers,
Naomi

@RSCdev
User offline. Last seen 1 year 40 weeks ago. Offline
Joined: 6 Sep 2011

@Peach, @Naomi and @Aaaron - Guys/gals you`re ROCK! :)

I am really glad of receiving all this amazing HELP from you all. ;)

So, after read all the wonderful info shared by you above, I`ll so test it using the Team Provisioning Profile, because, just to note here, as @Aaaron have said, I always have used that kind of profile too for everything else, so I gonna try that out.

But @Aaaron said something that I really did not get yet:
When I uploaded my binary I kept it in "waiting for review" status to test. I read that if you do a developer rejected status you won't be able to test.

So, what do you mean about "binary" Aaaron? Because as you know by now, my app is LIVE already and so the "binnary" (if am not misunderstanding you) is already online, no?! :S

Also, if you mean "upload binary" as being the part you send your updated app (with IAP already setup) for Apple to review it then I understand. Because the unique thing I can see into my Manage in App purchase is the "Ready to submmit" as I`ve posted above on the screenshot :\

Haha, am feeling lost again.. :(

Ahhh, and to be worse, I was thinking about it all, and I just thought:
"OK, after the user buy the IAP and get the new feature UNLOCKED into the app, WHAT would happen when he leave the app (close or whatever) and after start the app again? By now I think that he would get the app feature "LOCKED" again, no? SO, how do I do to let the app with the "feature unlocked" forever after the user buy it and close/start the app? WOW,my brain is smoking!

Thanks A LOT!
Rodrigo.

Naomi
User offline. Last seen 15 hours 57 min ago. Offline
Joined: 6 Jun 2011

Hey, Rodrigo, I haven't done IAP testing on an app that's already live, so someone else will need to help you out with how to handle binary and the testing process. FYI, however, I've been able to test the IAP with "developer rejected" status.

About the UNLOCKED vs LOCKED status after your user make the purchase, you'll need to look into how to save the purchased status. @d3mac123 code that I linked to above shows where you may want to include the function savePurchase(product) -- and inside the function you'd need to write up a code that would let your app know that the user has unlocked your app. By the way, the parameter "product" used for the function is an index (i.e., the number). If you have only one product, you probably don't need the parameter (so, you'd write up a function savePaurchase() instead). If you have more than 1 product for sale, the number would correspond to the row where your product appears on iTC.

Good luck!

Naomi

@RSCdev
User offline. Last seen 1 year 40 weeks ago. Offline
Joined: 6 Sep 2011

@Naomi, I wish all the best for you! Thanks a TON for being so "cristal clear"! Haha :)

So, YES, I`ll have to write some code to "keep" the status of the IAP transaction and check this flag always when the user starts up the app, right? OK, one more thing to learn..WOW.

After all, it`s good to know you`re able to test it even having the status of "developed rejected" BUT my problem is, WHERE do I need to upload something (.app) and also isn`t possible to test it just making a normal build here with corona, installing it on my phone and after trying to buy to see if it works? Why do I need to send it for Apple? :\

Sorry guys, am tired of be feeling I get nowhere, bah. :(

PS: It`s not about you all, looks like it`s me being very ignorant or blind at least.

Regards,
Rodrigo.

Naomi
User offline. Last seen 15 hours 57 min ago. Offline
Joined: 6 Jun 2011

Hey, Rodrigo, I know how frustrating this process can get. Believe me, I went near insane.

I think the binary needs to be there for testing against iTC sandbox. That said, since you already have your app live, you may be able to skip this uploading and rejecting part. If I were you, I'd try building the app using AdHoc certificate, install it on my device, and see if I can test IAP against the iTC sandbox. And if it doesn't work, then I'd consider looking into what additional steps need to be taken for adding IAP to live app.

Anyhow, this thorough walk-through talks about adding binary and how to reject it (scroll down to section #5) -- but, again, since you already have a live app, you may not need to go through this process (I'm just guessing though):

http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/

Good luck!

Naomi

@RSCdev
User offline. Last seen 1 year 40 weeks ago. Offline
Joined: 6 Sep 2011

@Naomi, what a wonderful person you are, OMG! :)

So, YES, I totally agree with you about the "binary upload" as my app is already live.

I was few minutes ago, implementing/coding the FEATURE that will be available when the user PURCHASE it via the IAP to unlock it.

By the way, by now, looks like I got it! At least the FEATURE that will be available to IAP is working already. Phew...

Now I have to look into the IAP code and setup it using my own IAP ID (as by now I only have one product) and after that TEST it as we`ve agreed above by your last post and after that, SURELY I will report you here and probably ask some light again. :\

PS: After all I have yet to see how to code something to be able to know when the user buy the IAP and so UNLOCK the content for him and also record something somewhere in the app sandbox to read it when launch the app and if, for example, the value of it is 1 so load the LOCKED content elseif it`s 0 then keep loading the UNLOCKED content...WOW!

Anyway, am going ahead and honestly, after 6 hours continuosly here coding only the feature for the IAP I can say that I`ve learned so many things that I would not even know without all "these IAP problems"...hahaha

Thanks a TON!
Rodrigo.

Naomi
User offline. Last seen 15 hours 57 min ago. Offline
Joined: 6 Jun 2011

Hey, Rodrigo, glad to hear things are coming along nicely. Just a quick note about IAP. Apple side will only let your app know whether or not the user paid for your product. If you need to deliver some additional content upon purchase, you'll have to deliver it to your user. In my case, my game already have the unlocked content in it, so all my game needs to know is whether or not the user paid, and my game handles the rest.

Best of luck!

Naomi

@RSCdev
User offline. Last seen 1 year 40 weeks ago. Offline
Joined: 6 Sep 2011

@Naomi,

Thanks for the Apple`s Note about the transaction handling, I`ve read about that too.

Please, explain better about it (your own IAP) because it looks like we have "the same" kind of IAP (regarding how it works) and if so, your invaluable help would become even better for me!:)

Look, you said that your IAP feature comes into your game when delivered already UNLOCKED right? So, I presume that if you do it like that (and also it is how am doing it right now in my project too) and said also that you only "check" to see if the user really bought it or not and so you take determined action, and of course one of then is letting the user use the purchased content/feature of your app, right? So, my case looks like identical of yours, because my feature/content (that is just one more "screen", .lua file, lets call it screen3.lua) goes also into the app already UNLOCKED, BUT what am trying to do right now is one another "screen"/.lua file, lets say: screen2.lua, that would be the screen showing the user that he can buy something there, the IAP button itself and after that, if him BUY, I would let so he uses the screen3.lua (that is the featured screen) and "hide" the called screen2.lua (because the user have bought already the IAP for being able to use the featured "screen3.lua"! OMG, sorry for all of this, but I really hope you "understand" what am trying to say you. If not, please, shout out on me! :)

Thank you as usual Naomi!

Cheers,
Rodrigo.

Naomi
User offline. Last seen 15 hours 57 min ago. Offline
Joined: 6 Jun 2011

Hey, Rodrigo, I have 5 consumable items along with one non-consumable item (the non-consumable item being unlocking the premium level pack.) In my case, I started off with single, non-consumable item, but then later on, I added consumable items to my game (that come in the form of Powerups.)

When someone purchases any of the IAP items, I do launch a savePurchase function with a parameter. The parameter tells the function to handle the purchase differently.

In your case, since you have only one item for sale, I don't think you need to worry about including the parameter. As soon as the IAP transaction.state returns "purchased", you may just want your savePurchase function to set your flag to unlocked state. You may also want to save the state of your flag in persistent variable that can be retrieved after your app is closed and then launched again. So long as the flag shows the user has paid and unlocked, your app should allow access to the unlocked area.

I hope this helps.

Naomi

@RSCdev
User offline. Last seen 1 year 40 weeks ago. Offline
Joined: 6 Sep 2011

@Naomi,

Exactly what I thought!

I`ll only have to learn how to code it at all. :S

Am going ahead btw. Without it I think am unable to test the IAP, even only for really testing purposes. :\

PS: Will keep you informed about how it goes btw.

Thank so much,
Rodrigo.

Naomi
User offline. Last seen 15 hours 57 min ago. Offline
Joined: 6 Jun 2011

You're welcome, Rodrigo. Hope it will work out smoothly for you moving forward.

Cheers,
Naomi

paypal
User offline. Last seen 1 year 2 weeks ago. Offline
Joined: 9 Oct 2011

Hi everyone.

I want to implement In App Purchases on my app. I have a first screen with four levels, and I want to lock 3 of them and the users can buy them or buy a pack with all.

I make a new screen which contains all the purchase information I mean, the image of the second, third, four and the 3 package levels, and I want if the user click buy in each one, the respective level is unlocked.

but it returns #event.products as 0... so does that mean no products have been approved?

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.