main.com.wisetrack.sdk.WiseTrackPreinstallReferrerReceiver.kt Maven / Gradle / Ivy
The newest version!
package com.wisetrack.sdk
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.wisetrack.sdk.Constants.Companion.EXTRA_SYSTEM_INSTALLER_REFERRER
/**
@author hamed (@hamed-hsb)
* @since 19th October 2021
*
* You have to add this broadcast to manifest file like this:
*
*
*
*
*
*
*/
class WiseTrackPreinstallReferrerReceiver : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
if (intent == null) {
return
}
val referrer = intent.getStringExtra(EXTRA_SYSTEM_INSTALLER_REFERRER) ?: return
WiseTrack.getDefaultInstance().sendPreinstallReferrer(referrer, context)
}
}