用于 Adobe® Flash® Platform 的 ActionScript® 3.0 参考
主页  |  隐藏包列表和类列表 |   |   |  新增内容  |  索引  |  附录  |  为什么显示为英语?
过滤条件: 正在从服务器检索数据...
正在从服务器检索数据...
flash.notifications 

RemoteNotifier  - AS3

flash.notifications
public class RemoteNotifier
继承RemoteNotifier Inheritance EventDispatcher Inheritance Object

语言版本: ActionScript 3.0
运行时版本: AIR 3.4

RemoteNotifier 类允许您订阅和取消订阅推送通知。

此类包括了用于查询目标平台上支持哪些 RemoteNotificationStyles 的方法。它调度 RemoteNotificationEvent 和 StatusEvent。

相关 API 元素



公共属性
 属性由以下参数定义
 Inheritedconstructor : Object
对类对象或给定对象实例的构造函数的引用。
Object
      supportedNotificationStyles : Vector.<String>
[静态] [只读] 包含所有受支持的通知样式的矢量列表。
RemoteNotifier
公共方法
 方法由以下参数定义
  
    RemoteNotifier()
创建一个新的 RemoteNotifier 对象。
RemoteNotifier
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
使用 EventDispatcher 对象注册事件侦听器对象,以使侦听器能够接收事件通知。
EventDispatcher
 Inherited
将事件调度到事件流中。
EventDispatcher
 Inherited
检查 EventDispatcher 对象是否为特定事件类型注册了任何侦听器。
EventDispatcher
 Inherited
表示对象是否已经定义了指定的属性。
Object
 Inherited
表示 Object 类的实例是否在指定为参数的对象的原型链中。
Object
 Inherited
表示指定的属性是否存在、是否可枚举。
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
从 EventDispatcher 对象中删除侦听器。
EventDispatcher
 Inherited
设置循环操作动态属性的可用性。
Object
  
订阅/注册应用程序以从 APN 接收远程通知。
RemoteNotifier
 Inherited
返回此对象的字符串表示形式,其格式设置遵守区域设置特定的约定。
Object
 Inherited
返回指定对象的字符串表示形式。
Object
  
    unsubscribe():void
让应用程序取消订阅,不再通过 APN 接收远程通知。
RemoteNotifier
 Inherited
返回指定对象的原始值。
Object
 Inherited
检查是否用此 EventDispatcher 对象或其任何祖代为指定事件类型注册了事件侦听器。
EventDispatcher
事件
 事件 摘要 由以下参数定义
 Inherited[广播事件] Flash Player 或 AIR 应用程序获得操作系统焦点并变为活动状态时将调度此事件。EventDispatcher
 Inherited[广播事件] Flash Player 或 AIR 应用程序失去操作系统焦点并变为非活动状态时将调度此事件。EventDispatcher
  
    notification
在响应应用程序收到的新通知时将调度此事件。RemoteNotifier
  
    status
如果在订阅过程中遇到了错误,则会调度此事件。RemoteNotifier
  
    token
当成功订阅了远程通知后 iOS 上有通知标记时,将调度此事件。RemoteNotifier
属性详细信息
    

supportedNotificationStyles

属性
supportedNotificationStyles:Vector.<String>  [只读]

语言版本: ActionScript 3.0
运行时版本: AIR 3.4

包含所有受支持的通知样式的矢量列表。



实现
    public static function get supportedNotificationStyles():Vector.<String>

相关 API 元素

构造函数详细信息
    

RemoteNotifier

()构造函数
public function RemoteNotifier()

语言版本: ActionScript 3.0
运行时版本: AIR 3.4

创建一个新的 RemoteNotifier 对象。

方法详细信息

    subscribe

()方法
public function subscribe(options:RemoteNotifierSubscribeOptions = null):void

语言版本: ActionScript 3.0
运行时版本: AIR 3.4

订阅/注册应用程序以从 APN 接收远程通知。

  • RemoteNotificationEvent (TOKEN) 在标记可用时会立即引发。此标记将由远程通知提供程序用来通过 APN 向设备上的此应用程序发送远程通知。
  • RemoteNotificationEvent (NOTIFICATION) 在平台 OS 将通知传达给应用程序时引发。
  • StatusEvent (STATUS) 将在订阅远程通知过程中出现错误时引发。

参数

options:RemoteNotifierSubscribeOptions (default = null) — 在某些平台上,订阅过程所必需的选项。

    unsubscribe

()方法 
public function unsubscribe():void

语言版本: ActionScript 3.0
运行时版本: AIR 3.4

让应用程序取消订阅,不再通过 APN 接收远程通知。

事件详细信息
    

notification

事件
事件对象类型: flash.events.RemoteNotificationEvent
属性 RemoteNotificationEvent.type = flash.events.RemoteNotificationEvent

语言版本: ActionScript 3.0
运行时版本: AIR 3.4

在响应应用程序收到的新通知时将调度此事件。

对于 iOS,在以下情况下会触发此事件:

  • 当收到新通知时,应用程序位于前台。
  • 当显示了通知弹出窗口时,用户点击了警告的操作按钮或点击(单击)了应用程序图标。在此示例中,未提供有关通知有效负载的任何信息。

    

status

事件  
事件对象类型: flash.events.StatusEvent
属性 StatusEvent.type = flash.events.StatusEvent

语言版本: ActionScript 3.0
运行时版本: AIR 3.4

如果在订阅过程中遇到了错误,则会调度此事件。

    

token

事件  
事件对象类型: flash.events.RemoteNotificationEvent
属性 RemoteNotificationEvent.type = flash.events.RemoteNotificationEvent

语言版本: ActionScript 3.0
运行时版本: AIR 3.4

当成功订阅了远程通知后 iOS 上有通知标记时,将调度此事件。





[ X ]为什么显示为英语?
《ActionScript 3.0 参考》中的内容以英语显示

《ActionScript 3.0 参考》中的部分内容未翻译成所有语言。当某个语言元素未翻译时,将显示为英语。例如,ga.controls.HelpBox 类未翻译成任何语言。因此在简体中文版的参考中,ga.controls.HelpBox 类显示为英语。