Adobe AIR
How to integrate Pushwoosh SDK into your Adobe AIR project

Supports iOS, Android

The plugin needs AIR SDK version 33.0 or above.

To integrate Pushwoosh push notifications into your Adobe Air application follow these steps:
    1.
    Grab PushNotifications.ane and add it to your project.
    2.
    Add distriqt libraries to your project:
1
com.distriqt.playservices.Base
2
com.google.firebase.core
Copied!
1
androidx.appcompat
2
com.google.android.material
3
androidx.recyclerview
4
androidx.core
Copied!
1
com.distriqt.Core
Copied!
3. Configure your project in Firebase Console.
4. Locate the google-services.json file to the root level of your project.
google-services.json
You should've gotten the google-services.json file while creating the app in Firebase console. If you haven't, please consult this thread.
5. Add the following code to your application start routine:
1
// set push notification callbacks for the plugin
2
var pushwoosh:PushNotification = PushNotification.getInstance();
3
pushwoosh.addEventListener(PushNotificationEvent.PERMISSION_GIVEN_WITH_TOKEN_EVENT, onToken);
4
pushwoosh.addEventListener(PushNotificationEvent.PERMISSION_REFUSED_EVENT, onError);
5
pushwoosh.addEventListener(PushNotificationEvent.PUSH_NOTIFICATION_RECEIVED_EVENT, onPushReceived);
6
7
// important! Call this function when callbacks have been set. It triggers delivery of all pending push notifications.
8
pushwoosh.onDeviceReady();
9
10
// register for push
11
pushwoosh.registerForPushNotification();
Copied!
The handler functions are straightforward:
1
public function onToken(e:PushNotificationEvent):void{
2
trace("\n TOKEN: " + e.token + " ");
3
}
4
5
public function onError(e:PushNotificationEvent):void{
6
trace("\n TOKEN: " + e.errorMessage+ " ");
7
}
8
9
public function onPushReceived(e:PushNotificationEvent):void{
10
trace("\n TOKEN: " + JSON.stringify(e.parameters) + " ");
11
}
Copied!
6. Now configure your app.xml. Replace PUSHWOOSH_APP_ID with your actual Pushwoosh App ID. For Android replace FCM_SENDER_ID with your Firebase Sender ID and PACKAGE_NAME with your Android package name:
iOS + Android
1
<iPhone>
2
<InfoAdditions>
3
<![CDATA[
4
<key>Pushwoosh_APPID</key>
5
<string>PUSHWOOSH_APP_ID</string>
6
]]>
7
</InfoAdditions>
8
<Entitlements>
9
<![CDATA[
10
<key>aps-environment</key>
11
<string>development</string>
12
]]>
13
</Entitlements>
14
<requestedDisplayResolution>high</requestedDisplayResolution>
15
</iPhone>
16
17
<android>
18
<manifestAdditions><![CDATA[
19
<manifest android:installLocation="auto">
20
<application>
21
22
<!-- Pushwoosh START -->
23
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
24
<meta-data android:name="com.pushwoosh.appid" android:value="PUSHWOOSH_APP_ID" />
25
<meta-data android:name="com.pushwoosh.senderid" android:value="AFCM_SENDER_ID" />
26
<meta-data android:name="PW_BROADCAST_PUSH" android:value="true" />
27
<meta-data android:name="com.pushwoosh.notification_icon" android:value="@drawable/notification_small_icon" />
28
<meta-data android:name="com.pushwoosh.notification_service_extension" android:value="com.pushwoosh.nativeExtensions.PushwooshNotificationServiceExtension"/>
29
<activity
30
android:name="com.pushwoosh.inapp.view.RichMediaWebActivity"
31
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
32
<activity
33
android:name="com.pushwoosh.inapp.view.RemoteUrlActivity"
34
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
35
<receiver
36
android:name="com.pushwoosh.BootReceiver"
37
android:enabled="true"
38
android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
39
<intent-filter>
40
<action android:name="android.intent.action.BOOT_COMPLETED" />
41
<category android:name="android.intent.category.DEFAULT" />
42
</intent-filter>
43
</receiver>
44
<service
45
android:name="com.pushwoosh.FcmRegistrationService">
46
<intent-filter>
47
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
48
</intent-filter>
49
</service>
50
<service
51
android:name="com.pushwoosh.firebase.PushFcmIntentService">
52
<intent-filter>
53
<action android:name="com.google.firebase.MESSAGING_EVENT" />
54
</intent-filter>
55
</service>
56
<activity
57
android:name="com.pushwoosh.internal.utils.PermissionActivity"
58
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
59
<receiver android:name="com.pushwoosh.notification.LocalNotificationReceiver" />
60
<provider
61
android:name="com.pushwoosh.PushwooshInitProvider"
62
android:authorities="PACKAGE_NAME.pushwooshinitprovider"
63
android:enabled="true"
64
android:exported="false"
65
android:initOrder="50" />
66
<provider
67
android:initOrder="70"
68
android:enabled="true"
69
android:authorities="PACKAGE_NAME.firebasepushwooshinitprovider" android:exported="false"
70
android:name="com.pushwoosh.firebase.FirebaseInitProvider"/>
71
<provider
72
android:name="com.pushwoosh.nativeExtensions.PushwooshFirebaseInitProvider"
73
android:authorities="PACKAGE_NAME.FirebaseInitProvider"
74
android:enabled="true"
75
android:exported="false"
76
android:initOrder="60" />
77
<provider
78
android:name="com.pushwoosh.PushwooshSharedDataProvider"
79
android:authorities="PACKAGE_NAME.PushwooshSharedDataProvider"
80
android:enabled="true"
81
android:exported="true"
82
android:initOrder="60" />
83
<activity
84
android:name="com.pushwoosh.notification.NotificationOpenActivity"
85
android:noHistory="true"
86
android:theme="@android:style/Theme.Translucent.NoTitleBar"
87
android:enabled="true"
88
android:exported="false" />
89
<receiver
90
android:name="com.pushwoosh.NotificationUpdateReceiver"
91
android:enabled="true"
92
android:exported="false" />
93
<meta-data
94
android:name="com.pushwoosh.plugin.badge"
95
android:value="com.pushwoosh.badge.BadgePlugin" />
96
<meta-data
97
android:name="com.pushwoosh.internal.plugin_provider"
98
android:value="com.pushwoosh.nativeExtensions.internal.AdobeAirPluginProvider" />
99
<meta-data
100
android:name="com.pushwoosh.plugin.inbox"
101
android:value="com.pushwoosh.inbox.PushwooshInboxPlugin" />
102
<activity
103
android:name="com.pushwoosh.nativeExtensions.AirInboxActivity" />
104
<activity
105
android:name="com.pushwoosh.inbox.ui.presentation.view.activity.AttachmentActivity"
106
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
107
<!-- Pushwoosh END -->
108
109
<!-- Firebase START -->
110
<service
111
android:name="com.google.firebase.components.ComponentDiscoveryService"
112
android:exported="false" >
113
<meta-data
114
android:name="com.google.firebase.components:com.google.firebase.iid.Registrar"
115
android:value="com.google.firebase.components.ComponentRegistrar" />
116
<meta-data
117
android:name="com.google.firebase.components:com.google.firebase.datatransport.TransportRegistrar"
118
android:value="com.google.firebase.components.ComponentRegistrar" />
119
<meta-data
120
android:name="com.google.firebase.components:com.google.firebase.installations.FirebaseInstallationsRegistrar"
121
android:value="com.google.firebase.components.ComponentRegistrar" />
122
</service>
123
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND">
124
<intent-filter>
125
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
126
<category android:name="PACKAGE_NAME"/>
127
</intent-filter>
128
</receiver>
129
<service
130
android:name="com.google.firebase.messaging.FirebaseMessagingService"
131
android:exported="false" >
132
<intent-filter android:priority="-500" >
133
<action android:name="com.google.firebase.MESSAGING_EVENT" />
134
</intent-filter>
135
</service>
136
<service android:name="com.google.firebase.iid.FirebaseInstanceIdService" android:exported="true">
137
<intent-filter android:priority="-500">
138
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
139
</intent-filter>
140
</service>
141
<provider
142
android:name="com.google.firebase.provider.FirebaseInitProvider"
143
android:authorities="PACKAGE_NAME.firebaseinitprovider"
144
android:exported="false"
145
android:initOrder="100" />
146
<!-- Firebase END -->
147
148
<!-- Work-runtime START -->
149
<provider
150
android:name="androidx.work.impl.WorkManagerInitializer"
151
android:authorities="PACKAGE_NAME.workmanager-init"
152
android:directBootAware="false"
153
android:exported="false"
154
android:multiprocess="true"/>
155
<service
156
android:name="androidx.work.impl.background.systemalarm.SystemAlarmService"
157
android:directBootAware="false"
158
android:enabled="@bool/enable_system_alarm_service_default"
159
android:exported="false" />
160
<service
161
android:name="androidx.work.impl.background.systemjob.SystemJobService"
162
android:directBootAware="false"
163
android:enabled="@bool/enable_system_job_service_default"
164
android:exported="true"
165
android:permission="android.permission.BIND_JOB_SERVICE" />
166
<receiver
167
android:name="androidx.work.impl.utils.ForceStopRunnable$BroadcastReceiver"
168
android:directBootAware="false"
169
android:enabled="true"
170
android:exported="false" />
171
<receiver
172
android:name="androidx.work.impl.background.systemalarm.ConstraintProxy$BatteryChargingProxy"
173
android:directBootAware="false"
174
android:enabled="false"
175
android:exported="false" >
176
<intent-filter>
177
<action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
178
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
179
</intent-filter>
180
</receiver>
181
<receiver
182
android:name="androidx.work.impl.background.systemalarm.ConstraintProxy$BatteryNotLowProxy"
183
android:directBootAware="false"
184
android:enabled="false"
185
android:exported="false" >
186
<intent-filter>
187
<action android:name="android.intent.action.BATTERY_OKAY" />
188
<action android:name="android.intent.action.BATTERY_LOW" />
189
</intent-filter>
190
</receiver>
191
<receiver
192
android:name="androidx.work.impl.background.systemalarm.ConstraintProxy$StorageNotLowProxy"
193
android:directBootAware="false"
194
android:enabled="false"
195
android:exported="false" >
196
<intent-filter>
197
<action android:name="android.intent.action.DEVICE_STORAGE_LOW" />
198
<action android:name="android.intent.action.DEVICE_STORAGE_OK" />
199
</intent-filter>
200
</receiver>
201
<receiver
202
android:name="androidx.work.impl.background.systemalarm.ConstraintProxy$NetworkStateProxy"
203
android:directBootAware="false"
204
android:enabled="false"
205
android:exported="false" >
206
<intent-filter>
207
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
208
</intent-filter>
209
</receiver>
210
<receiver
211
android:name="androidx.work.impl.background.systemalarm.RescheduleReceiver"
212
android:directBootAware="false"
213
android:enabled="false"
214
android:exported="false" >
215
<intent-filter>
216
<action android:name="android.intent.action.BOOT_COMPLETED" />
217
<action android:name="android.intent.action.TIME_SET" />
218
<action android:name="android.intent.action.TIMEZONE_CHANGED" />
219
</intent-filter>
220
</receiver>
221
<receiver
222
android:name="androidx.work.impl.background.systemalarm.ConstraintProxyUpdateReceiver"
223
android:directBootAware="false"
224
android:enabled="@bool/enable_system_alarm_service_default"
225
android:exported="false" >
226
<intent-filter>
227
<action android:name="androidx.work.impl.background.systemalarm.UpdateProxies" />
228
</intent-filter>
229
</receiver>
230
<!-- Work-runtimme END -->
231
</application>
232
233
<!-- Permissions START -->
234
<uses-permission android:name="android.permission.WAKE_LOCK" />
235
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
236
<!-- FCM connects to Firebase Services. -->
237
<uses-permission android:name="android.permission.INTERNET" />
238
<!-- This app has permission to register and receive data message. -->
239
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
240
<!-- Vibration in push notification -->
241
<uses-permission android:name="android.permission.VIBRATE" />
242
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
243
<!--BADGES-->
244
<!--for Samsung-->
245
<uses-permission android:name="com.sec.android.provider.badge.permission.READ"/>
246
<uses-permission android:name="com.sec.android.provider.badge.permission.WRITE"/>
247
<!--for htc-->
248
<uses-permission android:name="com.htc.launcher.permission.READ_SETTINGS"/>
249
<uses-permission android:name="com.htc.launcher.permission.UPDATE_SHORTCUT"/>
250
<!--for sony-->
251
<uses-permission android:name="com.sonyericsson.home.permission.BROADCAST_BADGE"/>
252
<uses-permission android:name="com.sonymobile.home.permission.PROVIDER_INSERT_BADGE"/>
253
<!--for apex-->
254
<uses-permission android:name="com.anddoes.launcher.permission.UPDATE_COUNT"/>
255
<!--for solid-->
256
<uses-permission android:name="com.majeur.launcher.permission.UPDATE_BADGE"/>
257
<!--for huawei-->
258
<uses-permission android:name="com.huawei.android.launcher.permission.CHANGE_BADGE"/>
259
<uses-permission android:name="com.huawei.android.launcher.permission.READ_SETTINGS"/>
260
<uses-permission android:name="com.huawei.android.launcher.permission.WRITE_SETTINGS"/>
261
<!--for ZUK-->
262
<uses-permission android:name="android.permission.READ_APP_BADGE"/>
263
<!--for OPPO-->
264
<uses-permission android:name="com.oppo.launcher.permission.READ_SETTINGS"/>
265
<uses-permission android:name="com.oppo.launcher.permission.WRITE_SETTINGS"/>
266
<!--for EvMe-->
267
<uses-permission android:name="me.everything.badger.permission.BADGE_COUNT_READ"/>
268
<uses-permission android:name="me.everything.badger.permission.BADGE_COUNT_WRITE"/>
269
<!-- Permissions END -->
270
</manifest>
271
272
]]>
273
</manifestAdditions>
274
<colorDepth>16bit</colorDepth>
275
</android>
Copied!

iOS Important Info

Please note that for development builds ( ones signed with iOS Development Certificates) the value for aps-environment should be development as in the example above. For Ad-Hoc or AppStore builds (ones signed with iOS Production Certificate) please use production value.

Android Important Info

IMPORTANT! Sender id is an integer but prefix it with "A" as in the example above. Ex: "A1234567890".
Note that for debug builds Adobe Air automatically postfixes your package name with “.debug”. We recommend to use “Release” builds to prevent a lot of headache.
6. Make sure you select “Package” checkbox on the “Native Extensions” pane in the settings. Also select the path to the latest iOS SDK as per screenshot below when exporting for iOS:

Geozones Push Notifications

    1.
    To enable location tracking in your application:
    1.1. Make sure you have integrated Pushwoosh push notifications into your Adobe Air application
    1.2. Grab PushwooshGeozones.ane and add it to your project.
    1.3. Add distriqt libraries to your project:
1
com.distriqt.playservices.Location
Copied!
1.4. Add the following strings to InfoAdditions:
app.xml
1
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
2
<string> NSLocationAlwaysAndWhenInUseUsageDescription </string>
3
<key>NSLocationWhenInUseUsageDescription</key>
4
<string>NSLocationWhenInUseUsageDescription </string>
5
<key>NSLocationAlwaysUsageDescription</key>
6
<string>NSLocationAlwaysUsageDescription</string>
Copied!
where:
    NSLocationWhenInUseUsageDescription(required) for app to track Geozones only while running in the foreground.
    NSLocationAlwaysAndWhenInUseUsageDescription - (required) for app to track Geozones in both conditions, and to show a permission request dialog pop-up.
    NSLocationAlwaysUsageDescription(optional) for app to track Geozones at all times; should be used if your app targets iOS 10 and earlier versions.
1.5. Add the following strings to manifestAdditions after the <application> string:
app.xml
1
<meta-data
2
android:name="com.pushwoosh.plugin.location"
3
android:value="com.pushwoosh.location.LocationPlugin" />
4
<service android:name="com.pushwoosh.location.network.GeoLocationServiceApi16" />
5
<activity
6
android:name="com.pushwoosh.location.internal.utils.ResolutionActivity"
7
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
8
<service
9
android:name="com.pushwoosh.location.network.GeoLocationServiceApi21"
10
android:exported="true"
11
android:permission="android.permission.BIND_JOB_SERVICE" />
12
<service android:name="com.pushwoosh.location.foregroundservice.ForegroundService"/>
13
<receiver android:name="com.pushwoosh.location.geofencer.GeofenceReceiver">
14
<intent-filter>
15
<action android:name="PACKAGE_NAME.action.PROCESS_UPDATES" />
16
</intent-filter>
17
</receiver>
Copied!
Add the following code to manifestAdditions after the </application> string:
app.xml
1
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
2
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
3
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
4
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
Copied!
2. To start location tracking, call:
1
import com.pushwoosh.geozones.nativeExtensions.*;
2
3
PushwooshGeozones.getInstance().startLocationTracking();
Copied!
That’s it!
Last modified 8d ago