def sen_start_noti(uid): import firebase_admin from firebase_admin import credentials from firebase_admin import db from firebase_admin import messaging # Fetch the service account key JSON file contents cred = credentials.Certificate('servicekey.json') # Initialize the app with a service account, granting admin privileges registration_token = db.reference('SentinelProc').child(uid).child('TokenId').get() print(registration_token) b = 'System has started working on your Satellite Imagery Request. You will receive an email shortly' message = messaging.Message( android=messaging.AndroidConfig( priority='normal', notification=messaging.AndroidNotification( title='On Demand Satellite Imagery', body=b, icon='ic_launcher', color='#006666', sound='notification_sound', tag = 'satelliteprocessingresult' ), ), token=registration_token, data={ 'image_id': 'random', 'result_status': 'random2' }, ) # 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) return