Skip to content

Commit 6d5bfed

Browse files
committed
Update README.md
1 parent abaf572 commit 6d5bfed

1 file changed

Lines changed: 70 additions & 29 deletions

File tree

README.md

Lines changed: 70 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,69 @@
11

22
![Logo](https://repository-images.githubusercontent.com/793146864/6fb1ef96-255c-4946-bd88-3b26e7c17e3d)
33

4-
5-
# Android SMS Gateway (PHP)
4+
# 📱 Android SMS Gateway (PHP)
65

76
Android SMS Gateway transforms your Android smartphone into an SMS gateway. It is a lightweight application that enables you to send SMS messages programmatically via an API, making it ideal for integrating SMS functionality into your applications or services.
87

8+
## 🚀 Installation
99

10-
11-
12-
## Installation
13-
14-
To install the rootscratch/sms via Composer, run the following command:
10+
To install the `rootscratch/sms` via Composer, run the following command:
1511

1612
```bash
17-
composer require rootscratch/sms
13+
composer require rootscratch/sms
1814
```
19-
20-
## Usage/Examples
21-
To use the Rootscratch SMS in your PHP project, include the Composer autoloader:
2215

16+
## 📖 Usage/Examples
17+
18+
To use the Rootscratch SMS in your PHP project, include the Composer autoloader:
2319

2420
```php
2521
require_once __DIR__ . '/vendor/autoload.php';
22+
2623
use Rootscratch\SMS\Configuration;
2724
$configuration = new Configuration();
25+
2826
// Set API Key
29-
Configuration::setApiKey('your_api_key');
27+
$configuration->setApiKey('your_api_key');
28+
```
29+
30+
## ⚙️ Configuration Usage
31+
32+
```php
33+
/**
34+
* Configuration
35+
*
36+
* Get Devices = getDevices()
37+
* Get Balance = getBalance()
38+
*
39+
* Get Message By ID = getMessageByID($id) : if $id int = message id, if $id string = group id
40+
*
41+
* Get Message By Status = getMessagesByStatus($status, $deviceID = null, $simID = null, $time = null, $endTimestamp = null)
42+
* Get messages "received" on SIM 1 of device ID 8 in last 24 hours = getMessagesByStatus("Received", 8, 0, time() - 86400)
43+
*
44+
* Get USSD Request By ID = getUssdRequestByID($id)
45+
* Get USSD requests with request text "*150#" sent in last 24 hours. = getUssdRequests("*150#", null, null, time() - 86400)
46+
*
47+
* Add a new contact to contacts list 1 or resubscribe the contact if it already exists. = addContact(1, "+11234567890", "Test", true);
48+
* Unsubscribe a contact using the mobile number. = unsubscribeContact(1, "+11234567890");
49+
*
50+
*/
51+
echo json_encode($configuration->getDevices(), JSON_PRETTY_PRINT);
3052
```
3153

32-
## Send Single SMS
54+
## 📤 Send Single SMS
55+
3356
```php
3457
use Rootscratch\SMS\Send;
3558
$sendMessage = new Send();
59+
3660
$send_single = $sendMessage->sendSingleMessage('mobile_number', 'Message');
61+
3762
echo json_encode($send_single, JSON_PRETTY_PRINT);
3863
```
3964

40-
## Send Bulk Message
65+
## 📥 Send Bulk Message
66+
4167
```php
4268
$send_bulk = $sendMessage->sendMessages([
4369
[
@@ -52,7 +78,7 @@ $send_bulk = $sendMessage->sendMessages([
5278
echo json_encode($send_bulk, JSON_PRETTY_PRINT);
5379
```
5480

55-
## Send MMS Sample
81+
## 🖼️ Send MMS Sample
5682

5783
- Use All Sims = sendMessages(messages = array, option = USE_ALL_SIMS)
5884
- Use All Devices = sendMessages(messages = array, option = USE_ALL_DEVICES)
@@ -68,13 +94,13 @@ echo json_encode($send_bulk, JSON_PRETTY_PRINT);
6894

6995
$send_bulk_mms = $sendMessage->sendMessages([
7096
[
71-
"number" => "639123456789",
97+
"number" => "639637057969",
7298
"message" => "Test 1",
7399
"type" => "mms",
74100
"attachments" => 'https://sample.com/1.png'
75101
],
76102
[
77-
"number" => "639123456789",
103+
"number" => "639637057969",
78104
"message" => "Test 2",
79105
"type" => "mms",
80106
"attachments" => 'https://sample.com/1.png'
@@ -83,36 +109,51 @@ $send_bulk_mms = $sendMessage->sendMessages([
83109
echo json_encode($send_bulk_mms, JSON_PRETTY_PRINT);
84110
```
85111

86-
## Send Message To Contacts List
87-
Send a message on schedule to contacts in contacts list with ID of 1.
112+
## 📇 Send Message To Contacts List
113+
114+
Send a message on **schedule** to contacts in contacts list with ID of 1.
88115

89-
- Send a message on schedule to contacts in contacts list with ID of 1.
90-
sendMessageToContactsList(1, "Test", null, null, strtotime("+2 minutes"));
116+
```php
117+
$sendMessage->sendMessageToContactsList(1, "Test", null, null, strtotime("+2 minutes"));
118+
```
119+
120+
Send a message to contacts in contacts list with ID of 1.
91121

92122
```php
93-
$send_contact_list = $sendMessage->sendMessageToContactsList(1, 'Via Contact List!', Configuration::USE_SPECIFIED, [4]);
123+
$send_contact_list = $sendMessage->sendMessageToContactsList(
124+
1,
125+
'Via Contact List!',
126+
Configuration::USE_SPECIFIED,
127+
[4]
128+
);
94129
echo json_encode($send_contact_list, JSON_PRETTY_PRINT);
95130
```
96131

97-
## Send USSD Request
98-
Send a USSD request using default SIM of Device ID 1.
132+
## 📲 Send USSD Request
133+
134+
Send a USSD request using the default SIM of Device ID 1.
99135

100136
```php
101137
$send_ussd = $sendMessage->sendUssdRequest('*150#', 1);
102138
echo json_encode($send_ussd, JSON_PRETTY_PRINT);
103139
```
104-
Send a USSD request using SIM in slot 1 of Device ID 1
140+
141+
Send a USSD request using SIM in **slot 1** of Device ID 1.
142+
105143
```php
106144
$send_ussd = $sendMessage->sendUssdRequest('*150#', 1, 0);
107145
echo json_encode($send_ussd, JSON_PRETTY_PRINT);
108146
```
109-
Send a USSD request using SIM in slot 2 of Device ID 1.
147+
148+
Send a USSD request using SIM in **slot 2** of Device ID 1.
149+
110150
```php
111151
$send_ussd = $sendMessage->sendUssdRequest('*150#', 1, 1);
112152
echo json_encode($send_ussd, JSON_PRETTY_PRINT);
113153
```
114154

115-
## Resend SMS
155+
## 🔄 Resend SMS
156+
116157
```php
117158
/**
118159
* Resend SMS Sample
@@ -128,7 +169,7 @@ $resend_by_id = $resend->resendMessagesByGroupID('MZ7QabWteHWfSkjkgX67acc67bcc20
128169
echo json_encode($resend_by_id, JSON_PRETTY_PRINT);
129170
```
130171

131-
132-
## Support
172+
## 🛠️ Support
133173

134174
For support, please email me at jaycee@rootscratch.com.
175+

0 commit comments

Comments
 (0)