のために必要な通知ペイロードが、これは私がのために通知を送信するために使用(C#)のオブジェクトであるので、私は(唯一の「データ」のペイロードを送信する)の通知ペイロードを削除することはできません。 IOSとAndroidの両方。そのコードを書いている時点では
internal class jsonObj
{
//public bool delay_while_idle { get; set; }
public data data { get; set; }
public notification notification { get; set; }
public string to { get; set; }
public string priority { get; set; }
}
internal class data
{
public int Id { get; set; }
public int commentId { get; set; }
public string type { get; set; }
public string DisplayName { get; set; }
public string licensePlateCode { get; set; }
public int licensePlateId { get; set; }
public string text { get; set; }
}
internal class notification
{
public string title { get; set; }
public string body { get; set; }
public string sound { get; set; }
public string badge { get; set; }
[JsonProperty("content-available")]
public string contentAvailable { get; set; }
}
は、私はもう推奨されませんアンドロイドの古いWakefulBroadcastReceiver
とIntentService
を、使用していました。興味を持っている場合しかし、それはthis question
EDITのように見えた: OPはthis post on githubについてコメントしています。そこには同じ問題がまだ説明されていません(2016年9月)。回避策はそこにあります、あなたはIOSとAndroidのための別の要求を送信する必要があります。
[docs](https://firebase.google.com/docs/notifications/android/console-device#receive_and_handle_messages)から、バックグラウンドでメッセージを受け取ることは、Android自体の動作です。あなたがそれを変更することができるかどうかは分かりません。代わりに私が考えているのは、システムトレイ/エキストラインテントをチェックして、あなたの 'onMessageReceived()'と同じメソッドにフローを向ける方法があるかもしれないということです。ちょっと思ったよ。 –