react-native-rate-app 1.5.0 → 1.5.2
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.
- package/android/build.gradle +1 -0
- package/ios/RateApp.mm +30 -4
- package/ios/RateApp.swift +11 -19
- package/package.json +4 -3
- package/ios/RateApp-Bridging-Header.h +0 -1
package/android/build.gradle
CHANGED
package/ios/RateApp.mm
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
#import "RateApp.h"
|
|
2
2
|
#import "RateApp-Swift.h"
|
|
3
|
+
#import <React/RCTBridgeModule.h>
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
@implementation RateApp {
|
|
6
|
+
RateAppImpl *_impl;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
- (instancetype)init {
|
|
10
|
+
self = [super init];
|
|
11
|
+
if (self) {
|
|
12
|
+
_impl = [RateAppImpl new];
|
|
13
|
+
}
|
|
14
|
+
return self;
|
|
15
|
+
}
|
|
7
16
|
|
|
8
17
|
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
9
18
|
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
10
19
|
{
|
|
11
|
-
|
|
20
|
+
return std::make_shared<facebook::react::NativeRateAppSpecJSI>(params);
|
|
12
21
|
}
|
|
13
22
|
|
|
14
23
|
+ (NSString *)moduleName
|
|
@@ -16,4 +25,21 @@
|
|
|
16
25
|
return @"RateApp";
|
|
17
26
|
}
|
|
18
27
|
|
|
28
|
+
- (void)requestReview:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject
|
|
29
|
+
{
|
|
30
|
+
[_impl requestReview:resolve reject:reject];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
- (void)requestReviewAppGallery:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject
|
|
34
|
+
{
|
|
35
|
+
[_impl requestReviewAppGallery:resolve reject:reject];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
- (void)requestReviewGalaxyStore:(NSString *)packageName
|
|
39
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
40
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
41
|
+
{
|
|
42
|
+
[_impl requestReviewGalaxyStore:packageName resolve:resolve reject:reject];
|
|
43
|
+
}
|
|
44
|
+
|
|
19
45
|
@end
|
package/ios/RateApp.swift
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
import Foundation
|
|
2
2
|
import React
|
|
3
3
|
import StoreKit
|
|
4
|
+
import UIKit
|
|
4
5
|
|
|
5
|
-
@objc(
|
|
6
|
-
class
|
|
6
|
+
@objc(RateAppImpl)
|
|
7
|
+
public class RateAppImpl: NSObject {
|
|
7
8
|
|
|
8
9
|
private let noActiveSceneError = "no_active_scene"
|
|
9
10
|
private let unsupportedPlatformError = "unsupported_platform"
|
|
10
11
|
|
|
11
12
|
@objc
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@objc
|
|
17
|
-
func requestReview(
|
|
18
|
-
_ resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
|
|
13
|
+
public func requestReview(
|
|
14
|
+
_ resolve: @escaping RCTPromiseResolveBlock, reject: RCTPromiseRejectBlock
|
|
19
15
|
) {
|
|
20
16
|
if let scene = findActiveScene() {
|
|
21
17
|
if #available(iOS 16.0, *) {
|
|
@@ -23,11 +19,7 @@ class RateApp: NSObject {
|
|
|
23
19
|
AppStore.requestReview(in: scene)
|
|
24
20
|
}
|
|
25
21
|
} else {
|
|
26
|
-
|
|
27
|
-
SKStoreReviewController.requestReview(in: scene)
|
|
28
|
-
} else {
|
|
29
|
-
SKStoreReviewController.requestReview()
|
|
30
|
-
}
|
|
22
|
+
SKStoreReviewController.requestReview(in: scene)
|
|
31
23
|
}
|
|
32
24
|
resolve(true)
|
|
33
25
|
} else {
|
|
@@ -36,16 +28,16 @@ class RateApp: NSObject {
|
|
|
36
28
|
}
|
|
37
29
|
|
|
38
30
|
@objc
|
|
39
|
-
func requestReviewAppGallery(
|
|
40
|
-
_ resolve:
|
|
31
|
+
public func requestReviewAppGallery(
|
|
32
|
+
_ resolve: RCTPromiseResolveBlock, reject: RCTPromiseRejectBlock
|
|
41
33
|
) {
|
|
42
34
|
reject(unsupportedPlatformError, "App Gallery reviews are not supported on iOS", nil)
|
|
43
35
|
}
|
|
44
36
|
|
|
45
37
|
@objc
|
|
46
|
-
func requestReviewGalaxyStore(
|
|
47
|
-
_ packageName: String, resolve:
|
|
48
|
-
reject:
|
|
38
|
+
public func requestReviewGalaxyStore(
|
|
39
|
+
_ packageName: String, resolve: RCTPromiseResolveBlock,
|
|
40
|
+
reject: RCTPromiseRejectBlock
|
|
49
41
|
) {
|
|
50
42
|
reject(unsupportedPlatformError, "Galaxy Store reviews are not supported on iOS", nil)
|
|
51
43
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-rate-app",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "React Native module for In App Rating on Android and iOS",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"types": "./lib/typescript/src/index.d.ts",
|
|
11
11
|
"default": "./lib/module/index.js"
|
|
12
12
|
},
|
|
13
|
-
"./package.json": "./package.json"
|
|
13
|
+
"./package.json": "./package.json",
|
|
14
|
+
"./app.plugin.js": "./app.plugin.js"
|
|
14
15
|
},
|
|
15
16
|
"files": [
|
|
16
17
|
"src",
|
|
@@ -68,7 +69,7 @@
|
|
|
68
69
|
"devDependencies": {
|
|
69
70
|
"@commitlint/cli": "20.4.3",
|
|
70
71
|
"@commitlint/config-conventional": "20.4.3",
|
|
71
|
-
"@eslint/compat": "2.0.
|
|
72
|
+
"@eslint/compat": "2.0.3",
|
|
72
73
|
"@eslint/eslintrc": "3.3.5",
|
|
73
74
|
"@eslint/js": "9.35.0",
|
|
74
75
|
"@react-native/babel-preset": "0.84.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//
|