1

我创建了一个简单的 swift 应用程序来显示您当前的速度,并想创建一个 pebble 应用程序来与 iOS 应用程序对话并显示速度。所以我的问题是,如何将值从 swift 应用程序发送到 C/JS pebble 应用程序。

提前致谢!

4

2 回答 2

0

你不能。Pebble 尚未为 swift 应用程序提供 SDK。

于 2015-03-24T13:13:02.377 回答
0

现在有一种方法可以用 swift 做到这一点。

创建一个字典对象,然后将其发送到 pebble watch。

    let dictionary: NSDictionary
    dictionary = [key : value, key : value, key : value....]


    watch.appMessagesPushUpdate(dictionary as! [NSNumber : AnyObject]) { (watch, dictionary, error) in
        if ((error == nil))
        {
            NSLog("Successfully sent message.");
        } else if ((error) != nil)
        {
            NSLog("Error sending message: \(error)");
        }
    }
}
于 2016-06-15T06:34:29.517 回答