Firebase on Cordova doesn't trigger notificati

2019-08-06 04:00发布

I'm making an app for iOS ed Android with Cordova. I've installed this plugin: phonegap-plugin-push and works on Android. So about iOS, i've installed che certificates in the Firebase project into console. Infact when i try to run notifications for testing i see this:

enter image description here

17 app users associated are the testing I've done about the token communications. The certificate was create .p8 certificates from apple developer console, and i think is correct what I done, because we can see the devices registration on firebase console:

enter image description here

The project have also the pods:

Analyzing dependencies
Downloading dependencies
Using FirebaseAnalytics (4.2.0)
Using FirebaseCore (4.0.20)
Using FirebaseInstanceID (2.0.10)
Using FirebaseMessaging (2.0.8)
Using GoogleToolboxForMac (2.1.4)
Using Protobuf (3.6.1)
Using nanopb (0.3.901)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 7 total pods installed.

and on Xcode capabilities:

enter image description here enter image description here

So the questions is, why on iOS the notifications doesn't works ? Any suggestions? Why nothing triggering the devices ? I use Visual Studio Code, and the project is on Apache Cordova.

1条回答
霸刀☆藐视天下
2楼-- · 2019-08-06 04:52

Xcode version 8.0 or greater is required for building this plugin.

CocoaPods

Required cordova-cli minimum version: 6.4.0

Required cordova-ios minimum version: 4.3.0

Required CocoaPods minimum version: 1.0.1

To install CocoaPods, please follow the installation instructions here. After installing CocoaPods, please run:

pod setup

If you are installing this plugin using npm, and you are using version 6.1.0 or greater of the cordova-cli, it will automatically download the right version of this plugin for both your platform and cli.

If you are on a cordova-cli version less than 6.1.0, you will either have to upgrade your cordova-cli version, or install the plugin explicitly:

cordova plugin add phonegap-plugin-push@1.8.1

If you open the app in Xcode and you get an error like:

ld: library not found for -lPods-Appname clang: error: linker command failed with exit code 1

Then you are opening the .xcodeproj file when you should be opening the .xcworkspace file.

and with if u are in the latest version o xcode (10) u need to build this way if u use ionic 3

ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"

source to this answser --> here

查看更多
登录 后发表回答