_Notification

移动平台推送消息 全部展开

静态属性展开

  • + RepeatPerDay : uint

    重复通知的类型,按日重复通知,值是4。

    示例

        print(_Notification.RepeatPerDay)
  • + RepeatPerHour : uint

    重复通知的类型,按小时重复通知,值是5。

    示例

        print(_Notification.RepeatPerHour)
  • + RepeatPerMinute : uint

    重复通知的类型,按分钟重复通知,值是6。

    示例

        print(_Notification.RepeatPerMinute)
  • + RepeatPerMonth : uint

    重复通知的类型,按月重复通知,值是3。

    示例

        print(_Notification.RepeatPerMonth)
  • + RepeatPerYear : uint

    重复通知的类型,按年重复通知,值是2。

    示例

        print(_Notification.RepeatPerYear)

单例展开

  • + _notify : _Notification

    程序开始时自动创建。脚本中应该使用此对象。

公共方法展开

  • + function cancel(id: uint) : void

    取消单个本地通知。

    • 参数
    • id:本地通知的唯一标识。

    • 示例

       _notify:cancel( 1 )
  • + function cancelAll( ) : void

    取消所有本地通知。

    • 示例

       _notify:cancelAll( )
  • + function notify(id: uint, date : string, title : string, content : string, number : uint) : void

    注册本地通知。

    • 参数
    • id:通知的唯一标识。
    • date :通知的时间。
    • title :通知内容的标题。
    • content :通知内容。
    • number :通知之后应用程序右上角的角标。

    • 示例

       local datestr = str.year .. '-' .. str.month .. '-' .. str.day .. '-' .. str.hour .. '-' .. ( str.minute + 1 ) .. '-' .. str.second
      _notify:notify( 1, datestr, "Notify", 'Test notify', 1 )
  • + function remoteNotify(account: string, appid : uint, appkey : string) : void

    注册服务器通知。

    • 参数
    • account:接收服务器通知的帐号。
    • appid :应用程序的id。
    • appkey :应用程序的key。

    • 示例

       _notify:remoteNotify( '12345123', 2100127773, "A5T82B5HNR2M" )
  • + function repeatNotify(id: uint, date : string, title : string, content : string, type : uint) : void

    注册本地重复通知。

    • 参数
    • id:通知的唯一标识。
    • date :通知的时间。
    • title :通知内容的标题。
    • content :通知内容。
    • type :重复通知的类型,具体参数详见文档的静态属性。

    • 示例

       local datestr = str.year .. '-' .. str.month .. '-' .. str.day .. '-' .. str.hour .. '-' .. ( str.minute + 1 ) .. '-' .. str.second
      _notify:repeatNotify( 1, datestr, "Notify", 'Test notify', _Notification.RepeatPerMinute )
问题反馈(登录才可以发表哦!)