To integrate SuprSend in your Android app, initialise the Suprsend android sdk in MainApplicaNtion inside onCreate method and just above super.onCreate() line.
class MyApplication :Application(){overridefunonCreate(){ SSApi.init(this,"WORKSPACE KEY","WORKSPACE SECRET")super.onCreate()}}
Replace WORKSPACE KEY and WORKSPACE SECRET with your workspace values. You will get both the tokens from Suprsend API Keys page (Settings page -> "API keys" section)
By default the logs of SuprSend SDK are disabled. We recommend you to enable the SDK logs by setting its value to VERBOSE. You can enable the logs just in debug mode while in development by below condition.
ssApi.setLogLevel(level: LogLevel)if(BuildConfig.DEBUG) ssApi.setLogLevel(LogLevel.VERBOSE)or//You can send the sdk exception to your crashlytics serverSSApi.setLogger(object: LoggerCallback {overridefuni(tag: String, message: String){// you will receive sdk info messages here}overridefune(tag: String, message: String, throwable: Throwable?){ throwable ?:return//Ex - FirebaseCrashlytics.getInstance().recordException(throwable)}})
For creating a release build you will need to add these below pro-guard rules:
# SuprSend Sdk-dontwarn app.suprsend.**-keep class app.suprsend.**{*;}# Xiaomi-keep class app.suprsend.xiaomi.SSXiaomiReceiver {*;}#SDK has been obfuscated and compressed to avoid class not found error due to re-obfuscation.-keep class com.xiaomi.**#If the compiling Android version you are using is 23, you can prevent getting a false warning which makes it impossible to compile.-dontwarn com.xiaomi.push.**-keep class com.xiaomi.mipush.sdk.MiPushMessage {*;}-keep class com.xiaomi.mipush.sdk.MiPushCommandMessage {*;}-keep class com.xiaomi.mipush.sdk.PushMessageReceiver {*;}-keep class com.xiaomi.mipush.sdk.MessageHandleService {*;}-keep class com.xiaomi.push.service.XMJobService {*;}-keep class com.xiaomi.push.service.XMPushService {*;}-keep class com.xiaomi.mipush.sdk.PushMessageHandler {*;}-keep class com.xiaomi.push.service.receivers.NetworkStatusReceiver {*;}-keep class com.xiaomi.push.service.receivers.PingReceiver {*;}-keep class com.xiaomi.mipush.sdk.NotificationClickedActivity {*;}}