Adobe AIR native extension

Push Notifications Adobe AIR Native Extension

The extension is available here: com.distriqt.PushNotifications


One Signal

This ANE implements the OneSignal iOS and Android SDKs for usage in your mobile AIR applications.

OneSignal is a high volume and reliable push notification service for websites and mobile applications. They support all major native and mobile platforms by providing dedicated SDKs for each platform, a RESTful server API, and an online dashboard for marketers to design and send push notifications.

OneSignal provides a simple interface to push notifications, letting content creators focus on quality user engagement instead of complex implementation.

Required For Setup

Required ANEs

To use this service add the com.distriqt.PushNotifications.OneSignal.ane variant of the extension to your project in place of com.distriqt.PushNotifications.ane. You should only add one of the variants to your project. If you need to support multiple services please use the All Services variant.

All variants of the Push Notifications extension have the same extension id: com.distriqt.PushNotifications so you should add this to your extensions list in your application descriptor:

Make sure you have added the common ANEs from the ![](Add the Extension i.Add the Extension) section first. This includes the Core and Android Support ANEs.

Android Support ANE

Due to several of our ANE’s using the Android Support library the library has been separated into a separate ANE allowing you to avoid conflicts and duplicate definitions. This means that you need to include the some of the android support native extensions in your application along with this extension.

You will add these extensions as you do with any other ANE, and you need to ensure it is packaged with your application. There is no problems including this on all platforms, they are just required on Android.

This ANE requires the following Android Support extensions:

You can access these extensions here: https://github.com/distriqt/ANE-AndroidSupport.

Note: if you have been using the older com.distriqt.AndroidSupport.ane you should remove that ANE and replace it with the equivalent com.distriqt.androidsupport.V4.ane. This is the new version of this ANE and has been renamed to better identify the ANE with regards to its contents.

Google Play Services

This ANE requires usage of certain aspects of the Google Play Services client library. The client library is available as a series of ANEs that you add into your applications packaging options. Each separate ANE provides a component from the Play Services client library and are used by different ANEs. These client libraries aren’t packaged with this ANE as they are used by multiple ANEs and separating them will avoid conflicts, allowing you to use multiple ANEs in the one application.

This ANE requires the following Google Play Services:


You must include the above native extensions in your application along with this extension, and you need to ensure they are packaged with your application.

You can access the Google Play Services client library extensions here: https://github.com/distriqt/ANE-GooglePlayServices.

Extension IDs

The following should be added to your extensions node in your application descriptor to identify all the required ANEs in your application:



Firstly make sure you have generated your iOS Push Certificates. You can follow the guide by OneSignal:

Info Additions and Entitlements

Push notifications require a few additions to the Info plist and Entitlements section of your application to correctly configure your application for push notifications.

You should add the listing below to application descriptor iPhone node.

You must replace the BUNDLE_SEED_ID and BUNDLE_IDENTIFIER with the information you gathered when setting up your application. Also make sure you set the environment correctly either using production or development, both are shown in the example below with the production version commented out. More on this below.

		<!-- DEVELOPMENT -->
		<!-- PRODUCTION -->

The first entitlement field is the aps-environment. This field indicates whether we are using the development or the production environment. It must be either development or production and depends on which configuration you are using. If you are running a debug build you should use development. If you are looking to publish the application to the AppStore, you should use production.

You should have noted the BUNDLE_SEED_ID (or App ID Prefix) and BUNDLE_IDENTIFIER when you were setting up your application in the iOS developer center. The seed id should be a unique ten character string and the identifier should be similar to your AIR application id.


Firstly make sure you have generated your Google Service API Key. You can follow the guide by OneSignal:

Manifest Additions

You must add all the OneSignal related manifest additions along with several additions for Cloud Messaging.

The following shows the complete manifest additions node. You must replace APPLICATION_PACKAGE with your AIR application’s Java package name, something like air.com.distriqt.test. Generally this is your AIR application id prefixed by air. unless you have specified no air flair in your build options.

<manifest android:installLocation="auto">
	<uses-permission android:name="android.permission.INTERNET" />
	<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
	<uses-permission android:name="android.permission.WAKE_LOCK" />
	<uses-permission android:name="android.permission.VIBRATE" />
	<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

	<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
	<permission android:name="APPLICATION_PACKAGE.permission.C2D_MESSAGE" android:protectionLevel="signature" />
	<uses-permission android:name="APPLICATION_PACKAGE.permission.C2D_MESSAGE" />
	<uses-permission android:name="com.sec.android.provider.badge.permission.READ" />
    <uses-permission android:name="com.sec.android.provider.badge.permission.WRITE" /> <!-- HTC -->
    <uses-permission android:name="com.htc.launcher.permission.READ_SETTINGS" />
    <uses-permission android:name="com.htc.launcher.permission.UPDATE_SHORTCUT" /> <!-- Sony -->
    <uses-permission android:name="com.sonyericsson.home.permission.BROADCAST_BADGE" />
    <uses-permission android:name="com.sonymobile.home.permission.PROVIDER_INSERT_BADGE" /> <!-- Apex -->
    <uses-permission android:name="com.anddoes.launcher.permission.UPDATE_COUNT" /> <!-- Solid -->
    <uses-permission android:name="com.majeur.launcher.permission.UPDATE_BADGE" /> <!-- Huawei -->
    <uses-permission android:name="com.huawei.android.launcher.permission.CHANGE_BADGE" />
    <uses-permission android:name="com.huawei.android.launcher.permission.READ_SETTINGS" />
    <uses-permission android:name="com.huawei.android.launcher.permission.WRITE_SETTINGS" /> <!-- ZUK -->
    <uses-permission android:name="android.permission.READ_APP_BADGE" /> <!-- OPPO -->
    <uses-permission android:name="com.oppo.launcher.permission.READ_SETTINGS" />
    <uses-permission android:name="com.oppo.launcher.permission.WRITE_SETTINGS" /> <!-- EvMe -->
    <uses-permission android:name="me.everything.badger.permission.BADGE_COUNT_READ" />
    <uses-permission android:name="me.everything.badger.permission.BADGE_COUNT_WRITE" />
		<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

		<activity android:name="com.google.android.gms.common.api.GoogleApiActivity"

		<!-- ONE SIGNAL -->
		<meta-data android:name="onesignal_google_project_number" android:value="str:REMOTE" />

			android:permission="com.google.android.c2dm.permission.SEND" >

			<!-- High priority so OneSignal payloads can be filtered from other GCM receivers if filterOtherGCMReceivers is enabled. -->
			<intent-filter android:priority="999" >
				<action android:name="com.google.android.c2dm.intent.RECEIVE" />
				<category android:name="APPLICATION_PACKAGE" />
		<receiver android:name="com.onesignal.NotificationOpenedReceiver" />

		<service android:name="com.onesignal.GcmIntentService" /> <!-- For Android O -->
			android:permission="android.permission.BIND_JOB_SERVICE" />
			android:permission="android.permission.BIND_JOB_SERVICE" />
			android:permission="android.permission.BIND_JOB_SERVICE" />
			android:permission="android.permission.BIND_JOB_SERVICE" /> <!-- END - For Android O -->
		<service android:name="com.onesignal.SyncService" />

			android:theme="@android:style/Theme.Translucent.NoTitleBar" />

		<service android:name="com.onesignal.NotificationRestoreService" />

		<receiver android:name="com.onesignal.BootUpReceiver" >
				<action android:name="android.intent.action.ACTION_BOOT_COMPLETED" />
				<action android:name="android.intent.action.BOOT_COMPLETED" />
				<action android:name="android.intent.action.QUICKBOOT_POWERON" />
		<receiver android:name="com.onesignal.UpgradeReceiver" >
				<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />