-
Notifications
You must be signed in to change notification settings - Fork 445
Conversation
works well for background & killed
Fix FCM issue
Was this a known issue for background notifications not working on iOS? I've been having issues getting them to display, but no issues when app is in the foreground. |
Hi @spstratis |
Thanks for the response @KingAndroid. Your merge request here is to fix the issue on iOS I'm assuming? |
Yes, I've resolve two project issue with this PR |
I cannot receive any notification in iOS. Android works fine.
On Mon 12 Jun, 2017, 11:06 AM KingAndroid, ***@***.***> wrote:
Yes, I've resolve two project issue with this PR
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#387 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABuiLxPTQUM_pQf3-AECbjRJ83KaQGQwks5sDM5pgaJpZM4N2FEo>
.
--
Tushar Deo
http://tusharvikky.github.io/
|
Has anyone besides @KingAndroid tested this potential fix? |
@KingAndroid The only reason why your fix would help is if you've set If so, remove it and retest your app. If not then something else is preventing Firebase from automatically swizzling your appdelegate, most likely because of the order of requiring the plugin and calling |
Test case
Thank you, |
@KingAndroid, @EddyVerbruggen, I am using 4.0.3 of the plugin and have a working Android implementation. I have working foreground messages in iOS but no background notifications or foreground messages once the app has been killed. I have tried version 3.12.0 and have tried initializing the plugin in my app.ts and the first main page. I have tried adding @KingAndroid's fix into the firebase.ios.js file...
I still have no background or killed notifications. |
@tonyhogben Care to share your repo so I can reproduce? |
Thanks! Any special commands I need to run, or in-app buttons I need press to reproduce it? |
That version initializes the plugin in the app.ts. Selecting a school runs subscribeToTopic but this does not appear to work in iOS or Android. You must select a school to progress, you can skip the allergens on the next screen. Once on the main (menu) page you can use the cog to return to the schools list (which has the push token at the top if you need it). Is that enough to get you going? |
Hi @EddyVerbruggen, did you have any joy with this? |
Not yet |
Hey @EddyVerbruggen, sorry to chase you up, but do you have an opinion on the nature of the problem yet? I am being pressured into releasing the app and need to at least know what direction I am going to take where notifications are concerned. |
Having the same issue of not having the "onMessageReceived" callback fire on iOS when the app is in the background and opened from the notification. Rolling back to 3.12.0 fixed things. Performing an upgrade to 4.+ and the issue reappeared. Just my $0.02 |
@tonyhogben I'm on vacation so things are s-l-ooooo-w atm, sorry for that. I just fixed another issue I'd like to release 4.0.5 for tomorrow and I want to investigate your issue before releasing that. So I will be looking at your repo tomorrow (I already cloned it before going camping so the poor wifi doesn't hamper my tests). I'll keep u posted! 🏕 |
Thanks @InvSqr, I've not been able to get that working though :( @EddyVerbruggen, awesome, thank you. Fingers crossed you find the issue! |
Hey @tonyhogben I'm testing your app and can't get a notification show up in the notification center. That never happened to me before and luckily I found the cause: my dev push cert was expired: I'll fix that later today and try again. |
Good catch. I've been using the new 'key' approach rather than a certificate (though I did test using a cert in case it had an effect). I've never managed to get anything to show up in the iOS notification center and subscribeToTopic does not appear to work in iOS or Android either. |
AFAIK uploading the APNs cert is required regardless. I will update you if renewing the cert has an effect for me. |
I don't know if you have noticed (I'm sure you've had no reason to even look), but the Google documentation that your plugin documentation links to has changed and now guides you though setting up an APN key rather than a certificate. I believe they are taking advantage of a change at Apple that makes it much easier than the certificate approach (no keychain required) and keys don't expire! ;) |
Ah, that's useful info, thanks. It's not related to this problem (since sending notifications wasn't the problem anyway - it's showing them in notification center). I haven't got a clue yet. Will look again tomorrow. |
I seem to have found the issue. Not that it makes sense. The call to @tonyhogben You can install plugin version 4.0.5 (I'll push it to npm in the next hour or so). But please also change a bit of your code. This bit needs to change in app.on("launch", () => {
if (app.android) {
initialize();
}
// Initialize firebase (Notifications)
firebase.init({
onPushTokenReceivedCallback: token => {
console.log("Firebase push token: " + token);
},
onMessageReceivedCallback: message => {
console.dir(message);
alert("body: " + message.body);
}
}).then(
(instance) => {
console.log("firebase.init done");
},
(error) => {
console.log("firebase.init error: " + error);
}
);
}); |
@EddyVerbruggen, thank you. Just a quick confirmation that this is indeed all working. One caveat though, it only works with an Apple APNs certificate and does not work with an APNs key. This is important as currently the plugin's Cloud Messaging documentation tells you to follow Google documentation that no longer covers creating a certificate, but instead guides you through creating a key. Thanks again, great work Eddy. Edit: Ignore the caveat, Key's work fine |
Yes, it worked for me too. But as for Android, notifications for it broke when I updated to 4.0.5. I never receive anything now from |
Sigh. @Marcisbee you appear to be correct. Using the firebase console I can successfully send a message targeting all Android devices using the app, but I cannot send any topic based notifications. @EddyVerbruggen, any ideas? |
I actually used a key myself now instead of the cert. And since that's serverside it doesn't matter for this plugin anyway. I didn't change Android stuff in the latest version. Which older Android version (as close to the current one) does work for you? |
@EddyVerbruggen, it appears to be linked to the code change you made in my project regarding the point at which firebase is initialised. When I attempted to subscribe to a topic on Android, I encountered an error...
Based on this I re-wrote my app.ts code as follows...
This works, though I am not entirely sure this is the cleanest approach, any suggestions? |
fix firebase notification issue when background & killed