Skip to content

Commit c911303

Browse files
committed
Update IapManager.cs
1 parent ced270a commit c911303

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Runtime/IapManager.cs

+8-3
Original file line numberDiff line numberDiff line change
@@ -196,23 +196,25 @@ public void OnPurchaseFailed(Product product, PurchaseFailureDescription failure
196196
}
197197

198198
#if UNITY_IOS
199-
public void RestorePurchase()
199+
private void InternalRestorePurchase()
200200
{
201201
if (!IsInitialized)
202202
{
203203
Debug.Log("Restore purchases fail. not initialized!");
204204
return;
205205
}
206206

207-
if (Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.OSXPlayer)
207+
if (Application.platform == RuntimePlatform.IPhonePlayer ||
208+
Application.platform == RuntimePlatform.OSXPlayer)
208209
{
209210
Debug.Log("Restore purchase started ...");
210211

211212
var storeProvider = _extensionProvider.GetExtension<IAppleExtensions>();
212213
storeProvider.RestoreTransactions(_ =>
213214
{
214215
// no purchase are avaiable to restore
215-
Debug.Log("Restore purchase continuting: " + _ + ". If no further messages, no purchase available to restore.");
216+
Debug.Log("Restore purchase continuting: " + _ +
217+
". If no further messages, no purchase available to restore.");
216218
});
217219
}
218220
else
@@ -308,6 +310,9 @@ public static string LocalizedPriceProduct(IapDataProduct product) =>
308310
_instance.InternalLocalizedPriceProduct(product);
309311

310312
public static string LocalizedPriceProduct(string id) => _instance.InternalLocalizedPriceProduct(id);
313+
#if UNITY_IOS
314+
public static void RestorePurchase() => _instance.InternalRestorePurchase();
315+
#endif
311316

312317
#endregion
313318
}

0 commit comments

Comments
 (0)