Adobe Air

With the xtremepush ANE, you can add xtremepush to both iOS and Android apps built with Adobe Air.

Platform Specific Information

Xtremepush supports push notifications for iOS devices via Apples's Push Notification Service (APNs for short) and push notifications for Android devices via Google’s GCM/FCM (Google/Firebase Cloud Messaging for Android) service. This page contains Adobe Air specific instructions but you will need to connect your iOS and Android app to the platform separately.

N.B. To integrate successfully you will need to have your xtremepush App Key, APNS certs for iOS and, FCM Sender ID and FCM API key for Android. These are used to connect your app to the platform and the Apple and Google push services. You will find links to documentation on connecting to the platform below:

A full Adobe Air integration guide is given below. 

 

Adding the ANE 

Download the archive of the Xtremepush ANE from here and extract the XPush.ane file from it, to use in your app.


Screen_Shot_2017-09-19_at_23.11.52.png

Open up your project properties by right-clicking on your project and selecting properties. In the menu on the left-hand side find 'ActionScript Build Path' and click it. There will now be a tab on the top of the page called 'Native Extensions', click it. Now click the button on the right-hand side that reads 'Add ANE', browse to the XPush.Ane and select it.

Now the ANE is added to the project, but we must still ensure that it is packaged with the project. 
To do this, we navigate to 'ActionScript Build Packaging' on the left-hand menu. This is a drop-down menu that has all the platforms associated with the project. For each one, click on the 'Native Extensions' tab and ensure that the 'package' checkbox is checked for XPush.Ane

Screen_Shot_2017-09-19_at_23.19.49.png

 

 

Android App.XML Requirements

The following is a sample manifest with all the XPush manifest requirements

<android>
    <manifestAdditions><![CDATA[
         <manifest android:installLocation="auto">
             <!-- REQUIRED for xtremepush -->
             <uses-permission android:name="android.permission.INTERNET" />
             <!-- Keeps the processor from sleeping when a message is received. -->
             <uses-permission android:name="android.permission.WAKE_LOCK" />
             <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

             <!-- OPTIONAL xtremepush settings-->
             <!-- REQUIRED FOR GEO-LOCATION-->
             <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
             <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

             <!-- REQUIRED IF you support iBeacon and your app must support devices that don't support BLE -->
             <uses-permission android:name="android.permission.BLUETOOTH" />
             <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
             <uses-feature
               android:name="android.hardware.bluetooth_le"
               android:required="false" />

             <!-- REQUIRED PERMISSIONS for GCM -->
             <!-- A Google account is not a requirement on devices running Android 4.0.4 or higher so GET_ACCOUNTS may be omitted if you target 4.0.4 and up (https://developer.android.com/google/gcm/client.html) -->
             <uses-permission android:name="android.permission.GET_ACCOUNTS" />
             <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
             <!-- This app has permission to register with GCM and receive message -->
             <permission android:name=".permission.C2D_MESSAGE" android:protectionLevel="signature" />
             <uses-permission android:name=".permission.C2D_MESSAGE" />
             <!-- The two elements above ensure that only this application can receive the messages and registration result -->

             <application
                   android:name="android.support.multidex.MultiDexApplication" >

                 <activity
                     android:name="ie.imobile.extremepush.ui.InboxActivity"
                     android:label="InboxActivity"
                     android:theme="@style/Theme.Transparent"
                     android:configChanges="orientation|screenSize" />

                 <activity
                     android:name="ie.imobile.extremepush.ui.OnclickPushActivity"
                     android:exported="false"
                     android:taskAffinity="ie.imobile.extremepush.ui.temptask" />

                 <service android:name="ie.imobile.extremepush.NotificationOnClickHandlerService" />

                 <activity
                     android:name="ie.imobile.extremepush.ui.WebViewActivity"
                     android:exported="false" />

                 <!-- REQUIRED FOR LOCATION SERVICES-->
                 <service
                     android:name="ie.imobile.extremepush.location.ProxymityAlertReceiver"/>

                 <activity
                     android:name="ie.imobile.extremepush.ui.LocationDialogActivity"
                     android:label="Locations are not available"
                     android:theme="@android:style/Theme.Dialog"
                     android:exported="false" />

                 <service android:name="ie.imobile.extremepush.location.GeoLocationService" />

                 <!-- REQUIRED FOR IBEACON -->
                 <service android:name="ie.imobile.extremepush.beacons.BeaconLocationService" />
                 <receiver android:name="org.altbeacon.beacon.startup.StartupBroadcastReceiver" >
                     <intent-filter>
                         <action android:name="android.intent.action.BOOT_COMPLETED" />
                         <action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
                         <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
                     </intent-filter>
                 </receiver>
                 <service
                     android:name="org.altbeacon.beacon.service.BeaconService"
                     android:enabled="true"
                     android:exported="false"
                     android:isolatedProcess="false"
                     android:label="beacon" />
                 <service
                     android:name="org.altbeacon.beacon.BeaconIntentProcessor"
                     android:enabled="true"
                     android:exported="false" />

                 <!-- REQUIRED FOR GCM, LOCATION AND BEACON -->
                 <service
                     android:name="ie.imobile.extremepush.google.GCMListenerService"
                     android:exported="false" >
                     <intent-filter>
                         <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                     </intent-filter>
                 </service>
                 <receiver
                     android:name="ie.imobile.extremepush.receivers.CoreBroadcastReceiver" >
                     <intent-filter>
                         <action android:name="ie.imobile.extremepush.BEACON_SERVICE_STARTED" />
                         <category android:name="." />
                     </intent-filter>
                     <intent-filter>
                         <action android:name="android.intent.action.BOOT_COMPLETED" />
                         <action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
                         <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
                     </intent-filter>
                 </receiver>
                 <receiver
                     android:name="com.google.android.gms.gcm.GcmReceiver"
                     android:exported="true"
                     android:permission="com.google.android.c2dm.permission.SEND" >
                     <intent-filter>
                         <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                         <action android:name="com.google.android.c2bdm.intent.REGISTRATION" />
                         <category android:name="." />
                     </intent-filter>
                 </receiver>         
                 
                 <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
                 
             </application>
         </manifest>    
      ]]></manifestAdditions>
</android>

iOS App.XML Requirements

The following is a sample of the XPush iOS requirements

<iPhone>
    <InfoAdditions><![CDATA[
        <key>UIDeviceFamily</key>
        <array>
            <string>1</string>
            <string>2</string>
        </array>
        <key>MinimumOSVersion</key>
        <string>7.0</string>
        <key>NSLocationAlwaysUsageDescription</key>
        <string>Your description...</string>
        <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
        <string>Your description...</string>
        <key>NSLocationWhenInUseUsageDescription</key>
        <string>Your description...</string>
    ]]></InfoAdditions>
    <requestedDisplayResolution>high</requestedDisplayResolution>
    <Entitlements>
        <![CDATA[
            <key>aps-environment</key>
            <string>development</string>
         ]]>
    </Entitlements>
</iPhone>

Note: aps-environment is a must to make pushes work. "development" - for testing in sandbox APNS. "production" - for production apps 

 

Setup the XPush Native Extension in your App

1. Import the XPushNativeASExtension

import ie.imobile.xtremepush.XPushASExtension;

2. Create the Object

private var _ane:XPushASExtension;

_ane = new XPushASExtension();

3. Register your settings with XtremePush

var o:Object = {
    appKey:"YOUR_APP_KEY",
    debugLogsEnabled:true,
    impressionsBatchingEnabled:true,
    inappMessagingEnabled :true,
    inboxEnabled :true,
    tagsBatchingEnabled :true,
    attributionsEnabled :true,
    ios :{
        locationsEnabled:true,
        locationsPermissionsRequest :true,
        nameCollectingEnabled :true,
        pushPermissionsRequest :true,
        shouldWipeBadgeNumber :true
    },
    android:
    {
        beaconsEnabled:true,
        gcmProjectNumber:"YOUR_PROJECT_NUMBER",
        geoEnabled:true,
        locationsPermissionsRequest :true
    }
};

_ane.register(JSON.stringify(o));

 

Events and Tags 

If you want to send tags or events to our platform elsewhere in your app, this can be achieved with the following function calls:

_ane.hitEvent("event");
_ane.hitTag("tag");
_ane.hitTagWithValue("tag", "value");

 

Inbox

To open up the xtremepush inbox, use the following function call

_ane.openInbox();

 

Unsubscribe from Notifications 

_ane.setSubscription(false);

 

Set External ID

_ane.setExternalId("");
Have more questions? Submit a request

0 Comments

Article is closed for comments.