config static method

TikiSdk config()

Starts the configuration process for the Tiki SDK instance.

This method returns the shared instance of the Tiki SDK, which can be used to configure the SDK before initializing it. You can access instance variables such as theme or offer, and call methods such as disableAcceptEnding(_:) and onAccept(_:) on the returned instance to customize the SDK behavior to your needs.

After the configuration is complete, you can initialize the SDK by calling initialize(publishingId:id:onComplete:). Once the SDK is initialized, it is recommended to use the static methods instead of accessing the shared instance directly to avoid unnecessary dependency injection.

To configure the Tiki SDK, you can use the builder pattern and chain the methods to customize the SDK behavior as needed. Here's an example:

TikiSdk.config()
   .theme
       .primaryTextColor(.black)
       .primaryBackgroundColor(.white)
       .accentColor(.green)
       .and()
   .dark
       .primaryTextColor(.white)
       .primaryBackgroundColor(.black)
       .accentColor(.green)
       .and()
   .offer
       .bullet(text: "Use for ads", isUsed: true)
       .bullet(text: "Share with 3rd party", isUsed: false)
       .bullet(text: "Sell to other companies", isUsed: true)
       .ptr("offer1")
       .use(usecases: [LicenseUsecase(LicenseUsecaseEnum.support)])
       .tag(TitleTag(TitleTagEnum.advertisingData))
       .duration(365 * 24 * 60 * 60)
       .permission(Permission.camera)
       .terms("terms.md")
       .add()
   .onAccept { offer, license in ... }
   .onDecline { offer, license in ... }
   .disableAcceptEnding(false)
   .disableDeclineEnding(true)
   .initialize(publishingId: publishingId, id:id, onComplete: {...})
  • Returns: The shared instance of the Tiki SDK.

Implementation

static TikiSdk config() => instance;