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
class GalaxyStoreInAppReviewInitParams(val context: Context) | |
class GalaxyStoreInAppReviewManager( | |
private val params: GalaxyStoreInAppReviewInitParams | |
) : InAppReviewDelegate { | |
private var deepLinkUri: String? = null | |
private var errorCode: Int = 0 | |
@SuppressLint("UnspecifiedRegisterReceiverFlag") |
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
fun Context.openMarket(deeplink: String, url: String) { | |
val marketAppIntent = Intent(Intent.ACTION_VIEW, Uri.parse(deeplink)).apply { | |
flags += Intent.FLAG_ACTIVITY_NO_HISTORY or | |
Intent.FLAG_ACTIVITY_NEW_DOCUMENT or | |
Intent.FLAG_ACTIVITY_MULTIPLE_TASK | |
} | |
val marketInBrowserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) |
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
class AmazonInAppReviewInitParams(val context: Context) | |
class AmazonInAppReviewManager( | |
private val params: AmazonInAppReviewInitParams | |
) : InAppReviewDelegate { | |
override fun requestInAppReview() = flow { | |
val context = params.context | |
context.openMarket( | |
deeplink = "amzn://apps/android?p=${context.packageName}", |
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
implementation("com.mikhailovskii.kmp:in-app-review-kmp:$latest_tag") // 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("com.mikhailovskii.kmp:in-app-review-kmp-rustore:$latest_tag") // RuStore + Amazon, App Gallery, Galaxy Store |
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
class MethodChannelInAppReview extends InAppReviewPlatform { | |
@visibleForTesting | |
final methodChannel = const MethodChannel('in_app_review'); | |
@override | |
Future<String?> launchInAppReview({required InAppReviewParams params}) async { | |
final status = await methodChannel.invokeMethod<String>( | |
'launchInAppReview', | |
params.toMap(), | |
); |
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
import Flutter | |
import UIKit | |
import inAppReviewKMP | |
public class InAppReviewPlugin: NSObject, FlutterPlugin { | |
private var reviewManager: InAppReviewDelegate? = nil | |
public static func register(with registrar: FlutterPluginRegistrar) { | |
let channel = FlutterMethodChannel(name: "in_app_review", binaryMessenger: registrar.messenger()) |
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
import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework | |
plugins { | |
kotlin("multiplatform") | |
} | |
kotlin { | |
val xcf = XCFramework() | |
val iosTargets = listOf(iosX64(), iosArm64(), iosSimulatorArm64()) |
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
package com.mikhailovskii.in_app_review | |
import androidx.lifecycle.Lifecycle | |
import androidx.lifecycle.LifecycleEventObserver | |
import androidx.lifecycle.lifecycleScope | |
import com.mikhailovskii.inappreview.appGallery.AppGalleryInAppReviewInitParams | |
import com.mikhailovskii.inappreview.appGallery.AppGalleryInAppReviewManager | |
import com.mikhailovskii.inappreview.googlePlay.GooglePlayInAppReviewInitParams | |
import com.mikhailovskii.inappreview.googlePlay.GooglePlayInAppReviewManager | |
import io.flutter.embedding.android.FlutterFragmentActivity |
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
dependencies { | |
implementation "com.mikhailovskii.kmp:in-app-review-kmp:1.0.16" | |
} |
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
allprojects { | |
repositories { | |
maven { | |
url = uri("https://maven.pkg.github.com/SergeiMikhailovskii/kmp-app-review") | |
credentials { | |
username = System.getenv("GITHUB_USER") | |
password = System.getenv("GITHUB_API_KEY") | |
} | |
} | |
} |