Created
January 18, 2019 15:23
-
-
Save gregtap/d0e5b27fb836bbb697acf9bdf00334af to your computer and use it in GitHub Desktop.
Revisions
-
Greg TAPPERO renamed this gist
Jan 18, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Greg TAPPERO created this gist
Jan 18, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ import firebase_admin from firebase_admin import credentials, messaging cred = credentials.Certificate("/Users/greg/Downloads/chefclub-notifications-test-1-firebase-adminsdk-0qqbs-7cb7b7b6c4.json") firebase_admin.initialize_app(cred) # This registration token comes from the client FCM SDKs. registration_token = 'cjNg-fBsWsE:APA91bEc-pDmnfkyczdJroTv-KNHpucA7WhYrmxWrgcSz4HHqn5vhodglqI3mqUSZnz0_VhuJjCrvGUVyqbRR-YnP8DuxdeHQyp1BUiF-H2V2ockNJ2OO-yEh6Im2EFhI6KHUd3ettEg' # See documentation on defining a message payload. message = messaging.Message( data={ 'score': '850', 'time': '2:45', }, token=registration_token, ) # Send a message to the device corresponding to the provided # registration token. response = messaging.send(message) # Response is a message ID string. print('Successfully sent message:', response)