ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
flash.notifications 

RemoteNotifier  - AS3

Packageflash.notifications
Classpublic class RemoteNotifier
InheritanceRemoteNotifier Inheritance EventDispatcher Inheritance 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



Public Properties
 PropertyDefined By
 Inheritedconstructor : 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
 MethodDefined By
  
    RemoteNotifier()
Creates a new RemoteNotifier object.
RemoteNotifier
 Inherited
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
 Inherited
Dispatches an event into the event flow.
EventDispatcher
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
  
Subscribes/registers the application to receive remote notifications from APNs.
RemoteNotifier
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
  
    unsubscribe():void
Unsubscribes the application from receiving remote notifications via APNs.
RemoteNotifier
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Events
 Event Summary Defined By
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.EventDispatcher
 Inherited[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

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.