Skip to content

Commit

Permalink
[faq] update after adding ping feature
Browse files Browse the repository at this point in the history
  • Loading branch information
capcom6 committed Jul 4, 2024
1 parent fd02603 commit 29eea4b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
14 changes: 12 additions & 2 deletions docs/faq/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/integration/webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 29eea4b

Please sign in to comment.