If (atform = RuntimePlatform.IPhonePlayer ||Īatform = RuntimePlatform. Public PurchaseProcessingResult ProcessPurchase (PurchaseEventArgs e) / This will be called when a purchase completes. Then you can deliver the games to the web or as standalone players. On non-Apple platforms this will have no effect OnDeferred will never be called. Unity allows you to build rich 3D games with animated characters, sizzling graphics, immersive physics. On Apple platforms we need to handle deferred purchases caused by Apple's Ask to Buy feature. M_AppleExtensions = extensions.GetExtension () Public void OnInitialized (IStoreController controller, IExtensionProvider extensions) / This will be called when Unity IAP has finished initialising. UnityPurchasing.Initialize (this, builder) Public void OnInitialized(IStoreController controller, IExtensionProvider extensions)Įxtensions.GetExtension ().RestoreTransactions (result => / Your IStoreListener implementation of OnInitialized. During this process the ProcessPurchase method of your IStoreListener will be invoked for any items the user already owns. On Apple platforms users must enter their password to retrieve previous transactions so your application must provide users with a button letting them do so. In App Purchases may be restricted in a device’s settings, which can be checked for as follows: var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance()) īool canMakePayments = builder.Configure().canMakePayments String receipt = builder.Configure().appReceipt Extended functionality Reading the App ReceiptĪn App Receipt is stored on the device’s local storage and can be read as follows: var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance())
0 Comments
Leave a Reply. |