Skip to content

Don't receive fcm notification when I exit the unity app,only user open the unity app the mobile notifiction list can show the fcm push notification. #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
BuKuSiShen opened this issue Dec 12, 2016 · 14 comments

Comments

@BuKuSiShen
Copy link

Use the Unity plugins of Messaging on Android.Can't receive push notification on the mobile notifiction list when exit the unity app.

@stewartmiles
Copy link
Contributor

It sounds like the Firebase Messaging service isn't launched in the application. If you're customizing the AndroidManifest.xml for your application you'll need to make sure you follow the setup instructions on https://firebase.google.com/docs/cloud-messaging/unity/client#note_for_android

@BuKuSiShen
Copy link
Author

@stewartmiles I use quickstart samples to test.It also not receive push notification on the notificition list when i exit the sample application.Can receive push notification only when the application is on runtime.

@BuKuSiShen
Copy link
Author

@stewartmiles I means that the fcm service (about the current unity application) isn't always Resident background when user exit app.

@stewartmiles
Copy link
Contributor

We just tested this again and we are definitely seeing notifications come in when sending to the application when:

  • App is running in the foreground
  • App is running / resident in the background
  • App is not running

To be clear when the app is in the background or not running you don't get a callback when the notification comes in. The app gets to service the notification when it reopens due to a user clicking on the notification. Is this the behavior you're seeing?

@BuKuSiShen
Copy link
Author

@stewartmiles I see the behavior is that When App is not running the notification don't comes in.
When App is running in the foreground or App is running / resident in the background my app works fine.

@stewartmiles
Copy link
Contributor

How are you sending the notification?

Are you using the notification console?
https://firebase.google.com/docs/notifications/android/console-audience#send_a_message_from_the_notifications_console

I just built the sample + the 1.1.0 SDK and verified the following on a Nexus 4 running Android 4.3 (because I like to keep it old skool 👍 ):

  • Sending message to the game while it's open, receives the message displays in the log window
  • Sending message to the game while it's in the background, notification in the notification tray
  • Closed game (swipe away), send message to the topic - notification displayed in the notification tray.

I've attached a screenshot of the message I sent via the notification console.

notification

@BuKuSiShen
Copy link
Author

@stewartmiles Thank you first of all.
I found that:
A: run app on HUAWEI P8. The notification don't comes in.This HUAWEI P8 is made for chinese,the reason may be about this custom system

B: run app on SUMSUNG Galaxy S4.The notification comes in via Topic notification console.But the notification don't comes in via User segment(using the Bundle identifier) notification console.This is also a issue.Do you see this behavior?
The follow is my init code:
//FCM's init
public void InitializeFirebase()
{
Firebase.Messaging.FirebaseMessaging.TokenReceived += OnTokenReceived;
Firebase.Messaging.FirebaseMessaging.MessageReceived += OnMessageReceived;
Firebase.Messaging.FirebaseMessaging.Subscribe ("TestTopic");
}

@MustafaKilci
Copy link

Hi, I have the same issue. I sent three types of notifications (User segment, Topic and Unique Device)

The app gets the notification when app is running in the foreground in callbackFunction; when app resident in the background as notification on system tray but cannnot get notification when
App is not running or killed.

I need urgent support.

@BuKuSiShen
Copy link
Author

@MustafaKilci Sorry,i don't fix this.Just wait the other one or the next release.

@phpnato
Copy link

phpnato commented Jan 13, 2017

Hi, I have the same issue

@stewartmiles
Copy link
Contributor

stewartmiles commented Jan 14, 2017 via email

@stewartmiles
Copy link
Contributor

Closing out as it sounds like we need to clarify our docs on this behavior.

@nabeelpkl
Copy link

nabeelpkl commented Mar 28, 2018

any updates on this? anyone customised the implementation to get it work when app is killed.

@stewartmiles
Copy link
Contributor

@nabeelpkl if you want to customize messaging handling on Android when the app is in the background (i.e just the messaging service is running) see https://firebase.google.com/docs/cloud-messaging/cpp/client#custom_message_handling_on_android (the Unity SDK uses the C++ SDK under the hood).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants