I use ** Sample IAP Project , but when i restore pursce it alway restore success.**
I use none purchase histort sandbox account and test in xcode.
it also happen when i in unity editor and tap restore button it alway return “restore_success”.
Why??
m_StoreExtensionProvider.GetExtension<IAppleExtensions>().RestoreTransactions(result =>
{
if (result)
{
MyDebug("Restore purchases succeeded.");
Dictionary<string, object> parameters = new Dictionary<string, object>()
{
{ "restore_success", true },
};
AnalyticsService.Instance.CustomData("myRestore", parameters);
payCompletefunction();
}
else
{
MyDebug("Restore purchases failed.");
Dictionary<string, object> parameters = new Dictionary<string, object>()
{
{ "restore_success", false },
};
AnalyticsService.Instance.CustomData("myRestore", parameters);
}
AnalyticsService.Instance.Flush();
});
"
2022-12-17 19:06:14.222211+0800 UnityIAP: No App Receipt found
OnInitialized: PASS
MyIAPManager:OnInitialized(IStoreController, IExtensionProvider)
UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()
UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)
UnityEngine.Purchasing.AppleStoreImpl:OnProductsRetrieved(String)
UnityEngine.Purchasing.Extension.UnityUtil:Update()
2022-12-17 19:06:14.UnityIAP: Add transaction observer
2022-12-17 19:06:14. UnityIAP UnityEarlyTransactionObserver: Request to initiate queued payments
2022-12-17 19:06:20.990517+0800 3d[28032:9665595] UnityIAP: Restore transactions
2022-12-17 19:06:20.991009+0800 3d[28032:9665595] UnityIAP: RestorePurchase
2022-12-17 19:06:22.618955+0800 3d[28032:9665595] UnityIAP: PaymentQueueRestoreCompletedTransactionsFinished
Restore purchases succeeded.
"
update.
ok,i find the problem ,
MyDebug(“Restore purchases succeeded.”); is the the restoration process succeeded.
- if (result)
- {
- MyDebug(“Restore purchases succeeded.”);
- Dictionary<string, object> parameters = new Dictionary<string, object>()
- {
- { “restore_success”, true },
- };
- AnalyticsService.Instance.CustomData(“myRestore”, parameters);
- }