ApplicationProvider

class ApplicationProvider : BaseProvider

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:

  1. Add the following provider tag to your manifest

     <provider
    android:authorities="your.package.name"
    android:name="com.olo.olopay.bootstrap.ApplicationProvider"
    android:exported="false" />
  2. 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

Types

Companion
Link copied to clipboard
object Companion

Convenience object for Application-related properties and listeners