Setting Up - iOS

Quick setup guide how to install our iOS SDK into your application

Prerequisites

  1. Activate your profile & your Notches first. If you need help follow the activation docs
  2. Navigate to Dashboard / [Your application name] / Credentials
Where to find credentials
Where to find credentials
  1. Set up your ~/.netrc file. If you don’t have it, create it now.
    • Copy the credentials from the developer page.
machine wearnotch.com
  login {yourUserName}
  password {yourPassword}

Using with CocoaPods

Our SDK can be accessed only with cocoapods. If your are unfamiliar with it, please follow this document then return back when you are ready.

Installing the latest dependency

Use the following entry in your Podfile:

pod 'WearnotchSDK', :podspec => "https://s3.amazonaws.com/wearnotch-media/public/iOS-Releases/{latest_version_number}.json"

Latest version is available in the changelogs

Then use this command in the project directory:

pod install

If you have any problem with the locked Alamofire version, simply remove that line from the Podfile.lock and execute the install again.

Use the generated .xcworkspace from now on.

In any file you’d like to use WearnotchSDK in, don’t forget to import the framework with import WearnotchSDK.

Permissions

Do not forget to specify the following Bluetooth privacy options in your application info.plist file:

<key>NSBluetoothPeripheralUsageDescription</key>
<string>$(PRODUCT_NAME) needs bluetooth access Notches via bluetooth.</string>

<key>NSBluetoothAlwaysUsageDescription</key>
<string>$(PRODUCT_NAME) needs bluetooth access Notches via bluetooth.</string>

Usage

Create a singleton service:

public static let service = try! NotchAPI.Builder().build().service

Good to know If you want to develop your app without using notches it is possible to use a ‘mock’ build of the service. All the service calls will return with success after a short delay. Create a service by setting the ‘isMock’ property to true:

public static let service = try! NotchAPI.Builder()
  .build(isMock: true)
  .service

Prerequisites
Setting Up - Android