We are integrating push notifications in our game but we are facing this problem. If the game is backgrounded we receive those push notifications but not while opened. This is the method we are using for it:
void onPushNotificationsReceived(string pushMessageString)
{
Console.WriteLine("onPushNotificationsReceived....Called");
if (pushMessageString.EndsWith("comprando"))
{
GameObject.Find("SaveGame").GetComponent<DataUpload>().Coroutines(5);
PushActualizando();
}
else if (pushMessageString.EndsWith("actualizando"))
{
GameObject.Find("SaveGame").GetComponent<DataUploadAmigo>().DownloadD("OfertaDeObjetos");
}
else if (pushMessageString.EndsWith("visitando"))
{
string aux = "visitando";
string personaAnadir = pushMessageString.Remove(pushMessageString.Length - aux.Length);
lista.Add(personaAnadir);
}
else if (pushMessageString.EndsWith("saliendo"))
{
string aux = "saliendo";
string personaQuitar = pushMessageString.Remove(pushMessageString.Length - aux.Length);
lista.Remove(personaQuitar);
}
//dump you code here
Debug.Log(pushMessageString);
}
We think we are not entering this method because there is no message appearing on the Debug console.
Any kind of help would be mean so much. Thanks