Elbert Valdian Elbert Valdian - 1 month ago 20
Objective-C Question

Firebase Cloud Messaging with serverside API push for obj-c

currently I working to implement Firebase Push Notification in my apps.

I found this:


  1. [background] Using Firebase Console my apps can get the notification from system tray with remote notification

  2. [foreground] Using Firebase Console my apps can get the notification from log, but i can make it into notification center with local notification

  3. [foreground] Using Our Dashboard which managed by PHP serverside, I can get notification from log, but i can make it into notification center with local notification



The problem is, how can i get the notification (log is fine) if my apps in background with Our Dashboard which managed by PHP serverside?

I found that there is different between json I got from Firebase Console and our managed serverside dashboard, is that a problem that my apps cant handle? and how i can handle it? can I get the sample of the code to solve this problem?

This is the different between json i got from firebase console and our managed serverside dashboard

firebase console

our managed serverside dashboard

Answer

What you want to do is possible by using the normal FCM api.

Please review the differences between Display-Message and Data-Message here: https://firebase.google.com/docs/cloud-messaging/concept-options#notifications_and_data_messages

and see all the parameters in the reference page:
https://firebase.google.com/docs/cloud-messaging/http-server-ref