-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No example for sms send/receive #113
Comments
Hi! The SMS functions are defined here /*
* Description Send and receive a SMS
* by Paul-Emile Sublet <[email protected]>
*/
ui.addTitle(app.name);
var phoneNumber;
const receivedSmsDetails = ui.addText(0, 0, 1, 0.5);
ui.popup()
.title('Enter the phone number to send an SMS to')
.ok('ok')
.input('phone number')
.onAction(function(phoneNumberInput) {
phoneNumber = phoneNumberInput.answer;
})
.show();
// these methods are defined in phonk_apprunner/src/main/java/io/phonk/runner/apprunner/api/PDevice.java
device.onSmsReceived(function(sms) {
receivedSmsDetails.text('from: ' + sms.from + "\n" + 'message: ' + sms.message);
});
ui.addButton('send sms', 0, 0.5, 1, 0.5)
.onClick(function() {
device.smsSend(phoneNumber, 'hello world!');
}); |
Here is the PR adding this example: #119 |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Nice app. Unfortunately I cannot find any information regarding the SMS API. I want to build a simple SMS to MQTT gateway (bidirectional), which should be very easy with Phonk. Can you point me to the docs or the sources with the SMS functionality?
The text was updated successfully, but these errors were encountered: