I am trying to get push notifications working on my iOS application (using Sencha cmd and PhoneGap's packaging tools to build the app). Currently when I try to send my iPhone a message from the Firebase Console, I don't receive anything (neither the notification or any errors) despite the status of the message being sent according to Firebase.
I am using:
- Xcode 8.3.2
- Sencha cmd 6.5.1.240
- PhoneGap 7.0.0
So far I have:
- Installed the
cordova-plugin-firebase
plugin. - Installed CocoaPods.
- Created an App ID, APNs certificate, and a provisioning profile. The certificate is uploaded to my Firebase app, and the provisioning profile is set up in my Xcode project.
- Enabled Push Notification and Background Mode capabilities in Xcode.
- Added the generated GoogleService-Info.plist to my Xcode project
The error that is happening when trying to build (sencha app build
) is:
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[INF] [shellscript]
[INF] [shellscript]
[INF] [shellscript]
[INF] [shellscript] ** BUILD FAILED **
[INF] [shellscript]
[INF] [shellscript]
[INF] [shellscript] The following build commands failed:
[INF] [shellscript] Ld build/emulator/myApp.app/myApp normal x86_64
[INF] [shellscript] Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/iMac/Documents/MyApplication/app/myApp/phonegap/platforms/ios/cordova/build-debug.xcconfig,-workspace,myApp.xcworkspace,-scheme,myApp,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone SE,build,CONFIGURATION_BUILD_DIR=/Users/iMac/Documents/MyApplication/app/myApp/phonegap/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/iMac/Documents/MyApplication/app/myApp/phonegap/platforms/ios/build/sharedpch
[INF] [shellscript]
[INF] [shellscript]
I think the issue might be with my Podfile or the way it installs pods - if I remove all of the pods as well as use_frameworks!
the build finishes successfully and the app can be launched on an iPhone or and emulator in Xcode successfully too.
The Podfile looks like this:
platform :ios, '9.0'
target 'myApp' do
pod 'Firebase/Core'
pod 'Firebase/Messaging'
end
If I include use_frameworks!
the terminal returns the following when doing pod install
(the app will also fail to build with the same error as above):
[!] The myApp [Debug] target overrides the LD_RUNPATH_SEARCH_PATHS build setting defined in Pods/Target Support Files/Pods-myApp/Pods-myApp.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the $(inherited) flag, or
- Remove the build settings from the target.
[!] The myApp [Release] target overrides the LD_RUNPATH_SEARCH_PATHS build setting defined in Pods/Target Support Files/Pods-myApp/Pods-myApp.release.xcconfig. This can lead to problems with the CocoaPods installation
- Use the $(inherited) flag, or
- Remove the build settings from the target.
In regards to the above error (when including use_frameworks!
in the Podfile): I've tried what was suggested here but if I'm not mistaken, I already have the $(inherited)
flag:
Screenshot of my current Other Linker Flags
I have also tried using the cordova-plugin-cocoapods-support
plugin to handle the pods but I experience the same errors as above when adding pods through the config.xml rather than manually in the Podfile.
Please let me know if there's any other info I can provide.
Thanks!