Protocols

The following protocols are available globally.

  • Handles refreshing of authentication information. Needs to be implemented by the user of the SDK and passed to the Tapkey service factory builder prior to logging in the first users.

    See more
  • The BLE (Bluetooth Low Energy) lock communicator provides means to communicate with Tapkey locks via BLE. It can be used to send commands to locks.

    Use TKMServiceFactory to retrieve an instance of BleLockCommunicator.

    See more
  • The BLE (Bluetooth Low Energy) lock scanner provides means to scan for Tapkey locks via BLE. It can be used to scan for nearby locks and to determine whether a specific lock is nearby.

    Use TKMServiceFactory to retrieve an instance of BleLockScanner.

    See more
  • Objects that allow cancelling long running operations. They are most often used to control async program flows in conjunction with TKMPromise<T>. Cancellation tokens can be produced using

    See also

    TKMPromise<T>
    See more
  • A registration returned by TKMCancellationToken.register(observer:). Can be used to cancel the registration.

    See more
  • Offers commands to be executed on Tapkey locks. Methods of this class expect a TLCP connection to a Tapkey lock and take a cancellation token for execution control.

    The example below outlines a possible usage of triggerLockAsync(lock:cancellationToken:). In the present example, the required TLCP connection is established using the TKMBleLockCommunicator.

    // The Bluetooth Communicator establishes a connection to the Tapkey lock via Bluetooth and lets
    // the CommandExecutionFacade use this connection to execute a TriggerLock command.
    return bleLockCommunicator.executeCommandAsync(bluetoothAddress, physicalLockId, { tlcpConnection in
    
        // Now, with the TlcpConnection to the lock available, the TKMCommandExecutionFacade
        // asynchronously executes the trigger lock command.
        return commandExecutionFacade.triggerLockAsync(tlcpConnection, cancellationToken: ct)
    
    }, ct).continueOnUi { commandResult -> Bool in
    
        switch (commandResult.code) {
            case Ok:
                return true
            // Handle error results.
            ...
        }
        return false
    
    }.catchOnUi { e -> Bool in
    
        Log.e(TAG, "Could not execute trigger lock command.", e)
        if (!ct.isCancellationRequested()) {
             // Handle any exceptions and let the user know, something went wrong.
        }
        return false
    
    }
    
    See more
  • Reserved for internal use.

    See more
  • The key manager provides access to the available mobile keys on this device. The SDK fetches mobile keys for all logged-in users and stores them locally when NotificationManager.pollForNotificationsAsync(cancellationToken:) is called. The key manager then takes care of automatically renewing local mobile keys in time. The SDK does not return the actual mobile keys, but only a set of details about the key.

    See more
  • Provides methods to poll for updates from the Tapkey Trust Service.

    See more
  • The TKMPushNotificationManager takes care of incoming push notifications and updated registration tokens.

    See more
  • The support manager provides access to information about the current environment. Information returned by this class may be included in crash reports, logs etc. to make it easier to investigate issues with the SDK.

    See more
  • The user manager takes care of user authentication and provides access to the currently logged-in users.

    The following code sample illustrates how to use this class to retrieve the list of logged-in users.

    let userManager = tapkeyServiceFactory.userManager
    let users = userManager.users
    
    // Now, users contains a list of IDs of all logged-in users. Usually, users.count will be 1,
    // however, it is possible to log in multiple users at the same time.
    

    The exemplary code below demonstrates how to log in a user:

    let userManager = tapkeyServiceFactory.userManager
    userManager.logInAsync(accessToken: tapkeyAccessToken, cancellationToken: ct)
    

    Implementors have to make sure that a token refresh handler was set via the TKMServiceFactory builder prior to logging in any users.

    See more
  • Defines the environment for the Tapkey Mobile SDK. Unless suggested otherwise by Tapkey, an instance of a environment configuration retrieved from the SDKs environment config builder class must be used.

    See more
  • Provider for tokens that can be used for sending push notifications to this app. Tapkey will pass the returned tokens to the push notification service used by this app (e.g. FCM) when sending push notifications to it.

    See more
  • The Tapkey service factory provides access to core components of the Tapkey Mobile SDK. This interface is not to be implemented by consuming applications. Instead, the platform-specific factory builders are to be used to retrieve an instance.

    See more
  • Provides an interface to a Logger object that is used to log messages.

    See more
  • An object that represents the registration on an Observable. An ObserverRegistration can be used to unregister an Observable.

    See more