これは、fcm通知をデバイスに送信するPythonスクリプトです。サーバーからiosデバイスにサイレント通知を送信するにはどうすればよいですか?
サイレント通知ではなく、優先通知を送信します.... どうすればサイレンスできますか?
def sendGCMToTopiciOS():
url = 'https://fcm.googleapis.com/fcm/send'
headers = {
'UserAgent': "GCM-Server",
'Content-Type': 'application/json',
'Authorization': 'key=' + 'XXXXXXXXXXXXXXXXXXXX',
}
data = {'title': 'Yugam', 'message': 'Hello Everyone', 'event': '13', 'workshop': '-1',
'link': 'https://www.google.com'}
notification = {
'body': data.get('message'),
'title': data.get('title')
}
values = {
'to': '/topics/' + 'global',
'data': data,
'notification': notification,
"aps":{
"content-available":1}
}
pipe = requests.post(url=url, json=values, headers=headers)
return pipe.json()
それは動作していません!とにかくお礼... –
なぜそれが機能していないの詳細情報を追加できますか?アプリが開いているのにバックグラウンドで試してみることができますか? –