diff --git a/docs/faq/general.md b/docs/faq/general.md index 7cc8349..0111e3d 100644 --- a/docs/faq/general.md +++ b/docs/faq/general.md @@ -67,6 +67,16 @@ It's not possible to completely hide messages on the device without major change ## How can I check the online status of the device? -In Local mode, you can simply attempt to connect to the API. For example, try accessing the `/health` endpoint. +### Local mode -In Cloud/Private mode, the app operates asynchronously, relying on PUSH notifications. This means there isn't a continuous connection to the server, making it challenging to confirm if the device is online at any given moment. However, you can obtain some information through the [`GET /device`](https://sms.capcom.me/api/#/User/get_3rdparty_v1_device) endpoint. The response from this endpoint includes a `lastSeen` field, indicating the last time the device connected to the server. Keep in mind, in idle mode, the Android app may connect to the server no more frequently than once every 15 minutes, so this information might not reflect the real-time status. +Attempting to connect to the device's API directly can give you an immediate sense of its online status. Accessing the `/health` endpoint is a straightforward way to do this. + +### Cloud mode + +The app operates asynchronously, relying on PUSH notifications rather than maintaining a continuous connection to the server. You can use the `GET /device` endpoint to obtain some information about the device's state. The response includes a `lastSeen` field, showing the last time the device connected to the server. Due to the app's idle mode behavior, the device may only connect to the server once every 15 minutes, meaning the `lastSeen` time may not always represent the current status. + +### Any mode + +Irrespective of the mode, you can register a `system:ping` webhook to monitor the device's online status. This webhook will notify your server about the status of the app at user-defined intervals, set within the app's Settings on the device. This feature offers a proactive approach to track connectivity and ensure the device is functioning as expected across any operational mode. + +**Note**: Using the ping feature will increase battery usage. It's important to balance the need for frequent status updates with the impact on device battery life, especially if the device is expected to operate for extended periods without charging. diff --git a/docs/index.md b/docs/index.md index 94f8926..0d55836 100644 --- a/docs/index.md +++ b/docs/index.md @@ -21,6 +21,7 @@ Android SMS Gateway turns your Android smartphone into an SMS gateway. It's a li - **Message expiration:** The application allows setting an expiration time for messages. Messages will not be sent if they have expired. - **Random delay between messages:** Introduces a random delay between sending messages to avoid mobile operator restrictions. - **Private server support:** The application allows for the use of a backend server in the user's infrastructure for enhanced security. +- **App status reporting:** Ability to report current app status by sending requests to specified URL at any user-defined intervals. - **Webhooks on incoming SMS:** The application allows setting up webhooks to be sent to a specified URL whenever an SMS is received. ## Ideal For diff --git a/docs/integration/webhooks.md b/docs/integration/webhooks.md index 8feea39..8c32979 100644 --- a/docs/integration/webhooks.md +++ b/docs/integration/webhooks.md @@ -10,6 +10,7 @@ Currently, the following event is supported: * `message`: The content of the SMS message. * `phoneNumber`: The phone number that sent the SMS. * `receivedAt`: The timestamp when the message was received. +- `system:ping` - Triggered when the device pings the server. Has no payload. Please note that as the application evolves, additional events may be supported in the future.