Contents

brivo-mobile-team/brivo-mobile-sdk-ios

Brivo iOS Mobile SDK

Configuration

Before using the Brivo Mobile SDK it is mandatory to configure (through instance) of BrivoSDK class with a BrivoSDKConfiguration object.

BrivoSDK configuration usage
    do {
        let brivoConfiguration = try BrivoSDKConfiguration.Builder(
            clientId: "CLIENT_ID",
            clientSecret: "CLIENT_SECRET",
            useSDKStorage: true/false)
            .region(.eu/.us)
            .authUrl("Brivo_OnAir_Auth_URL")
            .apiUrl("Brivo_OnAir_API_URL")
            .brivoBLEAllegionConfiguration() // required for BrivoBLEAllegion, otherwise optional
            .build()
            BrivoSDK.instance.configure(brivoConfiguration: brivoConfiguration)
    } catch let error {
        //Handle BrivoSDK configuration exception
    }

The exception is thrown if the BrivoSDKConfiguration class is not initialized correctly. For example one of the parameters is nil or empty string.

Examples of usage:

BrivoSDKAccess unlock access point usage with internal stored credentials
    for try await result in await BrivoSDKAccess.instance().unlockAccessPoint(passId: "PASS_ID",
                                                                              accessPointId: "ACCESS_POINT_ID",
                                                                              unlockStrategy: UnlockStrategy?,
                                                                              cancellationSignal: CancellationSignal) {
        // Handle the result received throught AsyncThrowingStream
    }
BrivoSDKAccess unlock access point usage with external credentials
    let selectedAccessPoint = BrivoSelectedAccessPoint(accessPointId: ...,
                                                       userId: ...,
                                                       readerUid: ...,
                                                       bleCredentials: ...,
                                                       timeframe: ...,
                                                       passId: ...,
                                                       brivoApiTokens: BrivoTokens(...)) 
    
    for try await result in await BrivoSDKAccess.instance().unlockAccessPoint(selectedAccessPoint: selectedAccessPoint,
                                                                              unlockStrategy: UnlockStrategy?,
                                                                              cancellationSignal: CancellationSignal)  {
        // Handle the result received throught AsyncThrowingStream
    }
BrivoSDKAccess refresh credentials used for optional modules
    let brivoOnAirPass = BrivoOnairPass() // Brivo credential received after redeeming a Brivo mobile pass 

    let refreshCredentialsResult = await BrivoSDKAccess.instance().refreshCredentials(passes: [brivoOnAirPass])
        // This method initializes the optional modules (e.g. BrivoBLEAllegion) and refreshes the credentials for unlocking non-Brivo type doors (e.g. Allegion, RealSync)

<a id="brivo_ble_allegion"></a>

BrivoBLEAllegion - Optional

This module acts as wrapper for AllegionSDKs and is an optional dependendency for BrivoAccess to unlock Allegion devices.

[!NOTE] Using this module requires access to Allegion SDKs (see Podfile).\ Allegion SDKs come with a limitation: arm64 architecture is excluded so the app runs only on simulators with Rosetta.

Issues

If you run into any bugs or issues, feel free to post an Issues to discuss further. <p align="center"> Made with ❤️¸ at <img src="brivo.png" width="60"/> </p>

Package Metadata

Repository: brivo-mobile-team/brivo-mobile-sdk-ios

Stars: 3

Forks: 0

Open issues: 3

Default branch: main

Primary language: objective-c

License: Apache-2.0

Topics: brivo, ios, mobile-sdk

README: README.md