gabetrav
gabetrav

Reputation: 13

send value from swift app to pebble app

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

Answers (2)

Joseph Magara
Joseph Magara

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

pjtnt11
pjtnt11

Reputation: 522

You can't. Pebble is yet to provide a SDK for swift applications.

Upvotes: 0

Related Questions