License | Commercial |
ReleasedLast Release | Nov 2016 |
Maintained by Heiko Behrens, Pebble Technology, Marcel Jackwerth.
Welcome to Pebble's official iOS SDK!
All Pebble SDK examples are available on GitHub.
You can also run pod try PebbleKit
to jump into a simple project right away.
PebbleKit.framework
somewhere in your project folder.PebbleKit.framework
.CoreBluetooth.framework
.-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:
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
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>
.
PebbleKit-Static.framework
somewhere in your project folder.PebbleKit-Static.framework
.CoreBluetooth.framework
.-ObjC
linker flag to your project's build settings.Info.plist
and capabilitiesIf 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
:
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:
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”)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:
PebbleKit-ios.docset
content into ~/Library/Developer/Shared/Documentation/DocSets
Help > Documentation and API Reference
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
PBSemanticVersion
. PBFirmwareVersion
is now a subtype of PBSemanticVersion
.SendTextSupported
, NotificationsFilteringSupported
, UnreadCoredumpSupport
, and WeatherApp2
in PBRemoteProtocolCapabilitiesFlags
.PBPebbleKitLogging
type to customize the logging callback used by PebbleKit and the log level.PBWatch
. Improved documentation about -[PBWatch friendlyDescription]
.PBDataLoggingService
header. Use modern type names and improve nullability annotations.NSDictionary+Pebble.h
. Deprecated old methods without pb_
prefix and added alternative methods with pb_
prefixes instead.NSNumber+stdint.h
. Deprecated old methods without pb_
prefix and added alternative methods with pb_
.PBPebbleCentral
in favor of the new methods in PBPebbleKitLogging
.PBSportUpdate
helper object.PBWatch (Golf)
and PBWatch (Sports)
.appMessagesPushUpdate:withUUID:onSent:
no longer declares a non-nullable NSError *
named __nullableerror
.-[PBFirmwareVersion compare:]
was reporting the wrong results for firmwares released far in the future.PBVersionInfoCompletionBlock
.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:
.-[PBPebbleCentral lastConnectedWatch]
is now properly marked as nullable
.-[PBWatch isNew]
property doesn’t have the alias new
to avoid problems with C++ reserved keywords.PebbleKit is now a dynamic framework.
If you want to support iOS 7.x
add pod 'PebbleKit-Static'
to your Podfile
.
appMessagesRemoveUpdateHandler
not working as intendeddataLoggingService.pollForData
- use pollForDataFromWatch:
insteadcentral.dataLoggingService
- use dataLoggingServiceForAppUUID:
insteadappUUID
properties are now NSUUID
instead of NSData
[[PBPebbleCentral defaultCentral] run]
bluetooth-peripheral
and bluetooth-central
to your UIBackgroundModes
if your app should work while in the backgroundlastConnectedWatch.isConnected
at app launch anymore - just wait for the event after you invoked run
PebbleVendor.framework
. Keep it if you need it. Drop it otherwise to reduce the size of your app.PBWatch+PhoneVersion
and PBWatch+Polling
PBWatch+Version
report the correct version-[PBNumber description]
“HeaderName.h”
format (instead of <PebbleKit/HeaderName.h>
)PebbleKit.podspec
pass most-recent CocoaPod linterPBWatch+PhoneVersion
PBWatch+Version
reported the wrong version-[PBNumber description]