Open JaneDawson opened 6 years ago
Seems like removing and readding cordova-plugin-firebase-analytics
is doing the trick... I'll reopen, if this was not the case.
Unfortunately, I was too quick in closing this issue. Now it's not working again :-( Registration works fine, but notifications are not received on iOS...
@macdonst and everybody else: Do you have an idea what this is about?
@JaneDawson thanks for the detailed issues, it will really help when I get a chance to sit down and take a look at it. I'm assuming that the cordova-plugin-firebase-analytics
plugin also registers something with FCM that directs all messages to it. Can you confirm the git repo for the plugin? Is it:
https://github.com/chemerisuk/cordova-plugin-firebase-analytics
Hi @macdonst, yes, exactly, that's it. Thank you for looking into this! I'm really looking forward to hearing your opinion on this.
@JaneDawson it may not be super quick as we are rolling into the holiday shutdown and my family has already descended upon my house like a pack of ravenous wolves.
@macdonst: That sounds like a lovely Christmas Party! :D I was actually planning on releasing the app before Christmas. Then, in the final tests this problem with pushs and analytics showed up and here I am now. Struggling to find a solution to be able to somehow keep the schedule. If you, however, find time before holiday shutdown to take a look at it, I highly appreciate it. But of course, I totally understand that you are busy with many other things, as well and that family comes first!
@macdonst: I hope you had a good start in 2018! ;-) Did you already have the chance to look into this? Thank you!
@macdonst: Don't want to annoy you. However, in case it may help to find the source of the problem, one observation I made:
When I initiate the two plugins (cordova-plugin-firebase-analytics
) and yours, the phonegap-plugin-push
, on different pages, analytics AND push notifications seem to work in most cases (unfortunately, still not in all cases).
In my case (Ionic3 app), push notifications didn't work at all, when I inititated both push and analytics in app.components.ts
.
Then I tried to initiate firebase analytics in app.components.ts
and push in home.ts
. This leads me to working pushs and analytics in approx. 80%-90 % of the cases... After a reinstallation of the app it may even work with some of the other 10%-20%.
Obviously, this is much better, but still not good enough. I really hope, you'll find the time to look into this. I really appreciate the work you are doing here. Thank you and best regards.
I have the same error logs in Xcode, but I'm not using any Firebase plugin (I use the APNS). So in my case this is not a conflict with another plugin, I guess. The App is not receiving notifications in background or foreground but Registration is successful. I'm using phonegap-plugin-push
v2.1.2 (installed through npm), cordova (Cordova CLI) : 8.0.0
, Cordova Platforms : ios 4.5.0
.
The notifications were and are working fine with the version 1.8.2 of the plugin.
2018-01-20 16:07:06.677158+0100 AppName[5631:2110747] Push Plugin register called 2018-01-20 16:07:06.677204+0100 AppName[5631:2110747] PushPlugin.register: setting badge to true Main Thread Checker: UI API called on a background thread: -[UIApplication setApplicationIconBadgeNumber:] PID: 5631, TID: 2110747, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 21 Backtrace: 4 AppName 0x0000000100983de4 19-[PushPlugin init:]_block_invoke + 1328 5 libdispatch.dylib 0x0000000100ded2cc _dispatch_call_block_and_release + 24 6 libdispatch.dylib 0x0000000100ded28c _dispatch_client_callout + 16 7 libdispatch.dylib 0x0000000100df93dc _dispatch_queue_override_invoke + 984 8 libdispatch.dylib 0x0000000100dfe9d0 _dispatch_root_queue_drain + 624 9 libdispatch.dylib 0x0000000100dfe6f4 _dispatch_worker_thread3 + 136 10 libsystem_pthread.dylib 0x000000018347306c _pthread_wqthread + 1268 11 libsystem_pthread.dylib 0x0000000183472b6c start_wqthread + 4 2018-01-20 16:07:06.678022+0100 AppName[5631:2110747] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication setApplicationIconBadgeNumber:] PID: 5631, TID: 2110747, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 21 Backtrace: 4 AppName 0x0000000100983de4 19-[PushPlugin init:]_block_invoke + 1328 5 libdispatch.dylib 0x0000000100ded2cc _dispatch_call_block_and_release + 24 6 libdispatch.dylib 0x0000000100ded28c _dispatch_client_callout + 16 7 libdispatch.dylib 0x0000000100df93dc _dispatch_queue_override_invoke + 984 8 libdispatch.dylib 0x0000000100dfe9d0 _dispatch_root_queue_drain + 624 9 libdispatch.dylib 0x0000000100dfe6f4 _dispatch_worker_thread3 + 136 10 libsystem_pthread.dylib 0x000000018347306c _pthread_wqthread + 1268 11 libsystem_pthread.dylib 0x0000000183472b6c start_wqthread + 4 2018-01-20 16:07:06.735207+0100 AppName[5631:2110747] PushPlugin.register: clear badge is set to 1 2018-01-20 16:07:06.735305+0100 AppName[5631:2110747] PushPlugin.register: better button setup 2018-01-20 16:07:06.735475+0100 AppName[5631:2110747] Using APNS Notification 2018-01-20 16:07:06.744216+0100 AppName[5631:2110629] Push Plugin register success: <xxxxxxxx 8b52427a xxxxxxxx e09d884d xxxxxxxx 6c5e2342 xxxxxxxx c1b2ad83>
I have read other similar issues related to this Warning, like #1988 but the problem is not solved (unlike it's said for the plugin version 2.1.0).
Latest version of Cocoapods is installed, but the build from the file .xcodeproj
always fails. Not sure if using the workspace is the right way. Thank you @macdonst
I think the reason is that firebase analytics plugin uses GoogleService-Info.plist
and as soon as this push plugin sees this file it assumes that you want to use FCM instead of APNS ?
@Yuripetusko we think the same
@Yuripetusko i find a way to use apns having GoogleService-Info.plist. You have to change the value of the key IS_GCM_ENABLED to false
@javitoxhz Thank you! I actually found it out also, but forgot to post it here :) 👍
@Yuripetusko @javitoxhz setting IS_GCM_ENABLED to false is not solving my issue. Is there anything else which also need to be done in order to use both firebase analytics & APNS through push plugin?
@hariomtechnologies4u Check if the token that you get has no a colon mark (:), if the token has it, it's mean is a firebase token, and maybe you have to re-build the app after update the settings in the .plist file. If the token has no colon mark, maybe the problem is in your notification server. BTW, I solved the problem just changing the value IS_GCM_ENABLED.
@javitoxhz IS_GCM_ENABLED never worked for me even after re-build. So, I had changed file path of Googleservices-info.plist in pushplugin.m file so that push plugin never get googleservices-info.plist file of firebase and both APNS & firebase work simultaneously.
I had recently this issue. The only solution worked for me is this:
1) Remove both plugins, remove platform ios
2) cordova plugin add phonegap-plugin-push@2.1.3 --save
3) Clone the cordova-plugin-firebase-analytics repo, modify plugin.xml and set firebase/core podspec to 4.0.0
4) cordova plugin add {forked-repo-url}.git
5) pod install
(in ios folder)
Now both works normally.
@ardabeyazoglu Trying to follow this but there isn't a podspec for firebase-messaging in the analytics plugin.xml?
@crawft it must be core not messaging, sorry.
cordova-plugin-firebase-analytics@0.12.0 seems working with phonegap-plugin-push@2.2.3. Will phonegap-plugin-push have a release to update FirebaseMessaging framework dependence ? framework src="FirebaseMessaging" type="podspec" spec="~> 2.0.0" seems little out of date.
Are you planning on actually fixing this issue in the near future????
If anyone manage to resolve this issue, please help to resolve below issues.
Versions
ionic version 4.6.0
"cordova": "9.0.0",
"cordova-android": "8.0.0",
"cordova-clipboard": "^1.3.0",
"cordova-ios": "5.1.1",
"cordova-plugin-firebase-analytics": "1.1.1",
"phonegap-plugin-push" : 2.3.0
On Android
`Failed to capture fingerprint of input files for task ':app:preDebugBuild' property` 'compileManifests' during up-to-date check.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[16.0.
0]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.
Dependency failing: com.google.firebase:firebase-messaging:17.0.0 -> com.google.firebase:firebase-iid@[16.0.0], but fire
base-iid version was 17.1.2.
The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
ifact with the issue.
-- Project 'app' depends onto com.google.firebase:firebase-iid@17.1.2
-- Project 'app' depends onto com.google.firebase:firebase-analytics@16.5.0
-- Project 'app' depends onto com.google.firebase:firebase-messaging@17.0.+
-- Project 'app' depends onto com.google.android.gms:play-services-measurement-api@16.5.0
-- Project 'app' depends onto com.google.firebase:firebase-core@16.0.+
-- Project 'app' depends onto com.google.firebase:firebase-core@16.0.9
-- Project 'app' depends onto com.google.firebase:firebase-messaging@17.0.0
on IOS
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "FirebaseAnalytics":
In snapshot (Podfile.lock):
FirebaseAnalytics (= 5.8.1)
In Podfile:
Firebase/Core (~> 5.6) was resolved to 5.20.2, which depends on
FirebaseAnalytics (= 5.8.1)
FirebaseMessaging (~> 2.0.0) was resolved to 2.0.8, which depends on
FirebaseAnalytics (~> 4.0)
I had recently this issue. The only solution worked for me is this:
- Remove both plugins, remove platform ios
cordova plugin add phonegap-plugin-push@2.1.3 --save
- Clone the cordova-plugin-firebase-analytics repo, modify plugin.xml and set firebase/core podspec to 4.0.0
cordova plugin add {forked-repo-url}.git
pod install
(in ios folder)Now both works normally.
I am having these same plugin incompatibility problems. The steps above allowed me to add both the analytics and push plugins on iOS, but I still get a build error in Xcode: "Module 'FirebaseInstanceID' not found". I have already done the manual pod install, i.e.
cd platforms/ios
pod install
which runs successfully, but still the "Module 'FirebaseInstanceID' not found" error persists. I have done a pod repo update
, and a build clean in Xcode.
Where do I go from here?
Expected Behaviour
Use the two plugins (
phonegap-plugin-push
andcordova-plugin-firebase-analytics
) in parallel && be able to receive Push Notifications on iOS.Actual Behaviour
Hi @macdonst, when I use both
phonegap-plugin-push
andcordova-plugin-firebase-analytics
in my app, I'm not able to receive any Push Notifications on iOS. Android works fine. I was looking for the mistake for three days now (see: https://github.com/phonegap/phonegap-plugin-push/issues/2110) and was wondering why it wasn't working anymore.I'm using Ionic 3. In my
app.components.ts
file I was usingcordova-plugin-firebase-analytics
to enable and disable the tracking with Firebase Analytics andphonegap-plugin-push
to manage Push Notifications. In this scenario, on iOS the push registration works just fine, but no notification is ever received (see: https://github.com/phonegap/phonegap-plugin-push/issues/2110).Now I commented out everything in
app.components.ts
that belongs tocordova-plugin-firebase-analytics
. I did not uninstall the plugin, just comment out everything in this single file, where my Push Notification logic is. Now iOS is receiving the push notifications as expected.Hence, it must be about the plugin. I did read the documentation part about the co-existence with Firebase Analytic plugins (Link: https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/INSTALLATION.md#co-existing-with-plugins-that-use-firebase). However, this seems to be outdated, since it is about the sender ID which changed since 2.0.0 of
phonegap-plugin-push
, right? Additionally, I don't get any error logs likeInvalid google_app_id. Firebase Analytics disabled.
I'm quite happy, that I now at least know, where to look at. That's one step forward. However, I don't know how to proceed and what to try next. I'm really desperate for your ideas on what we can try! I hope we can manage to make the two plugins work together, smoothly.
THANK YOU for your help!
Steps to Reproduce
see above
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
iPad, iOS 11.2.1
Cordova CLI version and cordova platform version
Plugin version
Sample Push Data Payload
The same payload worked with the old version of this plugin. For testing purposes I commented out most parts, but it still doesn't work
Initializing PushNotifications:
Logs taken while reproducing problem
FCM Registration and Firebase Analytics initialization both seem to work just fine (as you'll see in the following logs), however
push.on("notification", data => { ... })
is never called, when using both plugins at the same time.