Maduranga E
Maduranga E

Reputation: 1689

How to make IAP available on all devices?

My app provides an in-app purchase to get some news alerts as push notifications. Push notifications should be delivered to all devices associated with the same Apple ID that is used to purchase.

Currently I thought of putting a button on the "settings" screen to restore in-app purchases to check if the feature is purchased in another device.

Is there any better way to handle this task? If so, any tips/suggestions would be highly appreciated!

Upvotes: 0

Views: 89

Answers (3)

Chris Prince
Chris Prince

Reputation: 7584

Or in iOS7, use SKReceiptRefreshRequest.

self.refreshRequest = [[SKReceiptRefreshRequest alloc] init];
self.refreshRequest.delegate = self;
[self.refreshRequest start];

Also note that this straightforward restore procedure doesn't necessarily work for all types of products. E.g., at least on iOS6, restoreCompletedTransactions will not restore non-renewable subscriptions. But the situation seems more complicated in iOS7 (see Non-renewing Subscriptions: Removed From Receipt?).

Upvotes: 0

Jojodmo
Jojodmo

Reputation: 23616

You should use the restore purchase feature:

[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];

It will restore all purchases that the user has made on that account, weather on the same ios device, or a different one.

Also, as a side note, if you implement In-app purchases without including the restore feature, your ios app will not be accepted by Apple

Upvotes: 0

David Berry
David Berry

Reputation: 41236

The restore purchases option is the correct choice, and probably ought to be there in case the user deletes and reinstalls the application.

Upvotes: 1

Related Questions