Skip to content

Commit

Permalink
WMRUSTORE-22: Prepare example app for rustore release
Browse files Browse the repository at this point in the history
  • Loading branch information
enotniy committed Feb 3, 2025
1 parent f22154a commit d8c36ab
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
3 changes: 3 additions & 0 deletions example/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ android {
buildConfig = true
}
buildTypes {
release {
signingConfig signingConfigs.debug
}
debug {
signingConfig signingConfigs.debug
}
Expand Down
3 changes: 3 additions & 0 deletions example/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="ru.rustore.sdk.pushclient.project_id"
android:value="RU_STORE_PROJECT_ID" />
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@ class ExampleApp : Application() {
.subscribeCustomerIfCreated(true)
.build()

//https://developers.mindbox.ru/docs/android-sdk-methods#setloglevel
if (BuildConfig.DEBUG) {
Mindbox.setLogLevel(level = Level.DEBUG)
}

//https://developers.mindbox.ru/docs/android-sdk-methods#initpushservices
Mindbox.initPushServices(
context = applicationContext,
pushServices = listOf(MindboxFirebase, MindboxHuawei, MindboxRuStore(RU_STORE_PROJECT_ID))
pushServices = listOf(MindboxFirebase, MindboxHuawei, MindboxRuStore)
)
//https://developers.mindbox.ru/docs/android-sdk-methods#init
Mindbox.init(
application = this,
configuration = configuration,
pushServices = listOf(MindboxFirebase, MindboxHuawei, MindboxRuStore(RU_STORE_PROJECT_ID))
pushServices = listOf(MindboxFirebase, MindboxHuawei, MindboxRuStore)
)

//https://developers.mindbox.ru/docs/android-sdk-methods#setloglevel
if (BuildConfig.DEBUG) {
Mindbox.setLogLevel(level = Level.DEBUG)
}

//https://developers.mindbox.ru/docs/in-app#inappcallback
chooseInappCallback(selectedInappCallback = RegisterInappCallback.DEFAULT)
//https://developers.mindbox.ru/docs/android-sdk-methods#setmessagehandling-since-261
Expand Down
8 changes: 4 additions & 4 deletions example/app/src/main/java/com/mindbox/example/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,16 @@ class MainActivity : AppCompatActivity() {
//https://developers.mindbox.ru/docs/android-sdk-methods#subscribepushtoken-%D0%B8-disposepushtokensubscription
var subscriptionPushToken = ""
subscriptionPushToken =
Mindbox.subscribePushToken { token ->
Mindbox.subscribePushTokens { tokens ->
runOnUiThread {
binding.tvTokenResult.text = token
binding.tvTokenResult.text = tokens
//https://developers.mindbox.ru/docs/android-sdk-methods#getpushtokensavedate
binding.tvTokenDateResult.text = Mindbox.getPushTokenSaveDate()
binding.tvTokenDateResult.text = Mindbox.getPushTokensSaveDate().toString()
}
Mindbox.disposePushTokenSubscription(subscriptionPushToken)
}

//https://developers.mindbox.ru/docs/android-sdk-methods#getsdkversion
binding.tvSdkVersionResult.text = Mindbox.getSdkVersion()
}
}
}

0 comments on commit d8c36ab

Please sign in to comment.