Skip to content

Instantly share code, notes, and snippets.

@hiranya911
Last active March 11, 2022 15:17
Show Gist options
  • Select an option

  • Save hiranya911/3c401a9d9e64f5fa2b330c07fb12b423 to your computer and use it in GitHub Desktop.

Select an option

Save hiranya911/3c401a9d9e64f5fa2b330c07fb12b423 to your computer and use it in GitHub Desktop.
import firebase_admin
from firebase_admin import messaging
from firebase_admin import firestore
firebase_admin.initialize_app()
client = firestore.client()
snapshot = client.collection('users').document('alice').get()
data = snapshot.to_dict()
msg = messaging.Message(
topic=data['topicName'],
notification=messaging.Notification(
title='Hello from the other side',
body='I must have called this proxy a thousand times'
)
)
print(messaging.send(msg))
@john012343210
Copy link

hi, what if it is javascript in client browser?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment