Producing APK

Build two APKs one with keeping the launcher intent filter for MainActivity and the other without keeping the launcher intent filter for MainActivity. While building and providing WinZO APK do the following changes for the main activity in the manifest file.

Keeping the launcher intent filter This is for Android 10 and above devices

<activity
    android:name="com.base.aidllib.MainActivity"
    android:exported="true"
    android:theme="@style/SplashTheme">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    <intent-filter>
        <action android:name="com.base.aidllib.MainActivity" />
    </intent-filter>
</activity>

Not keeping the launcher intent filter This is for Android 9 and below devices

<activity
    android:name="com.base.aidllib.MainActivity"
    android:exported="true"
    android:theme="@style/SplashTheme">
    <intent-filter>
        <action android:name="com.base.aidllib.MainActivity" />
    </intent-filter>
</activity>

Building Apk

  1. Build two APKs with and without the launcher intent filters

  2. Please include firebase crashlytics for crash tracking of the product.

  3. Add Product Flavours in your app module build.gradle And WinzoSdk modules build.gradle

android {
...
    productFlavors {
        live {
            buildConfigField "boolean", "is_live", "true"
            buildConfigField "boolean", "is_stag", "false"
            dimension "api"
        }
        stag {
            buildConfigField "boolean", "is_stag", "true"
            buildConfigField "boolean", "is_live", "false"
            dimension "api"
        }
    }
}

Analytics Use WinzoSdk.connectToWinZO method to connect to WinZO. We Receive a WinZOClient in onConnectedToWinZO(winZOClient: WinZOClient) callback use this client to log events winZOClient.logEvent("Log Dummy Event") If we want to add parameters to an event pass a bundle in logEvent method

connectToWinZO(WeakReference(this), object : IWinZOConnectionListener {
    override fun onConnectedToWinZO(winZOClient: WinZOClient) {
        winZOClient.logEvent("Log Dummy Event", Bundle().apply {
            putString("parameter name", "parameter name")
        })
    }

    override fun onDisConnectedToWinZO() {
    }
})

Last updated