Page tree
Skip to end of metadata
Go to start of metadata

This guide explains how to use the telephony features in a project.

Making a Call

Making a call is a very basic telephony feature. It allows the user to call any number in the application.

The code lines below show how to make a call;

var SOS = true;
if (SOS) {
	Device.makeCall("911");
}

Sending an SMS

iOS

İOS does not support sendInBackground. This is a default behavior for Apple devices. Either you set true or false the iOS will get false.

 

In any application developed in the Smartface, SMS can be easily sent. It requires some parameters which define the content and sending methods.

Parameters

NAMETYPEDESCRIPTION
phoneNumberStringThe number that you want to send message.
messageTextStringThe message that you want to send.
onSuccessFunctionThe function that will be called if the sendSMS method succeeds
onFailureFunctionThe function that will be called if the sendSMS fails
sendInBackgroundBooleanIf it is true, SMS will be sent in the background.

Sample

You can easily send an SMS with sample codes below.

SMF.Net.sendSMS({
	phoneNumber : "123456789",
	messageText : "text body",
	onSuccess : function () {
		alert("SMS is successfully sent.");
	},
	onFailure : function () {
		alert("SMS sending is failed.");
	},
	sendInBackground : true
});

Handling a Received SMS

In Android Devices (iOS does not support), the received SMS can be read in the application. In order to use that feature, the onSMSReceived event should be used in the "app.js" file.

The onSMSReceived event has following properties :

smsSender
smsContent

Here is the simple codes of an application which handles a received SMS;

Application.onSMSReceived = function (e){
	alert("Sender of the SMS : " + e.smsSender + "Content of the SMS : " + e.smsContent);
};