Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marchbold/137ae6dd906f20535203 to your computer and use it in GitHub Desktop.
Save marchbold/137ae6dd906f20535203 to your computer and use it in GitHub Desktop.
Refreshing the application receipt in iOS 7+
// Initialise the extension before attempting to refresh the receipt
InAppBilling.service.applicationReceipt.addEventListener( ApplicationReceiptEvent.REFRESH_FAILED, refreshFailedHandler );
InAppBilling.service.applicationReceipt.addEventListener( ApplicationReceiptEvent.REFRESH_SUCCESS, refreshSuccessHandler );
InAppBilling.service.applicationReceipt.refresh();
...
private function refreshSuccessHandler( event:ApplicationReceiptEvent ):void
{
var appReceipt:String = InAppBilling.service.applicationReceipt.getAppReceipt();
trace( "getAppReceipt() = " + appReceipt );
}
private function refreshFailedHandler( event:ApplicationReceiptEvent ):void
{
trace( "application receipt refresh failed" + event.error );
}
// com.distriqt.InAppBilling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment