有沒有人找到一個使用WebAPI將應用程序中的短信集成到三星齒輪S的工作示例?短信在WebAPI與三星齒輪S發送
我發現tizen兩個例子,但它們都沒有與齒輪S.曾與細微調整,就像這樣:
首先嚐試:
function sendSMS(smsno)
{
if (bDebug)
alert("Versuche SMS (sendSMS) zu senden an " + smsno);
smsnumber = smsno;
try
{
var appControl = new tizen.ApplicationControl(
'http://tizen.org/appcontrol/operation/compose', 'sms:'
+ smsnumber);
tizen.application.launchAppControl(appControl, null, function()
{
}, function(e)
{
alert("SMS konnte nicht gesendet werden: " + e.message);
},
{
onsuccess : function()
{
},
onfailure : function(er)
{
alert("SMS konnte nicht gesendet werden: " + er.message);
}
});
}
catch (e)
{
alert("http://tizen.org/appcontrol/operation - " + e.message);
}
}
第二個嘗試:
// Define the success callback.
function messageSent(recipients)
{
if (bDebug)
alert("The SMS has been sent");
}
// Define the error callback.
function messageFailed(error)
{
alert("The SMS could not be sent " + error.message);
}
// Define service error callback.
function serviceErrorCB(error)
{
alert("Cannot get messaging service " + error.message);
}
// Define the success callback.
function serviceListCB(services)
{
try
{
if (services.length > 0)
{
var msg = new tizen.Message("messaging.sms",
{
plainBody : "Hilferuf von Nummer: " + smsnumber + ": "
+ vorname + " " + nachname + ": " + adresse,
to : [ smsnumber ]
});
// Send request
services[0].sendMessage(msg, messageSent, messageFailed);
}
}
catch (e)
{
alert("serviceListCB Problem - " + e.message);
}
}
function sendSMS_tizen(smsno)
{
if (bDebug)
alert("Versuche SMS zu senden an " + smsno);
smsnumber = smsno;
try
{
tizen.messaging.getMessageServices("messaging.sms", serviceListCB,
serviceErrorCB);
}
catch (e)
{
alert("tizen.messaging nicht definiert- " + e.message);
}
}
不幸的是,三星文檔在這個部分是非常不明確的。
任何想法歡迎!
在Gear S中,可以找到com.samsung。 message.appcontrol.compose被定義(使用tizen.application.getAppsInfo(onListInstalledApps);檢查;但沒有可用的文檔如何使用它有沒有人有關於該功能的想法? – user2737950 2015-01-29 16:46:22