【问题标题】:SMS sending in WebAPI with Samsung Gear S使用 Samsung Gear S 在 WebAPI 中发送 SMS
【发布时间】:2014-12-05 18:09:16
【问题描述】:

有没有人找到使用 WebAPI 将应用程序中的 SMS 集成到 Samsung Gear S 的工作示例?

我找到了 tizen 的两个示例,但没有一个与 Gear 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); 检查。但没有可用的文档如何使用它. 有人知道这个功能吗?

标签: sms tizen


【解决方案1】:

两种解决方案都来自移动配置文件。它不适用于 Gear S。不幸的是,现在有办法从 Gear S 上的 web api 发送短信。这就是为什么没有关于此的文档的原因;)

【讨论】:

  • 好的,谢谢。意味着为 Gears S 开发一个用于发送 SMS 的本机应用程序。
  • 我还有一个坏消息:你不能在 Gear S 上编写本机应用程序。SDK 不支持这一点(本机仅适用于移动设备)-我建议在 Tizen 论坛上拖钓 ;)
  • 是的,同时我也意识到了这一点。太糟糕了。
  • 我真正想知道的是,Gear S 有一个“消息”应用程序,可以发送短信。也许有一种使用内置消息传递应用程序发送短信的方法?
  • 你找到使用内置应用的方法了吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-08-23
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多