Constructor
new sCMessaging(app_id, app_secret)
Opens a new schmuckliCloud messaging instance.
Parameters:
Name | Type | Description |
---|---|---|
app_id |
String |
The APP ID, which was created for a client app in the schmuckliCloud console. |
app_secret |
String |
The APP Secret, which was created for a client app in the schmuckliCloud console. |
- Source:
Methods
setAuthToken(auth_token)
Sets the currently signed in user.
Parameters:
Name | Type | Description |
---|---|---|
auth_token |
string |
Sets the auth token for the further operations. |
- Source:
(async) assignTokenToUser(device_token) → {Promise}
Assign a Firebase Cloud Messaging device token to the currently logged in your project.
Parameters:
Name | Type | Description |
---|---|---|
device_token |
String |
The device token received from the Firebase SDK. |
- Source:
(async) sendRequestNow(body) → {Promise}
Sends a request to FCM instantly with the currently logged in user.
Parameters:
Name | Type | Description |
---|---|---|
body |
object |
The body of the request like here: https://firebase.google.com/docs/cloud-messaging/http-server-ref |
- Source:
(async) sendRequestLater(body, timestamp) → {Promise}
Sends a request to FCM on the specified timestamp with the currently logged in user..
Parameters:
Name | Type | Description |
---|---|---|
body |
object |
The body of the request like here: https://firebase.google.com/docs/cloud-messaging/http-server-ref |
timestamp |
int |
The timestamp, when the request should be processed. |
- Source:
(async) getAllAssignedTokens() → {Promise}
Fetchs all the assigned device tokens of the authenticated user.
- Source:
(async) getOpenRequests() → {Promise}
Fetchs all the open requests, which will be send to the user in the future.
- Source:
(async) deleteOpenRequest(id) → {Promise}
Deletes an open request by its id
Parameters:
Name | Type | Description |
---|---|---|
id |
Number |
The request id |
- Source:
(async) deleteAssignedToken(id) → {Promise}
Deletes a assigned device token from the user. For example when he sign outs.
Parameters:
Name | Type | Description |
---|---|---|
id |
Number |
The assigned token id |
- Source: