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)