Created
March 28, 2021 15:33
-
-
Save seoft/f8cd7cd8f69b5b0f60a6448e9c3cebb2 to your computer and use it in GitHub Desktop.
processRemoteConfig4.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
processRemoteConfig4.createRxSingleRemoteConfig() | |
.subscribeOn(Schedulers.io()) | |
.observeOn(AndroidSchedulers.mainThread()) | |
.subscribe({ | |
it.run { | |
when (this) { | |
is RemoteConfigResult.Run -> { | |
Log.d(TAG, "onRun $message $etc") | |
startActivity(Intent(baseContext, MainActivity::class.java)) | |
finish() | |
} | |
is RemoteConfigResult.LowVersion -> { | |
Log.d(TAG, "onLowVersion $message $etc") | |
// message is "Get a new version from the Play Store" | |
Toast.makeText(baseContext, message, Toast.LENGTH_LONG).show() | |
finish() | |
} | |
is RemoteConfigResult.Block -> { | |
Log.d(TAG, "onBlock $message $etc") | |
Toast.makeText(baseContext, message, Toast.LENGTH_LONG).show() | |
finish() | |
} | |
} | |
} | |
}, { | |
it.printStackTrace() | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment