We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7901360 commit e3d1b63Copy full SHA for e3d1b63
firebase_messaing_v1.py
@@ -0,0 +1,19 @@
1
+import firebase_admin
2
+from firebase_admin import credentials
3
+from firebase_admin import messaging
4
+
5
+cred_path = "firebase-adminsdk-myproject.json"
6
+cred = credentials.Certificate(cred_path)
7
+firebase_admin.initialize_app(cred)
8
9
+registration_token = 'user_token'
10
11
+message = messaging.Message(
12
+ notification=messaging.Notification(
13
+ title='test',
14
+ body='python push test'
15
+ ),
16
+ token=registration_token,
17
+)
18
+response = messaging.send(message)
19
+print('Successfully sent message:', response)
0 commit comments