def sendNotification(Key, Topic, Title, Body, OS, Silent):
m = {"to":"/topics/"+Topic}
data = {"title": Title, "body":Body}
if OS == "iOS":
if Silent == False:
iosalert = {"title":Title, "body":Body, "sound":"default"}
m.update({"notification":iosalert})
else:
m.update({"content_available": True})
m.update({"priority": 10})
m.update({"data":data})
url = 'https://fcm.googleapis.com/fcm/send'
headers = {'Content-type': 'application/json;charset=UTF-8', 'Authorization': 'key='+str(Key)}
x = requests.post(url, data=str(json.dumps(m)), headers=headers)