0

so I have been reading on how to implement push notifications in my iOS app using Firebase for a little while now and am getting mixed answers on how I should implement.

My goal is to be able to send push notifications to a single users much like how Instagram or Facebook send a push notification if someone sends you a request or comments on your picture.

I believe there are multiple ways to achieve this. Is there any way this can be done without an app server (I can just talk to FCM api directly within my iOS application)? or is the app server necessary? I can work on a Node.js server if needed.

I would also like the notification to wake up the device if the app is not only in the background but also killed.

I thank everyone in advance who is able to give me some advice or direction implementing this feature.

Thanks!!

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Sending messages *to* a device requires the use of the FCM server key. As its name implies this key should only be used on a server, since knowing allows sending messages to all users of your app on your behalf. For this reason you should only send messages from trusted, non-client devices, such as an app server. – Frank van Puffelen Feb 11 '17 at 19:00
  • For an example of how to send cloud messages using a Node.js server, see my blog post here: https://firebase.googleblog.com/2016/08/sending-notifications-between-android.html. It was written for Android devices, but the approach also works for iOS and the Node.js code will be exactly the same. – Frank van Puffelen Feb 11 '17 at 19:04
  • Great blog post. Thanks so much @FrankvanPuffelen ! – munewalker Feb 12 '17 at 16:08

0 Answers0