[英]how to send SMS or make a phone call from a samsung gear s app
i am trying to find a way to send SMS and make a phone call from a samsung gear s app. 我试图找到一种方法来发送短信,并从三星齿轮的应用程序打个电话。
the documentation is mostly missing and searching for this did not lead to much findings. 该文档大多丢失了,搜索此文档并没有带来太多发现。
has anybody worked with that? 有人为此工作过吗? is it at all possible?
有可能吗?
as an alternative, if the app cannot send SMS or make the call, is it possible to start the default apps (similar to Android intent for SMS/Phone app or iOS openURL). 或者,如果该应用程序无法发送短信或拨打电话,则可以启动默认应用程序(类似于SMS / Phone应用程序的Android意向或iOS openURL)。
thanks. 谢谢。
here is what i find so far: 这是我到目前为止发现的:
to make a call from a Gear S app use the following code: 要从Gear S应用程序拨打电话,请使用以下代码:
var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/call", "tel:001....");
tizen.application.launchAppControl(appControl, null,
function() {
console.log("ok");
},
function(e)
{
console.log("error: " + e.message);
},
{
onsuccess : function()
{
console.log("ok 2");
},
onfailure : function(er)
{
console.log("error 2: " + er.message);
}
});
sending SMS is not possible at this time. 目前无法发送短信。
There is no messaging API implemented on Tizen for wearable devices. Tizen没有为可穿戴设备实现任何消息传递API。 You can check it yourself by calling:
您可以通过以下方式自己检查:
console.log(tizen.messaging);
It will return 'undefined' 它将返回“未定义”
It means that you can't programmatically send or read an SMS or an email from your wearable device using Tizen messaging API. 这意味着您无法使用Tizen消息传递API以编程方式从可穿戴设备发送或读取SMS或电子邮件。
@memical - I have found a workaround to launch message/sms app using the app id. @memical-我发现了使用应用程序ID启动Message / SMS应用程序的解决方法。
<p onclick="hackSMS();">Send SMS</p>
<script>
function hackSMS() {
tizen.application.launch("com.samsung.message", function(){console.log ("Launched")});
}
</script>
Remember to add this http://tizen.org/privilege/application.launch
priviege in your apps config.xml 请记住在您的应用程序config.xml中添加此
http://tizen.org/privilege/application.launch
特权。
Note: I tried other methods also like using exposed tizen platform api's for web apps to launch some predefined app control. 注意:我尝试了其他方法,例如使用针对Web应用程序的公开tizen平台api启动一些预定义的应用程序控件。 But it is working for Call and not for sms.
但这适用于Call而不是短信。
To open the app for make a call try this code: 要打开应用进行通话,请尝试以下代码:
Uri number = Uri.parse("tel:"+telNumber);
Intent openCallIntent = new Intent(Intent.ACTION_DIAL, number);
startActivity(openCallIntent);
To make a call: 拨打电话:
Uri number = Uri.parse("tel:"+telNumber);
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(number);
startActivity(callIntent);
To send an sms: 发送短信:
Intent sendSmsIntent = new Intent(Intent.ACTION_VIEW);
sendSmsIntent.setType("vnd.android-dir/mms-sms");
sendSmsIntent.putExtra("address", telNumber);
sendSmsIntent.putExtra("sms_body","Whatever you want");
startActivity(sendSmsIntent);
Similar questions to this one are already answered in stackoverflow 与这个类似的问题已经在stackoverflow中得到了解答
Try this which is very simple as compare to using the platform APIs. 试试这个,与使用平台API相比,这非常简单。
http://www.w3.org/TR/mwabp/#bp-interaction-uri-schemes http://www.w3.org/TR/mwabp/#bp-interaction-uri-schemes
The most broadly supported scheme is tel: as described in RFC3966 [RFC3966].
支持最广泛的方案是tel :,如RFC3966 [RFC3966]中所述。 Code such as the following can be used to enable "Click-to-Call":
如下所示的代码可用于启用“点击通话”:
[PHONE-NUMBER]
[电话号码]
Note that [PHONE-NUMBER] should always be entered using the full international prefix (eg +1-201-555-0111) to ensure that it works outside of its home country.
请注意,应始终使用完整的国际前缀(例如+ 1-201-555-0111)输入[PHONE-NUMBER],以确保其可以在其本国之外使用。
Similarly RFC5724 [RFC5724] can be used to send a GSM SMS (text message) as follows:
同样,RFC5724 [RFC5724]可以用于发送GSM SMS(文本消息),如下所示:
[PHONE-NUMBER]
[电话号码]
Note that at the time of writing support for this RFC is limited and device compatibility should be verified before deployment.
请注意,在撰写本文时,对该RFC的支持是有限的,并且应在部署之前验证设备兼容性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.