使用 Samsung Gear S 在 WebAPI 中发送短信

标签 sms tizen

有没有人找到使用 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。不幸的是,现在可以通过 Gear S 上的 Web api 发送短信。这就是为什么没有关于此的文档;)

关于使用 Samsung Gear S 在 WebAPI 中发送短信,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27290483/

相关文章:

android - 如何在 Android Kitkat 中设置我的短信应用默认?

iphone - 读取 iPhone 的通话、短信和数据使用情况

javascript - 在 angularJS 的 CAPH 中插入 caph-input 时出错

c - Tizen 屏幕键盘(输入组件)文本截断

tizen - 从命令行打开 Tizen Remote Web Inspector

Android - 100% 的时间未收到发送短信的 Intent

ios - 在 iOS 中阅读短信

c# - 如何在 C# 中使用 Azure 通信服务 SMS 发送多个收件人 SMS

android - 是否可以在不使用手机/平板电脑上的 Samsung S Health 应用程序的情况下检索 Samsung Gear S3 watch 计步器和心率日志

javascript - JS lib 可以在 Native Tizen App 中使用吗?