TKMServiceFactoryBuilder

This class is used to build a TKMServiceFactory.

The example below illustrates a default use of this class and will cover most use cases:

 let b = TKMServiceFactoryBuilder()
 let tapkeyServiceFactory = b.build()

See also

TKMServiceFactory
  • Overrides the internal server clock used by various components of the SDK. If applications require access to the server clock, they must use this method to override the SDK’s internal server clock and keep hold of the reference for later use.

  • Overrides the default Tapkey environment configuration with the specified one. Must only be used if suggested by Tapkey.

  • Reserved for internal use.

  • Reserved for internal use.

  • Reserved for internal use.

  • Sets the application’s token refresh handler. The SDK will call this handler to request renewal of access tokens.

    @see TokenRefreshHandler

  • Sets the application’s push notification provider. The SDK will call this handler to request push notification registration tokens.

    @see TokenRefreshHandler

  • Reserved for internal use.

  • Reserved for internal use.

  • Reserved for internal use.

  • Sets the application group id to share Tapkey data between apps and extensions.

    App groups is an iOS API feature to share data between explicitly defined apps and extensions. Before using it, it must be configured according to the Apple documentation.

    Data migration

    When no app group has been used yet or a different app group should be used, data can be automatically migrated. To enable migration set migrateData to true.

    Warning

    This is only safe to use from a single application of app group. When multiple apps use data migration, it will cause data loss or inconsistent data!

    Data migration between different app groups

    To move data from an app group to a different app group the parameter fromAppGroupId can be used. When fromAppGroupId is not set or set to nil, data will be moved from the app container.

    Warning

    App must have access to both app groups for data migration

    Warning

    Data can only be migrated between given groups. When the app group has changed more than once and the app did not recognize each migration, data will be lost. Be sure about these consequences when migrating the app group.

    Data migration back to app container

    To move data from app group back to app container, the parameter appGroupId must be set nil and the fromAppGroupId must be set to the app group, where the data was stored before.

    Warning

    Data can only be migrated between given groups. When the app group has changed more than once and the app did not recognize each migration, data will be lost. Be sure about these consequences when migrating the app group.

    Important

    Use data migration with care. It might cause data loss or inconsistent data!