Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Let iOS handle push notifications after the app was killed in the springboard #222

Merged
merged 2 commits into from
Nov 23, 2016

Conversation

PanayotCankov
Copy link
Contributor

And maybe fixes problems when the init() is called before application.start() and the iOS throws "cannot call app.whatever" as the app is null.

@EddyVerbruggen
Copy link
Owner

Tested iOS push notifications while app is open, in the background, and killed. The notification is always shown and sent to the in-app handler 😀👍👍👍👍

@csaggo
Copy link

csaggo commented Nov 24, 2016

Can you share the code-snippets where firebase is configured, and how exactly the notification json to firebase looks. i updated to 3.8.4 but it still on ios works for me in only in foreground and first app start.
when app is killed first time it just wont receive any massages again neither while killed nor when running again :(

@PanayotCankov
Copy link
Contributor Author

This is the app: https://github.com/NativeScript/nativescript-marketplace-demo
The setup:

Here the app is initialized:

CI sets the const enabled = false; to true upon build and sets up the api keys in hte .plist here

The notifications displayed in the app consume the data from the push notification, I couldn't get the title and body in Android but found issues for ppl having problems with that in pure native apps too.

@csaggo
Copy link

csaggo commented Nov 25, 2016

thank you very much! i have a workaround where i use firebase on android and push-notification plugin on ios, but obviously would prefer to have all in firebase. gonna work through your example!

BTW: i do get the data from android when sending fcm push like so:
"data" : { "title" : "some title", "message" : "some msg", "sound" : "default", "smallIcon" : "push", "largeIcon" : "push" }

in onMessageReceivedCallback data.message is correctly set. put i have to use data instead of notification and message instead of body and so on. works in back and foreground.

@PanayotCankov
Copy link
Contributor Author

Yep, that's what I am doing too. Adding inAppTitle and inAppBody in the data.
There was one more tricky part for iOS if I remember correctly, If you send the notification from the firebase console, scroll down to the "Advanced" part, when you expand the area, there is a title that must be filled.

EddyVerbruggen added a commit that referenced this pull request Apr 18, 2017
Let iOS handle push notifications after the app was killed in the springboard
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants