react-native-rate-app 1.4.8 → 1.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
package com.rateapp
|
|
2
2
|
|
|
3
|
-
import android.app.Activity
|
|
3
|
+
import android.app.Activity
|
|
4
4
|
import android.content.BroadcastReceiver
|
|
5
5
|
import android.content.Context
|
|
6
6
|
import android.content.Intent
|
|
@@ -36,18 +36,21 @@ class RateAppModule(reactContext: ReactApplicationContext) :
|
|
|
36
36
|
request.addOnCompleteListener { task ->
|
|
37
37
|
if (task.isSuccessful) {
|
|
38
38
|
val reviewInfo = task.result
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
39
|
+
val activity = reactApplicationContext.currentActivity
|
|
40
|
+
if (reviewInfo != null && activity != null) {
|
|
41
|
+
val flow = manager.launchReviewFlow(activity, reviewInfo)
|
|
42
|
+
flow.addOnCompleteListener { result ->
|
|
43
|
+
if (result.isSuccessful) {
|
|
44
|
+
promise.resolve(true)
|
|
45
|
+
} else {
|
|
46
|
+
promise.reject("REVIEW_FLOW_FAILED", "Review flow failed to complete")
|
|
48
47
|
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
48
|
+
}
|
|
49
|
+
} else if (activity == null) {
|
|
50
|
+
promise.reject("ACTIVITY_NULL", "Current activity is null")
|
|
51
|
+
} else {
|
|
52
|
+
promise.reject("REVIEW_INFO_NULL", "Review info is null")
|
|
53
|
+
}
|
|
51
54
|
} else {
|
|
52
55
|
promise.reject("REQUEST_REVIEW_FLOW_FAILED", "Request review flow failed")
|
|
53
56
|
}
|
|
@@ -56,12 +59,15 @@ class RateAppModule(reactContext: ReactApplicationContext) :
|
|
|
56
59
|
|
|
57
60
|
@ReactMethod
|
|
58
61
|
override fun requestReviewAppGallery(promise: Promise) {
|
|
59
|
-
promiseAppGallery = promise
|
|
62
|
+
promiseAppGallery = promise
|
|
60
63
|
val intent = Intent("com.huawei.appmarket.intent.action.guidecomment")
|
|
61
64
|
intent.setPackage("com.huawei.appmarket")
|
|
62
|
-
currentActivity
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
val activity = reactApplicationContext.currentActivity
|
|
66
|
+
if (activity != null) {
|
|
67
|
+
activity.startActivityForResult(intent, REQUEST_CODE)
|
|
68
|
+
} else {
|
|
69
|
+
promise.reject("ACTIVITY_NULL", "Current activity is null")
|
|
70
|
+
}
|
|
65
71
|
}
|
|
66
72
|
|
|
67
73
|
override fun onActivityResult(activity: Activity, requestCode: Int, resultCode: Int, data: Intent?) {
|
|
@@ -104,10 +110,13 @@ class RateAppModule(reactContext: ReactApplicationContext) :
|
|
|
104
110
|
data = Uri.parse(deeplinkUri)
|
|
105
111
|
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_INCLUDE_STOPPED_PACKAGES)
|
|
106
112
|
}
|
|
107
|
-
currentActivity
|
|
108
|
-
|
|
113
|
+
val activity = reactApplicationContext.currentActivity
|
|
114
|
+
if (activity != null) {
|
|
115
|
+
activity.startActivity(deeplinkIntent)
|
|
109
116
|
promiseGalaxyStore?.resolve(true)
|
|
110
|
-
}
|
|
117
|
+
} else {
|
|
118
|
+
promiseGalaxyStore?.reject("ACTIVITY_NULL", "Current activity is null")
|
|
119
|
+
}
|
|
111
120
|
} else {
|
|
112
121
|
promiseGalaxyStore?.reject("NO_AUTHORITY", "No authority to write review")
|
|
113
122
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-rate-app",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.10",
|
|
4
4
|
"description": "React Native module for In App Rating on Android and iOS",
|
|
5
5
|
"source": "src/index.tsx",
|
|
6
6
|
"main": "lib/commonjs/index.js",
|
|
@@ -63,25 +63,25 @@
|
|
|
63
63
|
"registry": "https://registry.npmjs.org/"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@biomejs/biome": "2.
|
|
67
|
-
"@commitlint/cli": "20.4.
|
|
68
|
-
"@commitlint/config-conventional": "20.4.
|
|
66
|
+
"@biomejs/biome": "2.4.5",
|
|
67
|
+
"@commitlint/cli": "20.4.3",
|
|
68
|
+
"@commitlint/config-conventional": "20.4.3",
|
|
69
69
|
"@react-native-community/cli": "18.0.0",
|
|
70
70
|
"@semantic-release/changelog": "6.0.3",
|
|
71
71
|
"@semantic-release/git": "10.0.1",
|
|
72
72
|
"@types/jest": "30.0.0",
|
|
73
73
|
"@types/react": "19.0.10",
|
|
74
|
-
"commitlint": "20.4.
|
|
74
|
+
"commitlint": "20.4.3",
|
|
75
75
|
"del-cli": "7.0.0",
|
|
76
|
-
"expo": "
|
|
76
|
+
"expo": "55.0.4",
|
|
77
77
|
"husky": "9.1.7",
|
|
78
78
|
"jest": "30.2.0",
|
|
79
79
|
"prettier": "3.8.1",
|
|
80
80
|
"react": "19.0.0",
|
|
81
|
-
"react-native": "0.84.
|
|
81
|
+
"react-native": "0.84.1",
|
|
82
82
|
"react-native-builder-bob": "0.40.18",
|
|
83
83
|
"semantic-release": "25.0.3",
|
|
84
|
-
"turbo": "2.8.
|
|
84
|
+
"turbo": "2.8.13",
|
|
85
85
|
"typescript": "5.9.3"
|
|
86
86
|
},
|
|
87
87
|
"resolutions": {
|