react-native-rate-app 0.0.1
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/LICENSE +20 -0
- package/README.md +130 -0
- package/android/build.gradle +91 -0
- package/android/generated/java/com/rateapp/NativeRateAppSpec.java +38 -0
- package/android/generated/jni/CMakeLists.txt +49 -0
- package/android/generated/jni/RNRateAppSpec-generated.cpp +32 -0
- package/android/generated/jni/RNRateAppSpec.h +31 -0
- package/android/generated/jni/react/renderer/components/RNRateAppSpec/ComponentDescriptors.cpp +22 -0
- package/android/generated/jni/react/renderer/components/RNRateAppSpec/ComponentDescriptors.h +24 -0
- package/android/generated/jni/react/renderer/components/RNRateAppSpec/EventEmitters.cpp +16 -0
- package/android/generated/jni/react/renderer/components/RNRateAppSpec/EventEmitters.h +17 -0
- package/android/generated/jni/react/renderer/components/RNRateAppSpec/Props.cpp +19 -0
- package/android/generated/jni/react/renderer/components/RNRateAppSpec/Props.h +18 -0
- package/android/generated/jni/react/renderer/components/RNRateAppSpec/RNRateAppSpecJSI-generated.cpp +26 -0
- package/android/generated/jni/react/renderer/components/RNRateAppSpec/RNRateAppSpecJSI.h +67 -0
- package/android/generated/jni/react/renderer/components/RNRateAppSpec/ShadowNodes.cpp +17 -0
- package/android/generated/jni/react/renderer/components/RNRateAppSpec/ShadowNodes.h +23 -0
- package/android/generated/jni/react/renderer/components/RNRateAppSpec/States.cpp +16 -0
- package/android/generated/jni/react/renderer/components/RNRateAppSpec/States.h +19 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/rateapp/RateAppModule.kt +46 -0
- package/android/src/main/java/com/rateapp/RateAppPackage.kt +34 -0
- package/android/src/newarch/RateAppSpec.kt +7 -0
- package/android/src/oldarch/RateAppSpec.kt +11 -0
- package/ios/RateApp.h +12 -0
- package/ios/RateApp.mm +39 -0
- package/ios/generated/RNRateAppSpec/ComponentDescriptors.cpp +22 -0
- package/ios/generated/RNRateAppSpec/ComponentDescriptors.h +24 -0
- package/ios/generated/RNRateAppSpec/EventEmitters.cpp +16 -0
- package/ios/generated/RNRateAppSpec/EventEmitters.h +17 -0
- package/ios/generated/RNRateAppSpec/Props.cpp +19 -0
- package/ios/generated/RNRateAppSpec/Props.h +18 -0
- package/ios/generated/RNRateAppSpec/RCTComponentViewHelpers.h +18 -0
- package/ios/generated/RNRateAppSpec/RNRateAppSpec-generated.mm +29 -0
- package/ios/generated/RNRateAppSpec/RNRateAppSpec.h +50 -0
- package/ios/generated/RNRateAppSpec/ShadowNodes.cpp +17 -0
- package/ios/generated/RNRateAppSpec/ShadowNodes.h +23 -0
- package/ios/generated/RNRateAppSpec/States.cpp +16 -0
- package/ios/generated/RNRateAppSpec/States.h +19 -0
- package/ios/generated/RNRateAppSpecJSI-generated.cpp +26 -0
- package/ios/generated/RNRateAppSpecJSI.h +67 -0
- package/lib/commonjs/NativeRateApp.js +9 -0
- package/lib/commonjs/NativeRateApp.js.map +1 -0
- package/lib/commonjs/constants.js +15 -0
- package/lib/commonjs/constants.js.map +1 -0
- package/lib/commonjs/index.js +120 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/types.js +14 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/module/NativeRateApp.js +5 -0
- package/lib/module/NativeRateApp.js.map +1 -0
- package/lib/module/constants.js +11 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/index.js +88 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/types.js +10 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/setupJest.d.ts +1 -0
- package/lib/typescript/commonjs/setupJest.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/NativeRateApp.d.ts +7 -0
- package/lib/typescript/commonjs/src/NativeRateApp.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/constants.d.ts +4 -0
- package/lib/typescript/commonjs/src/constants.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +26 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types.d.ts +22 -0
- package/lib/typescript/commonjs/src/types.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/setupJest.d.ts +1 -0
- package/lib/typescript/module/setupJest.d.ts.map +1 -0
- package/lib/typescript/module/src/NativeRateApp.d.ts +7 -0
- package/lib/typescript/module/src/NativeRateApp.d.ts.map +1 -0
- package/lib/typescript/module/src/constants.d.ts +4 -0
- package/lib/typescript/module/src/constants.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +26 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/types.d.ts +22 -0
- package/lib/typescript/module/src/types.d.ts.map +1 -0
- package/package.json +156 -0
- package/react-native-rate-app.podspec +23 -0
- package/src/NativeRateApp.ts +8 -0
- package/src/constants.ts +10 -0
- package/src/index.tsx +91 -0
- package/src/types.ts +22 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateStateH.js
|
|
8
|
+
*/
|
|
9
|
+
#pragma once
|
|
10
|
+
|
|
11
|
+
#ifdef ANDROID
|
|
12
|
+
#include <folly/dynamic.h>
|
|
13
|
+
#endif
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"/>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
package com.rateapp
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
4
|
+
import com.facebook.react.bridge.ReactMethod
|
|
5
|
+
import com.facebook.react.bridge.Promise
|
|
6
|
+
|
|
7
|
+
import com.google.android.play.core.review.ReviewManager
|
|
8
|
+
import com.google.android.play.core.review.ReviewManagerFactory
|
|
9
|
+
|
|
10
|
+
class RateAppModule internal constructor(context: ReactApplicationContext) :
|
|
11
|
+
RateAppSpec(context) {
|
|
12
|
+
|
|
13
|
+
override fun getName(): String {
|
|
14
|
+
return NAME
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@ReactMethod
|
|
18
|
+
override fun requestReview(promise: Promise) {
|
|
19
|
+
val manager: ReviewManager = ReviewManagerFactory.create(reactApplicationContext)
|
|
20
|
+
val request = manager.requestReviewFlow()
|
|
21
|
+
request.addOnCompleteListener { task ->
|
|
22
|
+
if (task.isSuccessful) {
|
|
23
|
+
val reviewInfo = task.result
|
|
24
|
+
reviewInfo?.let {
|
|
25
|
+
val activity = currentActivity
|
|
26
|
+
if (activity != null) {
|
|
27
|
+
val flow = manager.launchReviewFlow(activity, it)
|
|
28
|
+
flow.addOnCompleteListener { result ->
|
|
29
|
+
if (result.isSuccessful) {
|
|
30
|
+
promise.resolve(true)
|
|
31
|
+
} else {
|
|
32
|
+
promise.reject("REVIEW_FLOW_FAILED", "Review flow failed to complete")
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
} ?: promise.reject("REVIEW_INFO_NULL", "Review info is null")
|
|
37
|
+
} else {
|
|
38
|
+
promise.reject("REQUEST_REVIEW_FLOW_FAILED", "Request review flow failed")
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
companion object {
|
|
44
|
+
const val NAME = "RateApp"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
package com.rateapp
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.TurboReactPackage
|
|
4
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
5
|
+
import com.facebook.react.bridge.NativeModule
|
|
6
|
+
import com.facebook.react.module.model.ReactModuleInfoProvider
|
|
7
|
+
import com.facebook.react.module.model.ReactModuleInfo
|
|
8
|
+
import java.util.HashMap
|
|
9
|
+
|
|
10
|
+
class RateAppPackage : TurboReactPackage() {
|
|
11
|
+
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
|
|
12
|
+
return if (name == RateAppModule.NAME) {
|
|
13
|
+
RateAppModule(reactContext)
|
|
14
|
+
} else {
|
|
15
|
+
null
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
|
|
20
|
+
return ReactModuleInfoProvider {
|
|
21
|
+
val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
|
|
22
|
+
moduleInfos[RateAppModule.NAME] = ReactModuleInfo(
|
|
23
|
+
RateAppModule.NAME,
|
|
24
|
+
RateAppModule.NAME,
|
|
25
|
+
false, // canOverrideExistingModule
|
|
26
|
+
false, // needsEagerInit
|
|
27
|
+
true, // hasConstants
|
|
28
|
+
false, // isCxxModule
|
|
29
|
+
true // isTurboModule
|
|
30
|
+
)
|
|
31
|
+
moduleInfos
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
package com.rateapp
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
4
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
5
|
+
import com.facebook.react.bridge.Promise
|
|
6
|
+
|
|
7
|
+
abstract class RateAppSpec internal constructor(context: ReactApplicationContext) :
|
|
8
|
+
ReactContextBaseJavaModule(context) {
|
|
9
|
+
|
|
10
|
+
abstract fun requestReview(promise: Promise)
|
|
11
|
+
}
|
package/ios/RateApp.h
ADDED
package/ios/RateApp.mm
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#import "RateApp.h"
|
|
2
|
+
#import <StoreKit/StoreKit.h>
|
|
3
|
+
|
|
4
|
+
static NSString *const kNoActiveSceneError = @"no_active_scene";
|
|
5
|
+
|
|
6
|
+
@implementation RateApp
|
|
7
|
+
RCT_EXPORT_MODULE()
|
|
8
|
+
|
|
9
|
+
RCT_EXPORT_METHOD(requestReview:(RCTPromiseResolveBlock)resolve
|
|
10
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
11
|
+
{
|
|
12
|
+
UIWindowScene *scene = [self findActiveScene];
|
|
13
|
+
if (scene) {
|
|
14
|
+
[SKStoreReviewController requestReviewInScene:scene];
|
|
15
|
+
resolve(@(YES));
|
|
16
|
+
} else {
|
|
17
|
+
reject(kNoActiveSceneError, @"No active scene found", nil);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
- (UIWindowScene *) findActiveScene {
|
|
22
|
+
for (UIWindowScene *scene in UIApplication.sharedApplication.connectedScenes) {
|
|
23
|
+
if (scene.activationState == UISceneActivationStateForegroundActive) {
|
|
24
|
+
return scene;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return nil;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Don't compile this code when we build for the old architecture.
|
|
31
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
32
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
33
|
+
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
34
|
+
{
|
|
35
|
+
return std::make_shared<facebook::react::NativeRateAppSpecJSI>(params);
|
|
36
|
+
}
|
|
37
|
+
#endif
|
|
38
|
+
|
|
39
|
+
@end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include "ComponentDescriptors.h"
|
|
12
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
13
|
+
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
void RNRateAppSpec_registerComponentDescriptorsFromCodegen(
|
|
18
|
+
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateComponentDescriptorH.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma once
|
|
12
|
+
|
|
13
|
+
#include "ShadowNodes.h"
|
|
14
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
+
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
16
|
+
|
|
17
|
+
namespace facebook::react {
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
void RNRateAppSpec_registerComponentDescriptorsFromCodegen(
|
|
22
|
+
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
|
23
|
+
|
|
24
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateEventEmitterCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include "EventEmitters.h"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
namespace facebook::react {
|
|
15
|
+
|
|
16
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateEventEmitterH.js
|
|
9
|
+
*/
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <react/renderer/components/view/ViewEventEmitter.h>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GeneratePropsCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include "Props.h"
|
|
12
|
+
#include <react/renderer/core/PropsParserContext.h>
|
|
13
|
+
#include <react/renderer/core/propsConversions.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GeneratePropsH.js
|
|
9
|
+
*/
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
namespace facebook::react {
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateComponentHObjCpp.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#import <Foundation/Foundation.h>
|
|
11
|
+
#import <React/RCTDefines.h>
|
|
12
|
+
#import <React/RCTLog.h>
|
|
13
|
+
|
|
14
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleObjCpp
|
|
8
|
+
*
|
|
9
|
+
* We create an umbrella header (and corresponding implementation) here since
|
|
10
|
+
* Cxx compilation in BUCK has a limitation: source-code producing genrule()s
|
|
11
|
+
* must have a single output. More files => more genrule()s => slower builds.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
#import "RNRateAppSpec.h"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
namespace facebook::react {
|
|
18
|
+
|
|
19
|
+
static facebook::jsi::Value __hostFunction_NativeRateAppSpecJSI_requestReview(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
20
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "requestReview", @selector(requestReview:reject:), args, count);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
NativeRateAppSpecJSI::NativeRateAppSpecJSI(const ObjCTurboModule::InitParams ¶ms)
|
|
24
|
+
: ObjCTurboModule(params) {
|
|
25
|
+
|
|
26
|
+
methodMap_["requestReview"] = MethodMetadata {0, __hostFunction_NativeRateAppSpecJSI_requestReview};
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleObjCpp
|
|
8
|
+
*
|
|
9
|
+
* We create an umbrella header (and corresponding implementation) here since
|
|
10
|
+
* Cxx compilation in BUCK has a limitation: source-code producing genrule()s
|
|
11
|
+
* must have a single output. More files => more genrule()s => slower builds.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
#ifndef __cplusplus
|
|
15
|
+
#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
// Avoid multiple includes of RNRateAppSpec symbols
|
|
19
|
+
#ifndef RNRateAppSpec_H
|
|
20
|
+
#define RNRateAppSpec_H
|
|
21
|
+
|
|
22
|
+
#import <Foundation/Foundation.h>
|
|
23
|
+
#import <RCTRequired/RCTRequired.h>
|
|
24
|
+
#import <RCTTypeSafety/RCTConvertHelpers.h>
|
|
25
|
+
#import <RCTTypeSafety/RCTTypedModuleConstants.h>
|
|
26
|
+
#import <React/RCTBridgeModule.h>
|
|
27
|
+
#import <React/RCTCxxConvert.h>
|
|
28
|
+
#import <React/RCTManagedPointer.h>
|
|
29
|
+
#import <ReactCommon/RCTTurboModule.h>
|
|
30
|
+
#import <optional>
|
|
31
|
+
#import <vector>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@protocol NativeRateAppSpec <RCTBridgeModule, RCTTurboModule>
|
|
35
|
+
|
|
36
|
+
- (void)requestReview:(RCTPromiseResolveBlock)resolve
|
|
37
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
38
|
+
|
|
39
|
+
@end
|
|
40
|
+
namespace facebook::react {
|
|
41
|
+
/**
|
|
42
|
+
* ObjC++ class for module 'NativeRateApp'
|
|
43
|
+
*/
|
|
44
|
+
class JSI_EXPORT NativeRateAppSpecJSI : public ObjCTurboModule {
|
|
45
|
+
public:
|
|
46
|
+
NativeRateAppSpecJSI(const ObjCTurboModule::InitParams ¶ms);
|
|
47
|
+
};
|
|
48
|
+
} // namespace facebook::react
|
|
49
|
+
|
|
50
|
+
#endif // RNRateAppSpec_H
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateShadowNodeCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include "ShadowNodes.h"
|
|
12
|
+
|
|
13
|
+
namespace facebook::react {
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateShadowNodeH.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma once
|
|
12
|
+
|
|
13
|
+
#include "EventEmitters.h"
|
|
14
|
+
#include "Props.h"
|
|
15
|
+
#include "States.h"
|
|
16
|
+
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
17
|
+
#include <jsi/jsi.h>
|
|
18
|
+
|
|
19
|
+
namespace facebook::react {
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateStateCpp.js
|
|
9
|
+
*/
|
|
10
|
+
#include "States.h"
|
|
11
|
+
|
|
12
|
+
namespace facebook::react {
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateStateH.js
|
|
8
|
+
*/
|
|
9
|
+
#pragma once
|
|
10
|
+
|
|
11
|
+
#ifdef ANDROID
|
|
12
|
+
#include <folly/dynamic.h>
|
|
13
|
+
#endif
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleCpp.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#include "RNRateAppSpecJSI.h"
|
|
11
|
+
|
|
12
|
+
namespace facebook::react {
|
|
13
|
+
|
|
14
|
+
static jsi::Value __hostFunction_NativeRateAppCxxSpecJSI_requestReview(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
15
|
+
return static_cast<NativeRateAppCxxSpecJSI *>(&turboModule)->requestReview(
|
|
16
|
+
rt
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
NativeRateAppCxxSpecJSI::NativeRateAppCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
|
|
21
|
+
: TurboModule("RateApp", jsInvoker) {
|
|
22
|
+
methodMap_["requestReview"] = MethodMetadata {0, __hostFunction_NativeRateAppCxxSpecJSI_requestReview};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleH.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <ReactCommon/TurboModule.h>
|
|
13
|
+
#include <react/bridging/Bridging.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class JSI_EXPORT NativeRateAppCxxSpecJSI : public TurboModule {
|
|
19
|
+
protected:
|
|
20
|
+
NativeRateAppCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
|
|
21
|
+
|
|
22
|
+
public:
|
|
23
|
+
virtual jsi::Value requestReview(jsi::Runtime &rt) = 0;
|
|
24
|
+
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
template <typename T>
|
|
28
|
+
class JSI_EXPORT NativeRateAppCxxSpec : public TurboModule {
|
|
29
|
+
public:
|
|
30
|
+
jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
|
|
31
|
+
return delegate_.get(rt, propName);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
static constexpr std::string_view kModuleName = "RateApp";
|
|
35
|
+
|
|
36
|
+
protected:
|
|
37
|
+
NativeRateAppCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
|
|
38
|
+
: TurboModule(std::string{NativeRateAppCxxSpec::kModuleName}, jsInvoker),
|
|
39
|
+
delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
private:
|
|
43
|
+
class Delegate : public NativeRateAppCxxSpecJSI {
|
|
44
|
+
public:
|
|
45
|
+
Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
|
|
46
|
+
NativeRateAppCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
jsi::Value requestReview(jsi::Runtime &rt) override {
|
|
51
|
+
static_assert(
|
|
52
|
+
bridging::getParameterCount(&T::requestReview) == 1,
|
|
53
|
+
"Expected requestReview(...) to have 1 parameters");
|
|
54
|
+
|
|
55
|
+
return bridging::callFromJs<jsi::Value>(
|
|
56
|
+
rt, &T::requestReview, jsInvoker_, instance_);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
private:
|
|
60
|
+
friend class NativeRateAppCxxSpec;
|
|
61
|
+
T *instance_;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
Delegate delegate_;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _default = exports.default = _reactNative.TurboModuleRegistry.getEnforcing("RateApp");
|
|
9
|
+
//# sourceMappingURL=NativeRateApp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeRateApp.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAMpCC,gCAAmB,CAACC,YAAY,CAAO,SAAS,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.IOS_REVIEW_URL = exports.ANDROID_MARKET_URLS = void 0;
|
|
7
|
+
var _types = require("./types.js");
|
|
8
|
+
const IOS_REVIEW_URL = exports.IOS_REVIEW_URL = "itms-apps://apps.apple.com/app/id";
|
|
9
|
+
const ANDROID_MARKET_URLS = exports.ANDROID_MARKET_URLS = {
|
|
10
|
+
[_types.AndroidMarket.GOOGLE]: "market://details?id={packageName}",
|
|
11
|
+
[_types.AndroidMarket.AMAZON]: "amzn://apps/android?p={packageName}",
|
|
12
|
+
[_types.AndroidMarket.SAMSUNG]: "samsungapps://ProductDetail/{packageName}",
|
|
13
|
+
[_types.AndroidMarket.HUAWEI]: "appmarket://details?id={packageName}"
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_types","require","IOS_REVIEW_URL","exports","ANDROID_MARKET_URLS","AndroidMarket","GOOGLE","AMAZON","SAMSUNG","HUAWEI"],"sourceRoot":"../../src","sources":["constants.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,mCAAmC;AAE1D,MAAME,mBAAkD,GAAAD,OAAA,CAAAC,mBAAA,GAAG;EAChE,CAACC,oBAAa,CAACC,MAAM,GAAG,mCAAmC;EAC3D,CAACD,oBAAa,CAACE,MAAM,GAAG,qCAAqC;EAC7D,CAACF,oBAAa,CAACG,OAAO,GAAG,2CAA2C;EACpE,CAACH,oBAAa,CAACI,MAAM,GAAG;AAC1B,CAAC","ignoreList":[]}
|