Help With In-App Purchases

Guys i’m having some troubles with in-app purchases! 

I’m followed all the steps, made an unique ID for my app, made all the things in my app but when it tries to connect to itunes to complete the purchase it returns an error: Error -> type: Unknown Cannot connect to itunes store…

I can’t really figure how to resolve this … 

can anyone help???

Thank you guys 

Hi there,

Have you set up a test account in iTunes Connect?  I think the error you mentioned is the error you get if you attempt to do an in-app purchase in a development build using your regular iTunes account.  Instead, you have to create a test account in iTunes Connect, and then log out of your regular account on your device and log into the test account instead.

  • Andrew

Hey, @edulucats0, there are different reasons why you get “cannot connect to itunes store” message.   Not sure if it could help but you might want to take a look at this thread:

http://forums.coronalabs.com/topic/20969-cannot-connect-to-itunes-store-help/

Good luck.

Naomi

Hi Naomi, thanks for the help! I’ll probably reset my device so it can connect to Itunes! But I have a doubt about the indentifier of my product. 

For exemple the id for my app is “com.44toons.Nilba” and my reference name for the in app purchase is “Cash Pack” and the product ID is Cash_pack, so when I’m loading the products from the store I have to use the string “com.44toons.Nilba.Cash Pack” or “com.44toons.Nilba.Cash_pack” ??

I’m a little confused about this! 

Thanks for the help!! 

Lucats

OK … I just reseted my iPod, and it stil shows the same error! I’m not signed in any account and when I try to buy something from the store it returns me the same error: Error -> type: Unknown Cannot connect to itunes store…

It does not  even asks to log into itunes … it returns an error even before asking me to login … 

I’m really lost here, don’t know how to work around this issue! 

Creating an add hoc profile my help ??

Thanks in advance

Hi there,

On your first question, my understanding is that the product ID you should use in store.purchase() should exactly match what you entered in iTunes Connect as the product ID, regardless of your app’s bundle ID.  In iTunes Connect you gave your product a product ID of “Cash_pack”, so that’s what you need to use when calling store.purchase().  (A good practice is to name your products like this – com.domainname.appname.product – but that’s not actually required.)

It shouldn’t be necessary to create an ad hoc provisioning profile.  I use a development profile just fine.  Have you been using a development provisioning profile (which you would have created in the iOS Provisioning Portal)?  Also, when you set up your app in the iOS Provisioning Portal, did you enable in-app purchases?

  • Andrew

Hi Andrew! 

Thank you for your answer! I will use the product Id to call the store (as I have been using before, so I think this is not the error)

I have a development profile that I have been using for a while now … i think my app is set to have in-app purchases, at last my app ID allows that, don’t know if I have to make additional configurations!

Another doubt: I have to upload the binary for my game to test my in- app purchases? I read in some topic that I had to upload the binary and refuse it so I can test … there’s really something like that? 

Hi there,

No, it’s not necessary to upload a binary and refuse it to test in-app purchases.  You can just create a development build, install it on your device, and test it directly.

  • Andrew

Ok, so I’m stuck … I really don’t know what could be the error! 

My iPad has to be unlogged right? And i Log into my test account when it asks right? 

Mine don’t show the log in window … it gaves an error even before that! 

I think I will make the entire process again, delete the app from Itunes Connect and create everything from scratch, starting with app id … I really don’t now the error :(  I reseted the ipad and still it doesn’t work! 

When the store is called … my iPad show this error on the console: " <Error>: WiFi:[386602151.407857]: Client itunesstored is background application", any tips about that??

Thank you very much for your attention! 

Resolved it … thanks to everyone… I resolved it using store.purchase(“Cash_pack”) instead of store.purchase(“com.44toons.Nilba.Cash_pack”)!

Now it’s working like a charm! 

Thank you for all the assistance! 

Hi there,

Have you set up a test account in iTunes Connect?  I think the error you mentioned is the error you get if you attempt to do an in-app purchase in a development build using your regular iTunes account.  Instead, you have to create a test account in iTunes Connect, and then log out of your regular account on your device and log into the test account instead.

  • Andrew

Hey, @edulucats0, there are different reasons why you get “cannot connect to itunes store” message.   Not sure if it could help but you might want to take a look at this thread:

http://forums.coronalabs.com/topic/20969-cannot-connect-to-itunes-store-help/

Good luck.

Naomi

Hi Naomi, thanks for the help! I’ll probably reset my device so it can connect to Itunes! But I have a doubt about the indentifier of my product. 

For exemple the id for my app is “com.44toons.Nilba” and my reference name for the in app purchase is “Cash Pack” and the product ID is Cash_pack, so when I’m loading the products from the store I have to use the string “com.44toons.Nilba.Cash Pack” or “com.44toons.Nilba.Cash_pack” ??

I’m a little confused about this! 

Thanks for the help!! 

Lucats

OK … I just reseted my iPod, and it stil shows the same error! I’m not signed in any account and when I try to buy something from the store it returns me the same error: Error -> type: Unknown Cannot connect to itunes store…

It does not  even asks to log into itunes … it returns an error even before asking me to login … 

I’m really lost here, don’t know how to work around this issue! 

Creating an add hoc profile my help ??

Thanks in advance

Hi there,

On your first question, my understanding is that the product ID you should use in store.purchase() should exactly match what you entered in iTunes Connect as the product ID, regardless of your app’s bundle ID.  In iTunes Connect you gave your product a product ID of “Cash_pack”, so that’s what you need to use when calling store.purchase().  (A good practice is to name your products like this – com.domainname.appname.product – but that’s not actually required.)

It shouldn’t be necessary to create an ad hoc provisioning profile.  I use a development profile just fine.  Have you been using a development provisioning profile (which you would have created in the iOS Provisioning Portal)?  Also, when you set up your app in the iOS Provisioning Portal, did you enable in-app purchases?

  • Andrew

Hi Andrew! 

Thank you for your answer! I will use the product Id to call the store (as I have been using before, so I think this is not the error)

I have a development profile that I have been using for a while now … i think my app is set to have in-app purchases, at last my app ID allows that, don’t know if I have to make additional configurations!

Another doubt: I have to upload the binary for my game to test my in- app purchases? I read in some topic that I had to upload the binary and refuse it so I can test … there’s really something like that? 

Hi there,

No, it’s not necessary to upload a binary and refuse it to test in-app purchases.  You can just create a development build, install it on your device, and test it directly.

  • Andrew

Ok, so I’m stuck … I really don’t know what could be the error! 

My iPad has to be unlogged right? And i Log into my test account when it asks right? 

Mine don’t show the log in window … it gaves an error even before that! 

I think I will make the entire process again, delete the app from Itunes Connect and create everything from scratch, starting with app id … I really don’t now the error :(  I reseted the ipad and still it doesn’t work! 

When the store is called … my iPad show this error on the console: " <Error>: WiFi:[386602151.407857]: Client itunesstored is background application", any tips about that??

Thank you very much for your attention! 

Resolved it … thanks to everyone… I resolved it using store.purchase(“Cash_pack”) instead of store.purchase(“com.44toons.Nilba.Cash_pack”)!

Now it’s working like a charm! 

Thank you for all the assistance!