Application Provider
Convenience provider class to initialize the Olo Pay SDK without needing to create an Application subclass
Usage Details:
To initialize the Olo Pay SDK (and perhaps other libraries that need the application context) do the following:
Add the following provider tag to your manifest
<provider
android:authorities="your.package.name"
android:name="com.olo.olopay.bootstrap.ApplicationProvider"
android:exported="false" />Call ApplicationProvider.listen
val InitializeOloPaySDK by lazy {
ApplicationProvider.listen { application ->
OloPayApiInitializer().setup(application.applicationContext, SetupParameters(false))
}
}
class MyActivity : AppCompatActivity() {
init {
InitializeOloPaySDK
}
}
Important:
This is not the only way to initialize the Olo Pay SDK. See ApplicationInitializer for an alternative approach as well