Reputation: 397
My game is for IOS platform, I need close window with suggestion buy when user press ok from Success purchase Popup
, but how detect this event? or maybe close this window when they press Buy ? How is correct ?
Upvotes: 1
Views: 113
Reputation: 397
I detected when is success event purchased in this method -
public PurchaseProcessingResult ProcessPurchase (PurchaseEventArgs args)
{
if (String.Equals (args.purchasedProduct.definition.id, kProductIDSubscription, StringComparison.Ordinal)) {
var builder = ConfigurationBuilder.Instance (StandardPurchasingModule.Instance ());
var appleConfig = builder.Configure<IAppleConfiguration> ();
DateTime? data = validate (appleConfig.appReceipt, kProductIDSubscription);
if (data == null) {
Debug.Log ("data then purchased");
} else {
Debug.Log ("Date: " + data);
}
if (data != null) {
//Here is your code for success subscribed
isPurchased = true;
}
#endif
}
else {
Debug.Log (string.Format ("ProcessPurchase: FAIL. Unrecognized product: '{0}'", args.purchasedProduct.definition.id));
}
return PurchaseProcessingResult.Complete;
}
Upvotes: 1