This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Application.init( APPLICATION_KEY ); | |
if (Application.isSupported) | |
{ | |
Application.service.setStatusBarStyle( IOSStatusBarStyles.IOS_STATUS_BAR_LIGHT ); | |
Application.service.setStatusBarHidden( false ); | |
} | |
// com.distriqt.Application |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Application.init( APPLICATION_KEY ); | |
if (Application.isSupported) | |
{ | |
var uniqueId:String = Application.service.device.uniqueId(); | |
} | |
// com.distriqt.Application |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
InAppBilling.init( APPLICATION_KEY ); | |
if (InAppBilling.isSupported) | |
{ | |
trace( "InAppBilling.service.version = " + InAppBilling.service.version ); | |
// Functionality here | |
} | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
InAppBilling.init( APPLICATION_KEY ); | |
if (InAppBilling.isSupported) | |
{ | |
trace( "InAppBilling.service.version = " + InAppBilling.service.version ); | |
InAppBilling.service.addEventListener( InAppBillingEvent.SETUP_SUCCESS, setup_successHandler ); | |
InAppBilling.service.addEventListener( InAppBillingEvent.SETUP_FAILURE, setup_failureHandler ); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private var _products : Array; | |
private var _productIds : Array = [ "com.distriqt.testProduct1", "com.distriqt.testProduct2" ]; | |
InAppBilling.init( APPLICATION_KEY ); | |
if (InAppBilling.isSupported) | |
{ | |
trace( "InAppBilling.service.version = " + InAppBilling.service.version ); | |
InAppBilling.service.addEventListener( InAppBillingEvent.SETUP_SUCCESS, setup_successHandler ); | |
InAppBilling.service.addEventListener( InAppBillingEvent.SETUP_FAILURE, setup_failureHandler ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The service must be setup and a list of products retrieved. | |
// Make sure you have the following listeners | |
InAppBilling.service.addEventListener( PurchaseEvent.PURCHASES_UPDATED, purchases_updatedHandler ); | |
InAppBilling.service.addEventListener( PurchaseEvent.PURCHASE_FAILED, purchase_failedHandler ); | |
var request:PurchaseRequest = new PurchaseRequest(); | |
request.productId = productId; | |
request.quantity = 1; | |
var success:Boolean = InAppBilling.service.makePurchase( request ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The service must be setup and a list of products retrieved. | |
// Make sure you have the following listeners | |
InAppBilling.service.addEventListener( PurchaseEvent.PURCHASE_RESTORED, purchase_restoredHandler ); | |
InAppBilling.service.addEventListener( InAppBillingEvent.RESTORE_PURCHASES_SUCCESS, restorePurchases_successHandler ); | |
InAppBilling.service.addEventListener( InAppBillingEvent.RESTORE_PURCHASES_FAILED, restorePurchases_failedHandler ); | |
InAppBilling.service.restorePurchases(); | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The service must be setup and a list of products retrieved. | |
// Make sure you have the following listeners | |
InAppBilling.service.addEventListener( InAppBillingEvent.CONSUME_SUCCESS, consumePurchase_successHandler ); | |
InAppBilling.service.addEventListener( InAppBillingEvent.CONSUME_FAILED, consumePurchase_failedHandler ); | |
InAppBilling.service.consumePurchase( new PurchaseRequest( productId ) ); | |
... | |
private function consumePurchase_successHandler( event:InAppBillingEvent ):void |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
WebP.init( APPLICATION_KEY ); | |
if (WebP.isSupported) | |
{ | |
// Find a file packaged with the application | |
var file:File = File.applicationDirectory.resolvePath( "image.webp" ); | |
var bd:BitmapData = WebP.service.loadWebPBitmapData( path.url ); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
WebP.init( APPLICATION_KEY ); | |
if (WebP.isSupported) | |
{ | |
// For this example load data from a file into a ByteArray | |
var file:File = File.applicationDirectory.resolvePath( "image.webp" ); | |
var fs:FileStream = new FileStream(); | |
fs.open( file, FileMode.READ ); | |
var data:ByteArray = new ByteArray(); |