插件集成访问https://ext.dcloud.net.cn/plu...点击购买加入项目。在uniapp的“manifest.json”中,选择“app原生插件配置”,点击勾选mob-push插件。完成以上两步后,请务必先打开自定义库,否则SDK代码将无法生效!iOS平台相关配置添加后台模式按照官网教程添加后台模式->远程通知APP信息配置在manifest.json文件中配置如下属性Android平台相关配置打开manifest。.requireNativePlugin('mob-push')函数接口提交用户隐私授权结果。为确保您的App集成MobSDK后满足工信部相关合规要求,您应确保App安装首次冷启动且用户已阅读您的授权《隐私政策》后即,调用MobSDK.submitPolicyGrantResult返回隐私协议授权结果。反之,如果用户不同意你的App《隐私政策》授权,你就不能调用MobSDK.submitPolicyGrantResult返回隐私协议授权结果。请参考链接合规指南/***返回用户的隐私授权结果*@paramisGranted用户是否同意隐私协议*/mobPushUniPlugin.submitPolicyGrantResult({"grant":true})打开调试日志/***设置打开调试日志*/mobPushUniPlugin.enableLog({"enableLog":true})setpushenvironment(iOSonly)/***setpushenvironment*@paramisPro=true*/mobPushUniPlugin.setAPNsForProduction({'isPro':true})configurepushConfiguration(iOSonly)/***设置推送配置(必须调用)*@paramtype=7*不显示0,角标提醒1,声音提醒2,弹框提醒4,全部7*/mobPushUniPlugin.setAPNsNotification({'type':7})/***设置应用在前台有三种类型:Badge,Sound,Alert。默认三个选项,iOS10后设置有效。*@paramtype=7*不显示0,角标提醒1,声音提醒2,弹出提醒4,全部7*/mobPushUniPlugin.setAPNsShowForegroundType({'type':7})GetRegistrationID/***GetRegistrationID*@param{Function}callback=(result)=>{"success":bool,"res":regID,"error":err}*/mobPushUniPlugin.getRegistrationID((result)=>{//todosomething})添加消息事件监听器/**消息事件监听器**@param{Function}调用back=(result)=>{"success":bool,"res":String,"error":err}**success:result,true表示操作成功**res:消息结构JSON字符串**/mobPushUniPlugin.addPushReceiver((result)=>{})清除事件监听器(仅限iOS)/***清除事件监听器*/mobPushUniPlugin.clearPushReceivers()标签推送/**添加新标签,标签之间用;**/mobPushUniPlugin.addTags({"tags":"yourtags"})/**删除所有标签***/mobPushUniPlugin.cleanAllTags()/**清除指定标签,标签之间用;隔开**/mobPushUniPlugin.deleteTags({"tags":"yourtags"})/**查询所有标签**/mobPushUniPlugin.getTags()aliaspush/**查询所有别名**/mobPushUniPlugin.getAlias()/**添加一个别名*@paramalias=String**/mobPushUniPlugin.setAlias({"alias":"youralias"})/**删除一个别名**/staticdeleteAlias(){MobPushModule.deleteAlias();}推送状态/***推送服务是否关闭*@param{Function}callback=(result)=>{"success":bool,"res":isStoped,"error":err}*/mobPushUniPlugin.isPushStopped((result)=>{//todosomething})/***关闭推送服务*/mobPushUniPlugin.stopPush()/***开启推送服务*/mobPushUniPlugin.restartPush()badgestatusAndroid:/***设置是否启用badge*/mobPushUniPlugin.setShowBadge({"showBadge":true})/***徽章是否关闭*@param{Function}callback=(result)=>{"success":bool,"res":isStopeed,"error":err}*/mobPushUniPlugin.getShowBadge((result)=>{//todosomething})iOS:/***设置徽章数量*@parambadge=10*/mobPushUniPlugin.setBadge({'badge':10})/***获取服务器徽章数量*/mobPushUniPlugin.getBadge((result)=>{//todosomething})/***清除角徽章,但不清除通知栏消息*/mobPushUniPlugin.clearBadge()注意事项合规指南:https://www.mob.com/wiki/deta...常见问题解答:https://www.mob.com/wiki/deta...
