• Stars
    star
    112
  • Rank 312,240 (Top 7 %)
  • Language
    HTML
  • Created over 10 years ago
  • Updated almost 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

iOS PebbleKit SDK to talk to the Pebble via Bluetooth

PebbleKit iOS GitHub release Cocoapod Carthage compatible

Welcome to Pebble's official iOS SDK!

Examples

All Pebble SDK examples are available on GitHub.

You can also run pod try PebbleKit to jump into a simple project right away.

Integrating PebbleKit Using CocoaPods

  • Install CocoaPods or make sure it is up to date
  • Add a Podfile to your project if you don't have one already (Hint: use pod init).
  • Add this line to the Podfile: pod 'PebbleKit'
  • Run pod install

Integrating PebbleKit Using Carthage

  • Install Carthage or make sure it is up to date
  • Add Cartfile to your project if you don't have one already.
  • Add this line to the Cartfile: github "pebble/pebble-ios-sdk"
  • Run carthage bootstrap
  • Drag PebbleKit.framework into your project

Integrating PebbleKit Manually

  • Copy PebbleKit.framework somewhere in your project folder.
  • On your application target “General” settings tab, in the “Linked Frameworks and Libraries” section, drag and drop PebbleKit.framework.
  • Link CoreBluetooth.framework.
  • Add -ObjC linker flag to your project's build settings.

Additionally, since PebbleKit.framework is compiled for both the device and the simulator, when you upload your app to iTunes Connect, it might be rejected. To avoid this, you need to strip the simulator architectures from the binary before submitting. You can do this in many ways, but we will recommend using Carthage for simplicity:

  • Install Carthage or make sure it is up to date

  • On your application target “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase”. Create a Run Script with the following contents:

    /usr/local/bin/carthage copy-frameworks

    and add the paths to the framework under “Input Files”, e.g.:

    $(SRCROOT)/path/to/PebbleKit.framework
    

Integrating with PebbleKit-Static

PebbleKit-Static provides compatibility with iOS 7. We recommend you using PebbleKit, but if you need to provide versions of your app for older iOS version, you can still use this.

You can use PebbleKit-Static either using Cocoapods or manually. Carthage only supports dynamic frameworks, so PebbleKit-Static is not available for Carthage.

Additionally, in every point of the documentation that uses #import <PebbleKit/PebbleKit.h> you should use instead #import <PebbleKit-Static/PebbleKit.h>.

Using CocoaPods

  • Install CocoaPods or make sure it is up to date.
  • Add a Podfile to your project if you don’t have one already (Hint: use pod init).
  • Add this line to the Podfile: pod 'PebbleKit-Static'
  • Run pod install

Manually

  • Copy PebbleKit-Static.framework somewhere in your project folder.
  • On your application target “General” settings tab, in the “Linked Frameworks and Libraries” section, drag and drop PebbleKit-Static.framework.
  • Link CoreBluetooth.framework.
  • Add -ObjC linker flag to your project's build settings.

Configure Info.plist and capabilities

If you want your app to communicate with the Pebble while in the background, you will need to add background modes to your app target Info.plist:

  • Add the following entries to the UIBackgroundModes ("Required background modes") array:
  • bluetooth-peripheral ("App shares data using CoreBluetooth")
  • bluetooth-central ("App communicates using CoreBluetooth")

If you use background modes you also need to update your target's Capabilities in Xcode. Enable Background Modes and select:

  • Uses Bluetooth LE accessories
  • Acts as a Bluetooth LE accessory

If you are compiling in Xcode 8 or greater, you must additionally add the following key Info.plist (and it is recommended that you do so in older versions):

  • NSBluetoothPeripheralUsageDescription (“Privacy - Bluetooth Peripheral Usage Description”)

Xcode Documentation

You can browse the latest documentation online (and install an offline docset if you click on the icon on the top right).

Alternatively, manually install the docset from this folder:

  • An Xcode docset is included with documentation about all public APIs
  • Copy PebbleKit-ios.docset content into ~/Library/Developer/Shared/Documentation/DocSets
  • Restart Xcode. The documentation will now be available from Help > Documentation and API Reference

Submitting iOS apps with PebbleKit to Apple's App Store

In order for Pebble to work with iPhones, Pebble is part of the Made For iPhone program (a requirement for hardware accessories to interact with iOS apps). Unfortunately this also means that if you build an iOS app with PebbleKit, Pebble will need to whitelist your iOS app before you can upload it to the App Store. If you have completed a Pebble app and would like to learn more about making it available on the App Store, please visit the whitelisting guide

Change Log

4.0.0

  • Added: Support for Pebble 2.
  • Added: New superclass PBSemanticVersion. PBFirmwareVersion is now a subtype of PBSemanticVersion.
  • Added: New values SendTextSupported, NotificationsFilteringSupported, UnreadCoredumpSupport, and WeatherApp2 in PBRemoteProtocolCapabilitiesFlags.
  • Added: PBPebbleKitLogging type to customize the logging callback used by PebbleKit and the log level.
  • Changed: Remove outdated documentation for PBWatch. Improved documentation about -[PBWatch friendlyDescription].
  • Changed: Clean up the PBDataLoggingService header. Use modern type names and improve nullability annotations.
  • Changed: Added nullability annotations to NSDictionary+Pebble.h. Deprecated old methods without pb_ prefix and added alternative methods with pb_ prefixes instead.
  • Changed: Added nullability annotations to NSNumber+stdint.h. Deprecated old methods without pb_ prefix and added alternative methods with pb_.
  • Changed: Deprecated method for setting the default log level in PBPebbleCentral in favor of the new methods in PBPebbleKitLogging.
  • Changed: Communication with the watches (both through Classic and through LE) will not longer happen in the main thread. The callbacks will still be invoked in the main thread, and many methods are still documented as needed to be called from the main thread. We might lift those restrictions in the future, but they are still in place.
  • Changed: Clean up the Sports API and document and improve PBSportUpdate helper object.
  • Fixed: PebbleKit-Static uses the right header paths for Cocoapods.
  • Fixed: PebbleKit-Static is stripped of its debugs symbols, which should avoid printing some warnings.
  • Fixed: Golf and Sports do not need to add their UUID manually before using their APIs.
  • Fixed: Added correct nullability annotations for PBWatch (Golf) and PBWatch (Sports).
  • Fixed: Signature of appMessagesPushUpdate:withUUID:onSent: no longer declares a non-nullable NSError * named __nullableerror.
  • Fixed: Race condition that was making the communication with watch impossible.
  • Fixed: -[PBFirmwareVersion compare:] was reporting the wrong results for firmwares released far in the future.
  • Fixed: Connecting through Bluetooth LE should be more reliable.
  • Fixed: Don’t try connecting with devices that are not Pebble.
  • Fixed: Don’t try connecting with Pebble devices that are connected to other mobile devices.
  • Fixed: Added correct nullability annotation for PBVersionInfoCompletionBlock.
  • Fixed: Avoid crash while reconnecting to Bluetooth LE devices.
  • Deprecated: PBFirmwareVersion os, major, and minor, as well as the convenience initializer firmwareVersionWithOS:major:minor:suffix:commitHash:timestamp: has been deprecated. Use instead majorVersion, minorVersion, revisionVersion and firmwareVersionWithMajor:minor:revision:suffix:commitHash:timestamp:.
  • Removed: Support for Bluetooth Classic communication. Only Bluetooth LE is available. All devices in 3.x or later should be able to use Bluetooth LE, including the original Pebble and Pebble Steel. This should make communication from several third party apps a lot better.

3.1.1

  • Fixed: -[PBPebbleCentral lastConnectedWatch] is now properly marked as nullable.
  • Fixed: Avoid watches not connecting to the phone in some infrequent scenarios.
  • Fixed: When used from Objective-C++, -[PBWatch isNew] property doesn’t have the alias new to avoid problems with C++ reserved keywords.
  • Fixed: Added Bitcode to the dynamic frameworks, so apps that wants to use Bitcode can submit properly.

3.1.0

PebbleKit is now a dynamic framework.

If you want to support iOS 7.x add pod 'PebbleKit-Static' to your Podfile.

  • Added: Added workaround for Pebble 2.x / iOS 9 issue causing messages from watch not to arrive
  • Added: DataLogging now works better in multi-app setups.
  • Changed: DataLogging service is now created lazily when you try to use the API the first time
  • Changed: DataLogging won't unannounce server when you have Background Modes set
  • Changed: Lowered DeploymentTarget to 7.0 again
  • Fixed: DataLogging poll wouldn't be triggered on app launch
  • Fixed: appMessagesRemoveUpdateHandler not working as intended
  • Deprecated: dataLoggingService.pollForData - use pollForDataFromWatch: instead
  • Deprecated: central.dataLoggingService - use dataLoggingServiceForAppUUID: instead

3.0.0

  • Added: Support for Pebble Time Round
  • Added: Support for 8K app messages
  • Added: Support for Swift
  • Added: Support for Bitcode
  • Change: All appUUID properties are now NSUUID instead of NSData
  • Change: As soon as you set the delegate and the appUUID you must call run the central before you'll get any connection events: [[PBPebbleCentral defaultCentral] run]
  • Tip: Add bluetooth-peripheral and bluetooth-central to your UIBackgroundModes if your app should work while in the background
  • Tip: No need to check for lastConnectedWatch.isConnected at app launch anymore - just wait for the event after you invoked run
  • Tip: We removed PebbleVendor.framework. Keep it if you need it. Drop it otherwise to reduce the size of your app.

2.4

2.3

  • Removed: Bluetooth LE code from PebbleKit
  • Changes: Improvements to data logging to help troubleshoot issues
  • Removed: PBWatch+PhoneVersion and PBWatch+Polling
  • Fixed: PBWatch+Version report the correct version
  • Fixed: Crash when calling -[PBNumber description]
  • Changed: Imports now are using“HeaderName.h” format (instead of <PebbleKit/HeaderName.h>)
  • Fixed: Race-condition when sending data between phone and watch
  • Fixed: Made PebbleKit.podspec pass most-recent CocoaPod linter
  • Changed: Prefixed internally used logging classes to fix conflict when using CocoaLumberjack in your app
  • Changed: Made existing logging more descriptive

2.2

  • Removed: PBWatch+PhoneVersion
  • Fixed:PBWatch+Version reported the wrong version
  • Fixed: Crash when calling -[PBNumber description]

2.1

  • Changed: Improvements to data-logging to help troubleshoot issues

More Repositories

1

pebble-sdk-examples

Examples for Pebble SDK
Objective-C
373
star
2

rockyjs

JS Powered Pebbles in Your Browser
JavaScript
250
star
3

cloudpebble

CloudPebble source. Here be dragons.
Python
211
star
4

pebble-3d

3D drawings of Pebble
166
star
5

slate

[Deprecated] Front-end framework for developing Pebble mobile configuration pages.
CSS
128
star
6

clay

Pebble Config Framework
JavaScript
121
star
7

pebble-android-sdk

Android PebbleKit SDK to talk to the Pebble via Bluetooth
Java
119
star
8

qemu

Pebble fork of qemu
C
98
star
9

libpebble2

The library portion of the successor to libpebble
Python
64
star
10

pebble-api-node

Pebble API client for Node.js
JavaScript
53
star
11

joi-objectid

A MongoDB ObjectId validator for Joi
JavaScript
43
star
12

event-loop-lag

Measure Node.js event loop lag.
JavaScript
42
star
13

yieldb

Simple, expressive and yieldable MongoDB
JavaScript
40
star
14

ArduinoPebbleSerial

Arduino library for communicating with Pebble Time via the Smartstrap port
C++
32
star
15

community-resources

Submit your Pebble tools and examples!
29
star
16

pypkjs

Python implementation of PebbleKit JS
Python
29
star
17

pebble-tool

The pebble tool that goes with libpebble2
Python
23
star
18

cloudpebble-composed

Local development setup for CloudPebble
Shell
21
star
19

homebrew-pebble-sdk

Pebble Homebrew Tap
Ruby
16
star
20

pybluetooth

Python Bluetooth Library
Python
13
star
21

goodthink

The happiness measuring app
C
12
star
22

joi-router-swagger-docs

Swagger doc generator for koa-joi-router
JavaScript
10
star
23

keen-cache

A node js caching proxy for keen.io
JavaScript
9
star
24

github-digest

Report on github pull request activity
Go
8
star
25

lambda-aws-pagerduty-alerts

Make AWS alerts to PagerDuty behave nicer by flowing them through a lambda function
Python
7
star
26

flotilla

Lightweight alternative to fleet, optimized for AWS.
Python
7
star
27

docker-cloudwatch-stats

Docker container that posts memory/disk stats from an EC2 instance to Cloudwatch
Shell
5
star
28

cloudpebble-qemu-controller

Controls qemus.
Python
5
star
29

pyv8

Pebble fork of PyV8
Python
5
star
30

airbrite-ruby

Ruby bindings for the Airbrite API.
Ruby
5
star
31

pebble-waf-tools

A collection of waf tools for use with the Pebble SDK
Python
5
star
32

hackmit-2013

Presentation and example project for #HackMIT 2013
C
4
star
33

docker-aws-cli

A simple docker that allows you to pass through aws-cli commands
4
star
34

cloudpebble-buildpack

Heroku buildpack for CloudPebble
Shell
3
star
35

has-own

A safer .hasOwnProperty() where property name comes first: `hasOwn(name, obj)`
JavaScript
3
star
36

qemu-tintin-images

3
star
37

cloudpebble-nameserver

Very simple DNS server for pebble-sockets.com
Python
3
star
38

cloudpebble-ycmd-proxy

Handles communication with the autocompletion daemon(s) on behalf of CloudPebble clients.
Python
3
star
39

mongodb-tailor

Tail your mongodb collections with style
JavaScript
3
star
40

toilet-time

Arduino/Web/Pebble Application for determining the optimal time to use the toilet
Swift
3
star
41

qemu-binaries

QEMU Binaries for the Pebble emulator
3
star
42

qdog

Module used for adding and reading from SQS and eventually Redis
JavaScript
2
star
43

pyv8-prebuilt

Prebuilt versions of pyv8
Python
2
star
44

openocd

Openocd fork with support for our modified version of freertos
C
2
star
45

lambda-queue-worker

An infinitely scalable and cheap queue worker template for NodeJS functions.
JavaScript
2
star
46

spacel-provision

Space Elevator provisioner
Python
2
star
47

fastly-log

Fluentd Dockerfile to forward fastly events to TreasureData
2
star
48

eslint-config-pebble

eslint shareable config for pebble
JavaScript
2
star
49

jsconf2015-schedule

Example Application that populates a Pebble Timeline Topic with a schedule of events.
JavaScript
1
star
50

rocky-repl

Super hacky REPL, entirely implementing using only public API
JavaScript
1
star
51

spacel-agent

Space Elevator Agent
Python
1
star
52

cloudpebble-ws-proxy-standalone

Cloudpebble developer connection websocket proxy
JavaScript
1
star
53

joi-authorization-header

A request authorization header Joi validator
JavaScript
1
star
54

restrict-resource-webpack-plugin

Webpack plugin that returns an error message when a resource/module matches a given regular expression
JavaScript
1
star