summaryrefslogtreecommitdiff
path: root/backend/notif_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'backend/notif_test.py')
-rw-r--r--backend/notif_test.py33
1 files changed, 13 insertions, 20 deletions
diff --git a/backend/notif_test.py b/backend/notif_test.py
index e0d82c0..b6f843e 100644
--- a/backend/notif_test.py
+++ b/backend/notif_test.py
@@ -1,21 +1,14 @@
-from dotenv import load_dotenv
-from os import getenv
-import onesignal
-from onesignal.api import default_api
-from onesignal.model.notification import Notification
-
-load_dotenv()
-
-onesignal_configuration = onesignal.Configuration(
- rest_api_key=getenv("REST_API_KEY"),
- organization_api_key=getenv("ORGANIZATION_API_KEY"),
+import notif
+
+endpoint_to_test = "https://fcm.googleapis.com/fcm/send/f4Cw12WAYnE:APA91bHOZvh8HkExsem20UK_5uhzgCu0dEo01YV8G8-9hFBjEdsk1M49JVLD7Z51BDP7gxn_UAXVwvmYxIWajwQ9VyTS3ghNQzx92jex-isbz5IvzcpI0QOxaVnmoURLtK-qYt36ebic"
+endpoint_to_test = "https://fcm.googleapis.com/preprod/wp/dP2ULA5s2Fk:APA91bE6toPxR5LbakAronwoI2QfdSe6NIEAzVBoIq0Q5jUF8hkFskAT_PyHYwwUiJpJgF8xcCr_8CEzE83YTsUGZWyvcI53DiwjkDD4IK1UseK2bX-WaXVRRXBLM5wTHCKs1ZfG2rME"
+
+notif.send_notification(
+ endpoint_to_test,
+ {
+ "title": "Test Notification",
+ "body": "Hello, world pls work",
+ "requireInteraction": True,
+ "timerId": 0,
+ }
)
-
-api_client = onesignal.ApiClient(onesignal_configuration)
-api_instance = default_api.DefaultApi(api_client)
-
-ONESIGNAL_APP_ID = "83901cc7-d964-475a-90ec-9f854df4ba52"
-
-# yes that's my subscription id. probably outdated by now
-notification = Notification(app_id=ONESIGNAL_APP_ID, include_subscription_ids=['86f24e73-8887-4e29-b607-31e1a8f25b93', '6a2b4b58-a1d2-403b-afa0-b4a987ca6139'], contents={'en': 'hello world'}, headings={'en': 'Laundry Finished!'}, priority=10)
-print(api_instance.create_notification(notification))