Skip to content

Commit

Permalink
[docs] update app name
Browse files Browse the repository at this point in the history
  • Loading branch information
capcom6 committed Jul 3, 2024
1 parent f86ea4d commit ea7de3f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Android SMS Gateway PHP API Client
# SMS Gateway for Android™ PHP API Client

This is a PHP client library for interfacing with the [Android SMS Gateway](https://sms.capcom.me) API.
This is a PHP client library for interfacing with the [SMS Gateway for Android](https://sms.capcom.me) API.

## Requirements

Expand Down
40 changes: 40 additions & 0 deletions test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

require 'vendor/autoload.php';

use AndroidSmsGateway\Client;
use AndroidSmsGateway\Domain\Message;
use AndroidSmsGateway\Encryptor;

// RMTJTU:yv3sqcidpqeoxc
// $login = 'sms';
// $password = '6jH2vwEA';

$login = 'RMTJTU';
$password = 'yv3sqcidpqeoxc';

$encryptor = new Encryptor('test');
$client = new Client($login, $password);

$message = new Message('Your message text here.', ['+79504241345']);

try {
$messageState = $client->Send($message);
// print_r($messageState);
echo "Message ID: " . $messageState->ID() . PHP_EOL;
} catch (Exception $e) {
echo "Error sending message: " . $e->getMessage() . PHP_EOL;
die(1);
}

try {
$messageState = $client->GetState($messageState->ID());
echo "Message state: " . $messageState->State() . PHP_EOL;
} catch (Exception $e) {
echo "Error getting message state: " . $e->getMessage() . PHP_EOL;
die(1);
}


// echo $encryptor->encrypt('test') . PHP_EOL;
// echo $encryptor->decrypt($encryptor->encrypt('test')) . PHP_EOL;

0 comments on commit ea7de3f

Please sign in to comment.