configure

fun configure(application: Application, configOptions: ConfigOptions)

Initialize and configure the Flybuy SDK using the application and ConfigOptions.

Flybuy needs to be setup and configured at application launch. However, it does not run in the background or use device resources until there is an active order.

The easiest way to configure Flybuy in your app is to extend the FlyBuyApplication and call the configure method from onCreate() to setup the API token as follows:

class MyApplication : FlyBuyApplication() {

override fun onCreate() {
super.onCreate()
FlyBuyCore.configure(this, ConfigOptions.Builder(appTokenKey)
.build())
}
}

WorkManager

Flybuy schedules background work -- refreshing its configuration, sending queued analytics, and monitoring beacons in Flybuy Notify -- through WorkManager. If nothing in the app has initialized WorkManager by the time Flybuy needs it, the SDK initializes it with the default Configuration.

To supply your own configuration, implement androidx.work.Configuration.Provider on your Application class; Flybuy always defers to it and will not initialize WorkManager itself. Calling WorkManager.initialize after configure is not supported and will throw "WorkManager is already initialized".


fun configure(context: Context, appTokenKey: String)
fun configure(application: Application, appTokenKey: String)

Deprecated

Use configure(application, configOptions) instead.

Replace with

FlyBuyCore.configure(application, ConfigOptions.Builder(appTokenKey).build())

fun configure(application: Application, baseUrl: String?, appTokenKey: String, logLevel: Int = FlyBuyLogging.DEFAULT_LOG_LEVEL, internalLogLevel: Int = FlyBuyLogging.DEFAULT_INTERNAL_LOG_LEVEL)

Deprecated

Use configure(application, configOptions) instead.

Replace with

FlyBuyCore.configure(application, ConfigOptions.Builder(appTokenKey).setBaseUrl(baseUrl).setLogLevel(logLevel).setInternalLogLevel(internalLogLevel).setDeferredLocationTrackingEnabled(false).build())