Hello,
I have developed an app for iOS. When I submit it to the App Review for the store they reject it because of this unrespected guideline.
Guideline 3.1.1 - Business - Payments - In-App Purchase
We found that your app offers in-app
purchases that can be restored but
does not include a “Restore Purchases”
feature to allow users to restore the
previously purchased in-app purchases,
as specified in the “Restoring
Purchase Products” section of the
In-App Purchase Programming Guide:“Users restore transactions to maintain access to content they’ve
already purchased. For example, when
they upgrade to a new phone, they
don’t lose all of the items they
purchased on the old phone. Include
some mechanism in your app to let the
user restore their purchases, such as
a Restore Purchases button.”To restore previously purchased in-app purchase products, it would be
appropriate to provide a “Restore”
button and initiate the restore
process when the “Restore” button is
tapped by the user.
Now, I have no idea what I should do. This is the code in my app that does something about restoration. In my IStoreListener.
// Restore purchases previously made by this customer. Some platforms automatically restore purchases, like Google.
// Apple currently requires explicit purchase restoration for IAP, conditionally displaying a password prompt.
public void RestorePurchases() {
// If Purchasing has not yet been set up ...
if (!IsInitialized())
{
// ... report the situation and stop restoring. Consider either waiting longer, or retrying initialization.
Debug.Log("RestorePurchases FAIL. Not initialized.");
return;
}
// If we are running on an Apple device ...
if (Application.platform == RuntimePlatform.IPhonePlayer ||
Application.platform == RuntimePlatform.OSXPlayer)
{
// ... begin restoring purchases
Debug.Log("RestorePurchases started ...");
// Fetch the Apple store-specific subsystem.
var apple = m_StoreExtensionProvider.GetExtension<IAppleExtensions>();
// Begin the asynchronous process of restoring purchases. Expect a confirmation response in
// the Action<bool> below, and ProcessPurchase if there are previously purchased products to restore.
apple.RestoreTransactions((result) => {
// The first phase of restoration. If no more responses are received on ProcessPurchase then
// no purchases are available to be restored.
Debug.Log("RestorePurchases continuing: " + result + ". If no further messages, no purchases available to restore.");
});
}
// Otherwise ...
else
{
// We are not running on an Apple device. No work is necessary to restore purchases.
Debug.Log("RestorePurchases FAIL. Not supported on this platform. Current = " + Application.platform);
}
}
// THIS IS ON OnInitialized.
#if UNITY_IOS
extensions.GetExtension<IAppleExtensions> ().RestoreTransactions (result => {
if (result) {
// This does not mean anything was restored,
// merely that the restoration process succeeded.
Debug.Log ("Products restoration succeeded.");
} else {
// Restoration failed.
Debug.Log ("Products restoration failed.");
}
});
#endif