Reputation: 13
I have created a simple swift app that shows your current speed, and would like to create a pebble app that would talk to the iOS app and display the speed to. So my question is, how can I send a value from a swift app to an C/JS pebble app.
Thanks in advance!
Upvotes: 1
Views: 162
Reputation: 5
There is now a way to do it with swift.
Create a dictionary object then send it to the 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)");
}
}
}
Upvotes: 0