XgAndroidApi class
Methods
-
addNativeEventHandler(NativeEventHandler eventHandler)
→ void
-
在调native函数前需要调用改函数
-
addXgTags({required List tagNames})
→ void
-
添加多个标签 tagNames为List
-
appendAccount({required String account})
→ void
-
添加账号
推荐有账号体系的App使用(此接口保留之前的账号,只做增加操作,
一个token下最多只能有10个账号超过限制会自动顶掉之前绑定的账号,)
-
appendAccountWithType({required String account, required String accountType})
→ void
-
-
bindAccount({required String account})
→ void
-
绑定账号
推荐有账号体系的App使用(此接口会覆盖设备之前绑定过的账号,仅当前注册的账号生效)
-
bindAccountWithType({required String account, required String accountType})
→ void
-
-
cancelAllNotification()
→ void
-
清空当前应用在通知栏的通知
-
cleanXgTags()
→ void
-
清除所有标签
-
createNotificationChannel({String? channelId, String? channelName})
→ void
-
创建通知渠道
-
createNotificationChannelWithSound({String? channelId, String? channelName, bool? enableVibration, bool? enableLights, bool? enableSound, String? soundFileName})
→ void
-
创建通知渠道,指定通知提示各项属性
-
delAccount({required String account})
→ void
-
删除注册账号
账号解绑只是解除 Token 与 App 账号的关联,若使用全量/标签/Token 推送仍然能收到通知/消息。
-
delAccountWithType({required String account, required String accountType})
→ void
-
-
delAllAccount()
→ void
-
清除全部账号
-
deleteXgTag({required String tagName})
→ void
-
删除指定标签
-
deleteXgTags({required List tagNames})
→ void
-
删除多个标签
Set 标签名集合,每个标签是一个 String。限制:每个 tag 不能超过40字节(超过会抛弃),
不能包含空格(含有空格会删除空格)。最多设置1000个tag,超过部分会抛弃。
-
enableOppoNotification({required bool isNotification})
→ void
-
开启Oppo通知
isNotification 是否开启OPPO通知
-
enableOtherPush()
→ void
-
开启其他推送
-
enableOtherPush2({required bool enable})
→ void
-
开启其他推送
-
getOtherPushToken()
→ Future<String>
-
获取厂商推送 token
-
getOtherPushType()
→ Future<String>
-
获取厂商推送品牌
-
getXgToken()
→ Future<String>
-
获取token
第一次注册会产生 Token,之后一直存在手机上,不管以后注销注册操作,该 Token 一直存在,
当 App 完全卸载重装了 Token 会发生变化。不同 App 之间的 Token 不一样。
-
is360Rom()
→ Future<bool>
-
判断是否为360手机
-
isEmuiRom()
→ Future<bool>
-
判断是否为华为手机
-
isFcmRom()
→ Future<bool>
-
判断是否为谷歌手机
-
isMeizuRom()
→ Future<bool>
-
判断是否为魅族手机
-
isMiuiRom()
→ Future<bool>
-
判断是否为小米手机
-
isOppoRom()
→ Future<bool>
-
判断是否为OPPO手机
-
isVivoRom()
→ Future<bool>
-
判断是否为Vico手机
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
regPush()
→ void
-
注册信鸽推送
production
debug 是否为debug模式 默认不是
-
resetBadgeNum()
→ void
-
设置手机应用角标归0,建议在应用打开时将角标清0,
当前支持华为、OPPO、vivo,其中 OPPO 需另外向厂商申请角标展示权限
-
setBadgeNum({required int badgeNum})
→ void
-
接设置应用角标,
当前支持华为、OPPO、vivo,其中 OPPO 需另外向厂商申请角标展示权限
-
setEnableDebug({required bool debug})
→ void
-
开启debug模式
debug 是否为debug模式 默认不是
-
setHeartbeatIntervalMs({required int interval})
→ void
-
设置心跳时间间隔
interval 心跳间隔
-
setMiPushAppId({required String appId})
→ void
-
设置小米推送的APP_ID
aappId为在小米平台注册所得Id
-
setMiPushAppKey({required String appKey})
→ void
-
设置小米推送的APP_KEY
appKey 为在小米平台注册所得key
-
setMzPushAppId({required String appId})
→ void
-
设置魅族推送所需appID
appId为在魅族平台注册所得Id
-
setMzPushAppKey({required String appKey})
→ void
-
设置魅族推送所需appKey
appKey为在魅族平台注册所得key
-
setOppoPushAppId({required String appId})
→ void
-
设置Oppo推送ID
appId为在Oppo平台注册所得Id
-
setOppoPushAppKey({required String appKey})
→ void
-
设置Oppo推送Key
appKey为在Oppo平台注册所得Key
-
setXgTag({required String tagName})
→ void
-
设置标签
-
setXgTags({required List tagNames})
→ void
-
设置多tag tagNames为List
-
startFcmPush()
→ void
-
开启谷歌手机厂商通道
-
startHuaWeiPush()
→ void
-
开启华为厂商通道
-
startMeizuPush({required String appId, required String appKey})
→ void
-
开启魅族手机厂商通道
appId为在魅族平台注册所得Id
appKey为在魅族平台注册所得key
-
startMiPush({required String appId, required String appKey})
→ void
-
开启小米厂商通道
appId 为在小米平台注册所得Id
appKey 为在小米平台注册所得key
-
startOPPOPush({required String appId, required String appKey, required bool isNotification})
→ void
-
开启oppo厂商通道
isNotification 是否开启OPPO通知
appId为在Oppo平台注册所得Id
appKey为在Oppo平台注册所得Key
-
startViVOPush()
→ void
-
开启ViVO厂商通道
-
stopXg()
→ void
-
反注册信鸽推送
当用户已退出或 App 被关闭,不再需要接收推送时,可以取消注册 App,即反注册。
(一旦设备反注册,直到这个设备重新注册成功期间内,下发的消息该设备都无法收到)
-
toString()
→ String
-
A string representation of this object.
inherited