Hi, thanks for useful tutorial!
It works great for me on a device with iOS 5.0 and in the simulators 5.0 and 5.1.
But on a device with 5.1 I can't receive the information about products.
Although a count of products shows the right value.
As result no one of products loads.
Have anybody had a similar problem? Any thoughts? Are there changes with in-app in iOS 5.1?
Upd: I found odd thing. "response.products" returns null in 5.1
Can you please help with it?
Introduction to In-App Purchases
Re: iOS 5.1
grivina wrote:Hi, thanks for useful tutorial!
It works great for me on a device with iOS 5.0 and in the simulators 5.0 and 5.1.
But on a device with 5.1 I can't receive the information about products.
Although a count of products shows the right value.
As result no one of products loads.
Have anybody had a similar problem? Any thoughts? Are there changes with in-app in iOS 5.1?
Upd: I found odd thing. "response.products" returns null in 5.1
Can you please help with it?
It's working fine for me on 5.1
- ddaddy
- Baby Hacker
- Posts: 5
- Joined: Sun Mar 11, 2012 7:54 pm
- Has thanked: 0 time
- Been thanked: 0 time
Re: Introduction to In-App Purchases
However... I am having a problem with the buyProductIdentifier code
[SKPayment paymentWithProductIdentifier:
has been replaced with
[SKPayment paymentWithProduct:
How do I pass it the product when we have the productIdentifier?
Thanks
EDIT: I think i've got it. On the buy button press, just send the product and not product.productIdentifier
Teach me to complete the whole thing next time!
[SKPayment paymentWithProductIdentifier:
has been replaced with
[SKPayment paymentWithProduct:
How do I pass it the product when we have the productIdentifier?
Thanks
EDIT: I think i've got it. On the buy button press, just send the product and not product.productIdentifier
Teach me to complete the whole thing next time!
- ddaddy
- Baby Hacker
- Posts: 5
- Joined: Sun Mar 11, 2012 7:54 pm
- Has thanked: 0 time
- Been thanked: 0 time
Re: Introduction to In-App Purchases
Thanks a Lot Ray.. have finished and published my first iPhone App ..Very Proud of it though it has a few bugs 
- deepalip5
- n00b
- Posts: 1
- Joined: Thu Mar 22, 2012 12:31 pm
- Has thanked: 0 time
- Been thanked: 0 time
Re: Introduction to In-App Purchases
When I run the sample project, the fields are all blank. Has anyone figured out a fix to this yet?
- Oral B
- n00b
- Posts: 1
- Joined: Sun Mar 25, 2012 1:46 am
- Has thanked: 0 time
- Been thanked: 0 time
Re: Introduction to In-App Purchases
Nice to know that you don't have to upload a binary in order to test, but is there an updated version of:
SKPayment *payment = [SKPayment paymentWithProductIdentifier:productIdentifier];
It complains that it's deprecated and when I try to replace it with "paymentWithProduct:" I don't know what follows the ":" so get a types mismatch error.
Also, any suggestions for how to implement using a Cocos2d page instead of an interface builder view (.xib) would be much appreciated!
SKPayment *payment = [SKPayment paymentWithProductIdentifier:productIdentifier];
It complains that it's deprecated and when I try to replace it with "paymentWithProduct:" I don't know what follows the ":" so get a types mismatch error.
Also, any suggestions for how to implement using a Cocos2d page instead of an interface builder view (.xib) would be much appreciated!
-

mijator - Hacker
- Posts: 15
- Joined: Sun Dec 18, 2011 5:42 pm
- Location: Canada
- Has thanked: 3 times
- Been thanked: 0 time
Re: Introduction to In-App Purchases
mijator wrote:when I try to replace it with "paymentWithProduct:" I don't know what follows the ":" so get a types mismatch error.
It says "paymentWithProduct:", so you can either look up the name of this method in the documentation for SKPayment, or even guess at it.
You'll have to put an SKProduct object after the :, and you can get an SKProduct from the SKProductsResponse object that you got after you checked the product identifiers with the App Store.
-

Hollance - iOS Tutorial Team Member
- Posts: 3301
- Joined: Wed Mar 09, 2011 8:33 pm
- Location: The Netherlands
- Has thanked: 0 time
- Been thanked: 255 times
Re: Introduction to In-App Purchases
Thanks Ray for a wonderful tutorial.
Although I have one question, on successfully purchasing a product I see that we are storing the product id in NSUserDefaults. Now what if after purchasing a product user has to delete the app and reinstall, in that case the NSUserDefaults will be cleared and we will lose all in-app purchase info of the user.
So I was wondering is there any way we can fetch the user in app purchase info from App store. We can then fetch the info every time the app launches. Or we'll have to do it on our server maintaining the in app purchases status for each user.
Thanks
Although I have one question, on successfully purchasing a product I see that we are storing the product id in NSUserDefaults. Now what if after purchasing a product user has to delete the app and reinstall, in that case the NSUserDefaults will be cleared and we will lose all in-app purchase info of the user.
So I was wondering is there any way we can fetch the user in app purchase info from App store. We can then fetch the info every time the app launches. Or we'll have to do it on our server maintaining the in app purchases status for each user.
Thanks
- itsme.manish
- n00b
- Posts: 3
- Joined: Tue Apr 03, 2012 6:16 am
- Has thanked: 0 time
- Been thanked: 0 time
Re: Introduction to In-App Purchases
itsme.manish wrote:So I was wondering is there any way we can fetch the user in app purchase info from App store. We can then fetch the info every time the app launches. Or we'll have to do it on our server maintaining the in app purchases status for each user.
You can ask the App Store server to restore the user's previous purchases. This will then send your app the proper notifications, just as if the purchase was made the first time.
However, you shouldn't do that every time the app starts. Instead, make a Restore Purchases button that does this when the user taps it.
You can also store information about the user's purchases on iCloud.
-

Hollance - iOS Tutorial Team Member
- Posts: 3301
- Joined: Wed Mar 09, 2011 8:33 pm
- Location: The Netherlands
- Has thanked: 0 time
- Been thanked: 255 times
Re: Introduction to In-App Purchases
Thanks Hollance for your reply.
I am now stuck at something I have seen many other user's are also stuck at. I tried implementing in app purchases in my app, set up everything as mentioned in the tutorial, but SKProductsRequest returns empty product list. I have checked that my productIDs have correct prefix as my bundle identifier.
I also tried running the sample code, it also returns me an empty list.
Any idea what could be the issue here?
I am now stuck at something I have seen many other user's are also stuck at. I tried implementing in app purchases in my app, set up everything as mentioned in the tutorial, but SKProductsRequest returns empty product list. I have checked that my productIDs have correct prefix as my bundle identifier.
I also tried running the sample code, it also returns me an empty list.
Any idea what could be the issue here?
- itsme.manish
- n00b
- Posts: 3
- Joined: Tue Apr 03, 2012 6:16 am
- Has thanked: 0 time
- Been thanked: 0 time
Who is online
Users browsing this forum: ichiro [Crawler] and 2 guests