1.去https://github.com/jpush/jpush-phonegap-plugin下载最新版的cordova插件
2.修改文件夹的名字为插件的id即:cn.jpush.phonegap.JPushPlugin
3.将原来插件中的plugin-ex.xml文件拷贝到新版的插件中去
4.修改新版插件的plugin.xml文件,①首先在xml中找到<preference name=”API_KEY” />这句话,把它删除,因为我们配置参数的机制稍有不同,
②然后修改参数的名字:在iOS平台的配置下找到
<config-file target=”*PushConfig.plist” parent=”APP_KEY”>
<string>$API_KEY</string>
</config-file>
然后将其修改为
<config-file target=”*PushConfig.plist” parent=”APP_KEY”>
<string>$jpush_appkey</string>
</config-file>
在Android平台的配置中找到:
<meta-data android:name=”JPUSH_APPKEY” android:value=”$API_KEY”/>
将$API_KEY改为:<meta-data android:name=”JPUSH_APPKEY” android:value=”$jpush_appkey”/>
③然后找到:
<js-module src=”www/JPushPlugin.js” name=”JPushPlugin”>
<clobbers target=”jPushPlugin”/>
</js-module>
把它修改为:
<js-module src=”www/JPushPlugin.js” name=”JPushPlugin”>
<clobbers target=”window.plugins.jPushPlugin”/>
</js-module>
这样就可以了!