--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/eb7a048f-1b4a-4e3f-bbf4-298404668fe4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
If I am understanding your use case correctly, I believe the C++ library should work just fine for your situation.The service that runs in the background is what actually collects the incoming messages for your app. If your app is running in the foreground the message is sent directly to the running app. Otherwise a notification is popped up in your system tray. The activity isn't needed for this.The activity is only needed by the underlying C++ library code to retrieve the intent that started the activity (as sometimes FCM message payloads are passed to the Activity via an Intent). As long as you are initializing Firebase Messaging every time your main activity starts up you should be fine. During initialization the Activity pointer is initialized and the FCM C++ library can check which intent started the new Activity, in case it needs to respond to a new incoming message.If you have any issues getting this to work or further questions let me know.
On Fri, Apr 14, 2017 at 9:23 PM, Woody Guo <wood...@gmail.com> wrote:
So, we are developing an App for both Android and iOS, and we want to send notifications using Firebase Cloud Messaging, i.e. FCM.I managed to get notifications sent from the Firebase Console by following the quick guide using a NativeActivity.However, as this is a normal App, it's not a game written purely using C++. We build the UI using Java for Android and Objective-C for iOS. We then use C++ to implement common utils and business logics so they are written once and built for both platforms. So there's not a NativeActivity involved here.I thought I should be able to call a native function from my Java Activity to initialize FCM and start to wait for notifications to come. But I'm not sure if this is feasible. And, what will happen if the Activity passed as a parameter to initialize the Firebase::App is finished? Will I still be able to receive notifications?Any help would be greatly appreciated.Thanks!
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
- When in the background, apps receive the notification payload in the notification tray, and only handle the data payload when the user taps on the notification.
- When in the foreground, your app receives a message object with both payloads available.
If I do not de-initialize the FCM C++ library when the main activity finishes, will it cause memory leak?
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/12484420-56f5-4306-8a61-8a9754b8992c%40googlegroups.com.