JPush class

Constructors

JPush()
factory
JPush.private(MethodChannel channel)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addEventHandler({EventHandler? onReceiveNotification, EventHandler? onOpenNotification, EventHandler? onReceiveMessage, EventHandler? onReceiveNotificationAuthorization, EventHandler? onNotifyMessageUnShow, EventHandler? onConnected, EventHandler? onInAppMessageClick, EventHandler? onInAppMessageShow}) → void
初始化 JPush 必须先初始化才能执行其他操作(比如接收事件传递)
addTags(List<String> tags) Future<Map>
在原有 tags 的基础上添加 tags
applyPushAuthority([NotificationSettingsIOS iosSettings = const NotificationSettingsIOS()]) → void
iOS Only 申请推送权限,注意这个方法只会向用户弹出一次推送权限请求(如果用户不同意,之后只能用户到设置页面里面勾选相应权限),需要开发者选择合适的时机调用。
cleanTags() Future<Map>
清空所有 tags。
clearAllNotifications() Future
清空通知栏上的所有通知。
clearLocalNotifications() Future
clearNotification({int notificationId = 0}) → void
清空通知栏上某个通知 @param notificationId 通知 id,即:LocalNotification id
deleteAlias() Future<Map>
删除原有 alias
deleteTags(List<String> tags) Future<Map>
删除指定的 tags
enableAutoWakeup({bool enable = false}) → void
getAlias() Future<Map>
获取所有当前绑定的 alias
getAllTags() Future<Map>
获取所有当前绑定的 tags
getLaunchAppNotification() Future<Map>
iOS Only 点击推送启动应用的时候原生会将该 notification 缓存起来,该方法用于获取缓存 notification 注意:notification 可能是 remoteNotification 和 localNotification,两种推送字段不一样。 如果不是通过点击推送启动应用,比如点击应用 icon 直接启动应用,notification 会返回 @{}。 @param {Function} callback = (Object) => {}
getRegistrationID() Future<String>
获取 RegistrationId, JPush 可以通过制定 RegistrationId 来进行推送。
isNotificationEnabled() Future<bool>
调用此 API 检测通知授权状态是否打开
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openSettingsForNotification() → void
调用此 API 跳转至系统设置中应用设置界面
pageEnterTo(String pageName) → void
pageLeave(String pageName) → void
requestRequiredPermission() → void
resumePush() Future
恢复推送功能。
sendLocalNotification(LocalNotification notification) Future<String>
发送本地通知到调度器,指定时间出发该通知。 @param {Notification} notification
setAlias(String alias) Future<Map>
重置 alias.
setAuth({bool enable = true}) → void
setBadge(int badge) Future
设置应用 Badge(小红点)
setChannelAndSound({String channel = '', String channelID = '', String sound = ''}) → void
setLbsEnable({bool enable = true}) → void
setTags(List<String> tags) Future<Map>
设置 Tag (会覆盖之前设置的 tags)
setUnShowAtTheForeground({bool unShow = false}) → void
setup({String appKey = '', bool production = false, String channel = '', bool debug = false}) → void
setWakeEnable({bool enable = false}) → void
stopPush() Future
停止接收推送,调用该方法后应用将不再受到推送,如果想要重新收到推送可以调用 resumePush。
testCountryCode(String code) → void
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

flutter_log → const String