代码改变世界

Html5+离线打包创建本地消息

2017-11-13 08:22  slmk  阅读(1004)  评论(0编辑  收藏  举报

自己离线打包Html5+ Runtime,通常是导入SDK的Hello实例,然后修改。在做消息通知功能时,使用push.createMessage不起作用。

首先参考Android平台离线打包推送插件配置

需要特别注意的是AndroidManifest的配置,需要将包名替换成自己的包名

<receiver android:exported="true" android:name="io.dcloud.feature.apsXm.XMNotificationReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="%填写APK的包名%.__CREATE_NOTIFICATION"/>
<action android:name="%填写APK的包名%.__REMOVE_NOTIFICATION"/>
<action android:name="%填写APK的包名%.__CLEAR_NOTIFICATION"/>
<action android:name="%填写APK的包名%.__CLILK_NOTIFICATION"/>
</intent-filter>
</receiver>