2017-10-24 5 views
0

いることを述べている:pushdを使用してiOSプッシュ通知のタイトルを設定するにはどうすればよいですか?アップルのiOSドキュメントで

{'data.project': {'ack': 0, 
       'c': {'id': 'SOME DATA'}, 
       'ca': 1, 
       't': 'e/user', 
       'v': '1', 
       'vm': 2}, 
'msg': 'My message', 
'title': 'My custom title'} 

プッシュ:

alert string/dictionary

If this property is included, the system displays a standard alert or a banner, based on the user’s setting. You can specify a string or a dictionary as the value of alert. If you specify a string, it becomes the message text of an alert with two buttons: Close and View. If the user taps View, the app launches. If you specify a dictionary, refer to Table 5-2 for descriptions of the keys of this dictionary.

title string

A short string describing the purpose of the notification. Apple Watch displays this string as part of the notification interface. This string is displayed only briefly and should be crafted so that it can be understood quickly. This key was added in iOS 8.2.

body string

The text of the alert message.

は今、私はiOSの上で示されるプッシュ通知のタイトルを設定したい、私は以下のペイロードに送られてきましたモバイルデバイスにはタイトルは設定されていません。 pushdはそれをサポートしていますか?私は何をすべきか?

答えて

0

このJSONペイロードを使用して、バックエンドからプッシュ通知を送信します。これがあなたを助けることを願っています。ここでは「タイトル」はプッシュ通知のタイトルであり、「本文」がアラートメッセージのテキストです。

{ 
    "registration_ids" : ["put_id_here"], 
    "notification" : { 
     "content_available" : true, 
     "body" : "this is body", 
     "title" : "this is title", 
     "sound" : "default", 
     "badge" : 1 
    } 
} 
+0

ペイロードとプッシュプッシュで使用しないので、「registration_ids」とは何ですか? – ALH

+0

「registration_ids」は、デバイスのFirebaseInstanceId.getInstance()。getToken()を呼び出して取得した登録トークンの配列です。アレイに複数の登録トークンを置くと、それぞれに同じプッシュ通知が送信されます。 – Rupom

+0

エラー:無効なペイロードエラー:無効なフィールド:body'のエラーが発生し、bodyを 'payloadFilter:['body']'に追加しましたが、再起動後にエラーが再発しました。 – ALH

関連する問題