Driver SDK for iOS

Overview

The Bringg Driver SDK for iOS allows you integrate Bringg functionality into your own iOS host apps using Bringg user login-related, shift-related, and task-related methods and events, as well as log reporting features. The SDK provides the internal functionality and you can customize your apps using that functionality. The Bringg Driver SDK for iOS is distributed as a precompiled framework and is accessible via the Bringg singleton.

The Bringg singleton contains references to Bringg Driver SDK for iOS "managers", where each manager provides a set of functionality. Objects in your host apps can register as delegates receiving notifications on events occurring as a result of your manager method calls and the SDK's internal logic.

The Bringg Driver SDK for iOS uses the multiple delegation design pattern. The SDK provides advantages including multicasting messages, no risk of retain cycles, easy mocking for unit testing, and the ability for you to use dependency injection in your host apps.

👍

Objective-C

You can adapted the Bringg Driver SDK for iOS into Objective-C.

📘

Bringg-iOS-DriverSDK in GitHub

The Bringg Driver SDK for iOS is available in the Bringg-iOS-DriverSDK GitHub repo.

Features

loginManager

The loginManager features include:

shiftManager

The shiftManager features include:

tasksManager

The tasksManager features include:

logReportManager

The logReportManager features include logging:

Multiple Delegation Design Pattern

📘

Delegate Protocols Are Optional

If an object does not require event notifications, it does not need to be a delegate and you do not need to use the delegate protocol for its class.

The Bringg Driver SDK for iOS uses the multiple delegation pattern. Bringg functionality is implemented using Bringg Driver SDK for iOSmanagers” and their delegates. Each manager conforms to its own protocol which defines its API, including the methods that the you can use for Bringg functionality. Optionally, objects can register as delegates of a manager, implement the methods required by the delegate protocol for that manager, and receive event notifications on events related to that manager. Using the multiple delegation design pattern, the SDK communicates with the host app notifying all objects registered as delegates of managers on all events related these managers.

📘

Observer Pattern

The multiple delegation pattern is similar to the observer pattern.

For example, the Bringg Driver SDK for iOS includes loginManager for user login-related events. The loginManager defines the login-related API, including methods to login, request confirmation codes, resend passwords, and logout. Using the multiple delegation design pattern, objects can receive notifications for login and logout events. To register your object as a delegate of loginManager, your object must (1) conform to the UserEventsDelegate, (2) implement all the methods in the UserEventsDelegate, and (3) register itself as a loginManager delegate. Once registered, your object receives login and logout event notifications using the UserEventsDelegate methods, including userDidLogin and userDidLogout.

Advantages of the Bringg Driver SDK for iOS

Multicasting Messages

Multiple delegation allows multicasting messages to all objects in the system that require notification. Unlike NSNotificationCenter, the multiple delegation design pattern allows strongly typed messages on events.

No Risk of Retain Cycles

The Bringg Driver SDK for iOS creates no risk of creating a retain cycle, because managers hold weak references to their delegates.

Mocking for Unit Testing

Bringg Driver SDK for iOS managers are mockable for unit testing.

Dependency Injection

You can use dependency injection in your host apps.

Versioning

Bringg Driver SDK for iOS versioning for releases and compatibility is as follows:

  • Major version number
    • Introduces new functionality and other changes
    • May be incompatible with previous major versions
  • Minor version number
    • May introduce new functionality and other changes
    • Is backwardly compatible within the same major version
  • Patch number
    • No new functionality
    • Introduces bug fixes and may include other minor changes
    • Is backwardly compatible within the same major version

📘

Getting Started

To setup your project with the Bringg Driver SDK for iOS, see Getting Started