Skip to content

SergeiMikhailovskii/kmp-app-review

Repository files navigation

kmp-app-review

Publish new version GitHub Tag

What is it?

Library that allows to launch in app (or in market) review from the KMP shared code

Which platforms are supported?

Android and iOS

How to integrate?

  1. Add the dependency you need into commonMain:
implementation("io.github.sergeimikhailovskii:in-app-review-kmp:$latest_tag") // Amazon, App Gallery, Galaxy Store
implementation("io.github.sergeimikhailovskii:in-app-review-kmp-google-play:$latest_tag") // Google Play + Amazon, App Gallery, Galaxy Store
implementation("io.github.sergeimikhailovskii:in-app-review-kmp-rustore:$latest_tag") // RuStore + Amazon, App Gallery, Galaxy Store
  1. Create an instance of class that implements InAppReviewDelegate interface. Now library supports 3 implementations (depends on the market u need):

    • AmazonInAppReviewManager
    • AppGalleryInAppReviewManager
    • AppStoreInAppReviewManager
    • GalaxyStoreInAppReviewManager
    • GooglePlayInAppReviewManager
    • RuStoreInAppReviewManager
  2. To launch in-app review call

    fun requestInAppReview(): Flow<ReviewCode>

By listening the returned flow events u can receive the ResultCode which indicates the result the process finished with

  1. To launch in-market review call
    fun requestInMarketReview(): Flow<ReviewCode>

Note 1

For App Gallery and Galaxy Store need to call

fun init()

this method registers activity result listener so u should invoke it before the fragment or activity is created

Note 2

RuStore's impl has minSdk=26, other dependencies have minSdk=21

Breaking changes in the version 3.0

  1. Since new artifacts versions are published to the MavenCentral instead of Github Maven, the group id was changed:
dependencies {
+  implementation("io.github.sergeimikhailovskii:in-app-review-kmp:$latest_tag") // Amazon, App Gallery, Galaxy Store
-  implementation("com.mikhailovskii.kmp:in-app-review-kmp:$latest_tag") // Amazon, App Gallery, Galaxy Store
+  implementation("io.github.sergeimikhailovskii:in-app-review-kmp-google-play:$latest_tag") // Google Play + Amazon, App Gallery, Galaxy Store
-  implementation("com.mikhailovskii.kmp:in-app-review-kmp-google-play:$latest_tag") // Google Play + Amazon, App Gallery, Galaxy Store
+  implementation("io.github.sergeimikhailovskii:in-app-review-kmp-rustore:$latest_tag")
-  implementation("com.mikhailovskii.kmp:in-app-review-kmp-rustore:$latest_tag") // RuStore + Amazon, App Gallery, Galaxy Store
}
  1. Separate repository can be deleted
dependencyResolutionManagement {
    repositories {
+        mavenCentral()
-        maven {
-            url = uri("https://maven.pkg.github.com/SergeiMikhailovskii/kmp-app-review")
-            credentials {
-               username = System.getenv("GITHUB_USER")
-               password = System.getenv("GITHUB_API_KEY")
-            }
-        }
    }
}

Breaking changes in the version 2.0

  1. Google Play's implementation was moved from the in-app-review-kmp module to the in-app-review-kmp-google-play module. Reason is the following - starting from the version 2.0 library supports more stores, stores that use own sdk for the review process are moved to separate modules to avoid adding unnecessary dependencies for stores that don't need any SDK like AppGallery, Galaxy Store and Amazon Store.
  2. Deleted
fun getDefaultReviewManager(params: DefaultInAppReviewInitParams): InAppReviewDelegate

Here u can see the sample integrations:

What to do if I need to support some other market?

Just create your own implementation of the InAppReviewDelegate interface. There are no differences between your own implementation and the implementation out of the library. Main idea of the library is to provide the vision how the review process can be shared. Also it aims to collect as much implementations as it can be, so PRs are welcome :)