Last active
March 22, 2018 00:22
-
-
Save capJavert/57eac0570504fab35fed605bb95eecd1 to your computer and use it in GitHub Desktop.
Push service endpoints
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST /push - subscribe user by user_id with device_token | |
param: device_token: String | |
param: user_id: Int | |
Authorization: token: String - user Auth token | |
returns: | |
{ | |
... | |
data: { | |
user_id: Int, | |
subscription_id: Int | |
} | |
} | |
DELETE /push/:subscription_id - unsubscribe user by subscription_id | |
Authorization: token: String - user Auth token | |
{ | |
... | |
message: String | |
} | |
db model: | |
PushSubscription { | |
subscription_id: Int (pk, autonumber) | |
user_id: String | |
deviceToken: String | |
} | |
// multiple users can have multiple devices registered | |
// on user logout user subscription is deleted for specific device |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment