Skip to content

Instantly share code, notes, and snippets.

View marchbold's full-sized avatar
🚲
making stuff...

Michael marchbold

🚲
making stuff...
View GitHub Profile
@marchbold
marchbold / distriqt.extension.idfa.getIDFA.as
Created September 18, 2020 12:46
Request the IDFA with authorisation
IDFA.service.addEventListener( IDFAEvent.COMPLETE, idfaCompleteHandler );
IDFA.service.requestAuthorisation(
function ( status:String ):void
{
if (status == TrackingAuthorisationStatus.AUTHORISED)
{
IDFA.service.getIDFA();
}
}
@marchbold
marchbold / Products.as
Last active September 28, 2020 23:45
InAppBilling product id platform switching
package com.distriqt.test.inappbilling
{
import com.distriqt.extension.inappbilling.InAppBilling;
public class Products
{
public static const PRODUCT_1:String = "product1";
public static const PRODUCT_2:String = "product2";
public static const SUBSCRIPTION_1:String = "subscription1";
@marchbold
marchbold / distriqt.extension.pushnotifications.inappmessaging.as
Created September 1, 2020 11:56
Handling In-App Messages using the Push Notifications extension
if (PushNotifications.service.inAppMessaging.isSupported)
{
PushNotifications.service.inAppMessaging.addEventListener(
InAppMessagingEvent.SELECTED,
inappmessaging_selectedHandler
);
}
function inappmessaging_selectedHandler( event:InAppMessagingEvent ):void
{
@marchbold
marchbold / com.distriqt.playservices.licensing.as
Created August 11, 2020 12:36
Using the Licensing Verification Library in Adobe AIR
var BASE64_PUBLIC_KEY: String = "BASE64_PUBLIC_KEY";
var SALT:Vector.<int> = Vector.<int>( [ 1, 43, -12, -1, 54, 98, -100, -12, 43, 2, -8, -4, 9, 5, -106, -108, -33, 45, -1, 84 ]);
PlayLicensing.service.setup( BASE64_PUBLIC_KEY, SALT );
PlayLicensing.service.addEventListener( PlayLicensingEvent.ALLOW, checkAccessResponseHandler );
PlayLicensing.service.addEventListener( PlayLicensingEvent.DONT_ALLOW, checkAccessResponseHandler );
PlayLicensing.service.addEventListener( PlayLicensingEvent.ERROR, checkAccessResponseHandler );
@marchbold
marchbold / distriqt.extension.packagemanager.getInstalledApplications.as
Created April 6, 2020 01:24
Using the PackageManager extension to get installed applications
var installedPackages:Array = PackageManager.service.getInstalledApplications();
if (installedPackages != null)
{
for each (var packageInfo:PackageInfo in installedPackages)
{
trace( "package: " + packageInfo.toString() );
}
}
// com.distriqt.PackageManager
@marchbold
marchbold / distriqt.extension.share.sms.as
Last active January 23, 2020 22:50
Using the Share extension to send an SMS using the UI
if (Share.service.sms.isSMSSupported)
{
var sms:SMS = new SMS();
sms.address = "0444444444";
sms.message = "Testing SMS";
Share.service.sms.sendSMSWithUI( sms );
}
// com.distriqt.Share
@marchbold
marchbold / distriqt.extension.applesignin.simple.as
Created December 14, 2019 02:27
Sign In with Apple using AIR
AppleSignIn.instance.addEventListener( AppleSignInErrorEvent.ERROR, errorHandler );
AppleSignIn.instance.addEventListener( AppleSignInEvent.SUCCESS, successHandler );
AppleSignIn.instance.loginWithAppleId();
function successHandler( event:AppleSignInEvent ):void
{
// User signed in
}
@marchbold
marchbold / distriqt.extension.application.keyboard.as
Created August 23, 2019 04:11
Keyboard information from the Application ANE
Application.service.keyboard.addEventListener( SoftKeyboardEvent.SOFT_KEYBOARD_DEACTIVATE, keyboard_deactivateHandler );
Application.service.keyboard.addEventListener( SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATE, keyboard_activateHandler );
function keyboard_activateHandler( event:SoftKeyboardEvent ):void
{
var keyboardY:int = Application.service.keyboard.y;
var keyboardHeight:int = Application.service.keyboard.height;
}
function keyboard_deactivateHandler( event:SoftKeyboardEvent ):void
@marchbold
marchbold / distriqt.extension.packagemanager.removed.as
Last active July 8, 2019 23:38
Package Manager example listening for application uninstalls
PackageManager.service.addEventListener( PackageManagerEvent.PACKAGE_REMOVED, packageRemovedHandler );
function packageRemovedHandler( event:PackageManagerEvent ):void
{
trace( "Package Removed::"+ event.packageName );
}
// com.distriqt.PackageManager
@marchbold
marchbold / resign.sh
Created November 8, 2018 07:26
Resign Script for Adobe AIR applications using the Branch ANE
#!/bin/bash
#####################################
## CONFIG
# You need to set the values below for your application
# We suggest they are full paths to the files.
# The path to the ipa generated from your AIR application packaging
IPA="/path/to/your/dist_app.ipa"