From 8a8cee90ad9abb92c06600b1564b455accf070f3 Mon Sep 17 00:00:00 2001 From: Thies Mueller Date: Thu, 27 Mar 2025 18:46:34 +0100 Subject: [PATCH] add README --- README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..82f7866 --- /dev/null +++ b/README.md @@ -0,0 +1,50 @@ +# py-apns2 + +simple python3 apns2 push service for iOS applications + +## Scope + +This primarily aims to be combined with the RegattaTech.DE Toolkit and automatically sends new race results as push notifications to iOS devices that register themselves via the companion app. + +This can also trigger simple push notifications via a rudimentary API. + +## Usage + +- Clone the repository +- Install the requirements via `pip3 install -r requirements.txt` +- Run the server via `python3 app.py` + +You need an active Apple Developer Subscription. +This can be obtained via the Apple Developer Portal. +You should also be familiar with how notifications work on iOS. + +You also need an iOS application that registers itself with the server. + + +## Endpoints + +### /api/registerDeviceToken +POST json with `device_token` to register +Needs to be authenticated with `REGISTER_AUTH` (defined in config.ini) + +### /api/customnotify +POST json with `severity` and `notification` to send a custom notification +Needs to be authenticated with `MANAGE_AUTH` (defined in config.ini) + +severity can be one of `info`, `warning`, `urgent`, `danger` + +### /api/deleteAllDeviceTokens +Deletes all registered device tokens +Needs to be authenticated with `MANAGE_AUTH` (defined in config.ini) + +### /shownotificationlog +Shows all send notifications +Needs to be authenticated with `MANAGE_AUTH` (defined in config.ini) + +### /showdevicetokens +Shows all registered device tokens +Needs to be authenticated with `MANAGE_AUTH` (defined in config.ini) + +### /api/getresults +Gets the results from the result API, checks for new results and sends out the notification. +Needs to be authenticated with `MANAGE_AUTH` (defined in config.ini) \ No newline at end of file