| 1 |
''' |
| 2 |
Sms |
| 3 |
==== |
| 4 |
|
| 5 |
The :class:`Sms` provides access to sending Sms from your device. |
| 6 |
|
| 7 |
.. note:: |
| 8 |
|
| 9 |
On Android your app needs the SEND_SMS permission in order to |
| 10 |
send sms messages. |
| 11 |
|
| 12 |
.. versionadded:: 1.2.0 |
| 13 |
|
| 14 |
Simple Examples |
| 15 |
--------------- |
| 16 |
|
| 17 |
To send sms:: |
| 18 |
|
| 19 |
>>> from plyer import sms |
| 20 |
>>> recipient = 9999222299 |
| 21 |
>>> message = 'This is an example.' |
| 22 |
>>> sms.send(recipient=recipient, message=message) |
| 23 |
|
| 24 |
Supported Platforms |
| 25 |
------------------- |
| 26 |
Android, iOS |
| 27 |
|
| 28 |
''' |
| 29 |
|
| 30 |
|
| 31 |
class Sms: |
| 32 |
''' |
| 33 |
Sms facade. |
| 34 |
''' |
| 35 |
|
| 36 |
def send(self, recipient, message): |
| 37 |
''' |
| 38 |
Send SMS or open SMS interface. |
| 39 |
|
| 40 |
:param recipient: The receiver |
| 41 |
:param message: the message |
| 42 |
|
| 43 |
:type recipient: number |
| 44 |
:type message: str |
| 45 |
''' |
| 46 |
self._send(recipient=recipient, message=message) |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
def _send(self, **kwargs): |
| 51 |
raise NotImplementedError() |