flash.notifications

# RemoteNotifier - AS3

Package | flash.notifications
Class | public class RemoteNotifier
Inheritance | RemoteNotifier EventDispatcher Object

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 3.4

The RemoteNotifier class lets you subscribe to and unsubscribe from push notifications.

This class includes methods to query which RemoteNotificationStyles are supported on the target platform. It dispatches RemoteNotificationEvent and StatusEvent.

Related API Elements

flash.notifications.NotificationStyle
flash.events.RemoteNotificationEvent
flash.events.StatusEvent

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object
|  | supportedNotificationStyles : Vector.<String> [static] [read-only] A vector list of all supported notification styles. | RemoteNotifier

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | RemoteNotifier() Creates a new RemoteNotifier object. | RemoteNotifier
|  | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event. | EventDispatcher
|  | dispatchEvent(event:Event):Boolean Dispatches an event into the event flow. | EventDispatcher
|  | hasEventListener(type:String):Boolean Checks whether the EventDispatcher object has any listeners registered for a specific type of event. | EventDispatcher
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void Removes a listener from the EventDispatcher object. | EventDispatcher
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | subscribe(options:RemoteNotifierSubscribeOptions = null):void Subscribes/registers the application to receive remote notifications from APNs. | RemoteNotifier
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | unsubscribe():void Unsubscribes the application from receiving remote notifications via APNs. | RemoteNotifier
|  | valueOf():Object Returns the primitive value of the specified object. | Object
|  | willTrigger(type:String):Boolean Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type. | EventDispatcher

Events
Click for more information on events
Hide Inherited Events
Show Inherited Events

| Event | Summary | Defined By
--- | --- | --- | ---
|  | activate | [broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active. | EventDispatcher
|  | deactivate | [broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive. | EventDispatcher
|  | notification | Dispatched in response to a new notification received by the application. | RemoteNotifier
|  | status | Dispatched if an error is encountered during the subscription process. | RemoteNotifier
|  | token | Dispatched when a notification token is available from the iOS upon successful subscription for remote notifications. | RemoteNotifier

Property Detail

### supportedNotificationStyles

property

`supportedNotificationStyles:Vector.<String>` [read-only]

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 3.4

A vector list of all supported notification styles.

Implementation
`public static function get supportedNotificationStyles():Vector.<String>`

Related API Elements

flash.notifications.NotificationStyle
Constructor Detail

### RemoteNotifier

()
Constructor

`public function RemoteNotifier()`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 3.4

Creates a new RemoteNotifier object.

Method Detail

### subscribe

()
method

`public function subscribe(options:RemoteNotifierSubscribeOptions = null):void`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 3.4

Subscribes/registers the application to receive remote notifications from APNs.

- RemoteNotificationEvent (TOKEN) is fired once the token is available. This token is to be used by remote notification providers to send remote notifications to this application on the device via APNs.
- RemoteNotificationEvent (NOTIFICATION) is fired when platform OS communicates the notification to the application.
- StatusEvent (STATUS) is fired when an error occurs while subscribing for remote notifications.

Parameters

| `options:RemoteNotifierSubscribeOptions` (default = `null`)`` — options required for the subscription process on some platforms.

### unsubscribe

()
method

`public function unsubscribe():void`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 3.4

Unsubscribes the application from receiving remote notifications via APNs.

Event Detail

### notification

Event

Event Object Type: `flash.events.RemoteNotificationEvent`
property RemoteNotificationEvent.type = `flash.events.RemoteNotificationEvent`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 3.4

Dispatched in response to a new notification received by the application.

For iOS, this event is fired in the following scenarios:

- The application was in the foreground when a new notification was received.
- As display of a notification popup, the user taps the action button of the alert or taps (or clicks) the application icon. In this case, no information about the notification payload is available.

### status

Event

Event Object Type: `flash.events.StatusEvent`
property StatusEvent.type = `flash.events.StatusEvent`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 3.4

Dispatched if an error is encountered during the subscription process.

### token

Event

Event Object Type: `flash.events.RemoteNotificationEvent`
property RemoteNotificationEvent.type = `flash.events.RemoteNotificationEvent`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 3.4

Dispatched when a notification token is available from the iOS upon successful subscription for remote notifications.

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00