You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Note: Example 1 is typically used to handle the user interface after a successful or failed purchase and cannot handle restore purchase. Therefore, you should use example 2 to handle logic for tasks such as removing ads, unlocking skins,...
168
+
169
+
- Check to see if the product has been purchased (only applies to Non-Consumable items)
170
+
```csharp
171
+
172
+
publicButtonbuttonRemoveAds;
173
+
174
+
privatevoidOnEnable()
175
+
{
176
+
if (IapProduct.IsPurchasedRemoveads())
177
+
{
178
+
buttonRemoveAds.gameObject.SetActive(false);
179
+
}
180
+
}
181
+
182
+
```
183
+
### Restore purchase
184
+
Restore purchase only applies to Non-Consumable items
185
+
186
+
Restore Purchase is a mandatory feature on iOS to be able to be released to the store.
187
+
188
+
On Android when you successfully purchased RemoveAds. Then you uninstall your game and reinstall it. If you click buy remove ads again, google play system will report that you already own this item and can't buy it again, now the user has removed ads but the game still displays ads (incorrect). We will need to handle restore purchase of the user's purchased items so that the user avoids this situation.
189
+
190
+
On Android restore purchase will be called automatically when you reinstall the game via method `ConfirmPendingPurchase` call in `OnInitialized`. On ios you will need to create a restore purchase button for the user to click
191
+
192
+
When the restore is successful, it will automatically call the successful purchase callback of each item for further processing for the user
0 commit comments