java.lang.Object | ||
↳ | android.content.BroadcastReceiver | |
↳ | com.urbanairship.push.BaseIntentReceiver |
Base intent receiver to process registration and push events from Urban Airship.
To listen for Urban Airship events, create a class that extends the BaseIntentReceiver. Register the new class in the AndroidManifest.xml with the following intent filter:Make sure the registered intent receiver is not exported to prevent it from receiving messages outside the application.<receiver android:name="CustomIntentReceiver" exported="false"> <intent-filter> <action android:name="com.urbanairship.push.CHANNEL_UPDATED" /> <action android:name="com.urbanairship.push.OPENED" /> <action android:name="com.urbanairship.push.RECEIVED" /> <action android:name="com.urbanairship.push.DISMISSED" /> <!-- Replace
${applicationId}with the package name for eclipse. --> <category android:name=
${applicationId}/> </intent-filter> </receiver>
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | RESULT_ACTIVITY_LAUNCHED | Result code indicating an activity was launched during
onNotificationActionOpened(android.content.Context, PushMessage, int, String, boolean)
or onNotificationOpened(android.content.Context, PushMessage, int) . |
|||||||||
int | RESULT_ACTIVITY_NOT_LAUNCHED | Result code indicating an activity was not launched during
onNotificationActionOpened(android.content.Context, PushMessage, int, String, boolean)
or onNotificationOpened(android.content.Context, PushMessage, int) . |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
BaseIntentReceiver() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void | onReceive(Context context, Intent intent) |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract void |
onBackgroundPushReceived(Context context, PushMessage message)
Called when a push is received that did not result in a notification being posted.
| ||||||||||
abstract void |
onChannelRegistrationFailed(Context context)
Called when channel registration fails.
| ||||||||||
abstract void |
onChannelRegistrationSucceeded(Context context, String channelId)
Called when channel registration succeeded.
| ||||||||||
abstract boolean |
onNotificationActionOpened(Context context, PushMessage message, int notificationId, String buttonId, boolean isForeground)
Called when a notification action button is opened.
| ||||||||||
void |
onNotificationDismissed(Context context, PushMessage message, int notificationId)
Called when a notification is dismissed from either swiping away the notification or from
clearing all notifications.
| ||||||||||
abstract boolean |
onNotificationOpened(Context context, PushMessage message, int notificationId)
Called when a notification is opened.
| ||||||||||
abstract void |
onPushReceived(Context context, PushMessage message, int notificationId)
Called when a push is received.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Result code indicating an activity was launched during
onNotificationActionOpened(android.content.Context, PushMessage, int, String, boolean)
or onNotificationOpened(android.content.Context, PushMessage, int)
.
Result code indicating an activity was not launched during
onNotificationActionOpened(android.content.Context, PushMessage, int, String, boolean)
or onNotificationOpened(android.content.Context, PushMessage, int)
.
Called when a push is received that did not result in a notification being posted.
context | The application context. |
---|---|
message | The received push message. |
Called when channel registration fails.
context | The application context. |
---|
Called when channel registration succeeded.
context | The application context. |
---|---|
channelId | The channel ID. |
Called when a notification action button is opened.
context | The application context. |
---|---|
message | The push message associated with the notification. |
notificationId | The notification ID. |
buttonId | The button identifier. |
isForeground | If the notification action button is foreground or not. If false the application
should not be launched. |
true
if the application was launched, otherwise false
. If
false
is returned for a foreground notification action button,
and autoLaunchApplication
is enabled, the launcher
activity will automatically be launched.
Called when a notification is dismissed from either swiping away the notification or from clearing all notifications.
context | The application context. |
---|---|
message | The push message associated with the notification. |
notificationId | The notification ID. |
Called when a notification is opened.
context | The application context. |
---|---|
message | The push message associated with the notification. |
notificationId | The notification ID. |
true
if the application was launched, otherwise false
. If
false
is returned, and autoLaunchApplication
is enabled, the launcher activity will automatically be launched.
Called when a push is received.
context | The application context. |
---|---|
message | The received push message. |
notificationId | The notification ID of the message posted in the notification center. |