Cordova Push Plugin iOS 8

雨燕双飞 提交于 2019-12-10 21:32:38

问题


Likely the same problem as PhoneGap Push Plugin Does Not Register iOS 8 Device but I do have an error message.

I have checked the plugin version and I am getting the new version with the iOS mods.

2014-09-26 15:50:54.070 Score My Selfies[401:89341] CDVPlugin class PushPlugin (pluginName: PushPlugin) does not exist.
2014-09-26 15:50:54.071 Score My Selfies[401:89341] ERROR: Plugin 'PushPlugin' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2014-09-26 15:50:54.072 Score My Selfies[401:89341] -[CDVCommandQueue executePending] [Line 158] FAILED pluginJSON = [
  "PushPlugin599142626",
  "PushPlugin",
  "register",
  [
    {
      "alert" : "true",
      "ecb" : "onNotificationAPN",
      "sound" : "true",
      "badge" : "true" 
    }
  ]

I have also uninstalled and reinstalled the plugin several times.


回答1:


I managed to fix this by adding PushPlugin.m to the Build Phases->Compile Sources.

Not sure if this was a Cordova issue or a Netbeans issue.




回答2:


Check out the pull requests on github.

https://github.com/phonegap-build/PushPlugin/pulls

There are lots of iOS8 Fixes included. It doesn't look like they are merged into the phonegap-build repository yet.

iOS8 changed the way they register and handle push notifications so there are some code changes you will need to update to support iOS8.




回答3:


Faced the same issue, but I knew it had been working before. I already had trouble with plugins, so I am used to remove / re-add them... but it didn't work this time.

Using git I noticed that the platforms/ios/*.xcodeproj/project.pbxproj file is not correctly updated when I run the (sadly) usual : cordova plugin {remove,add} com.phonegap.plugins.PushPlugin

Parts are missing in PBXBuildFile section ! I guess it's a bug in cordova...

The solution

I worked it around by removing and re-adding the entire ios platform : cordova platform {remove,add} ios

This should do the trick.



来源:https://stackoverflow.com/questions/26091179/cordova-push-plugin-ios-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!