<reponame>sergioburdisso/solidwebpush
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Author: <NAME> (<EMAIL>)

from solidwebpush import Pusher

session_id = "bob-tablet-id" #this should be "Bob's real session id", for instance, a cookie sent by the client
subscription = '<paste here the subscription object generated after subscribing your serviceWorker(sw.js)>'
# e.g.         '{"endpoint":"https://fcm.googleapis.com/fcm/send/e0rq2RDMkoY:APA91bFEit0f609_b9LVB<KEY>","keys":{"<KEY> <KEY>,"auth":"<KEY>}}'

pusher = Pusher(verbose=True)

#Let's permanently store a new subscription
#for Bob's tablet
pusher.newSubscription(session_id, subscription)

#so that, later on, we can notify him without
#using the subscription object, like so
pusher.notify(session_id, "Hello World")
