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
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Hugo EXTRAT
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# React Native Rate App
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
A powerful and easy-to-use library for implementing in-app ratings in React Native applications.
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://github.com/huextrat/react-native-rate-app/blob/main/LICENSE">
|
|
9
|
+
<img alt="License" src="https://img.shields.io/badge/license-MIT-blue.svg" />
|
|
10
|
+
</a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/react-native-rate-app">
|
|
12
|
+
<img alt="npm version" src="https://img.shields.io/npm/v/react-native-rate-app.svg" />
|
|
13
|
+
</a>
|
|
14
|
+
<a href="https://www.npmjs.com/package/react-native-rate-app">
|
|
15
|
+
<img alt="npm downloads" src="https://img.shields.io/npm/dm/react-native-rate-app.svg" />
|
|
16
|
+
</a>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
## Features
|
|
20
|
+
|
|
21
|
+
- 🚀 Easy integration with React Native projects
|
|
22
|
+
- 🔄 Cross-platform support (iOS and Android)
|
|
23
|
+
- 📱 Supports Android 21+ and iOS 14+
|
|
24
|
+
- 🏗️ Supports the new architecture for React Native
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
yarn add react-native-rate-app
|
|
30
|
+
```
|
|
31
|
+
or
|
|
32
|
+
```sh
|
|
33
|
+
npm install react-native-rate-app
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## iOS Setup
|
|
37
|
+
|
|
38
|
+
To use the in-app review functionality on iOS, you need to add the `StoreKit` framework to your project and update your `Info.plist` file.
|
|
39
|
+
|
|
40
|
+
### Adding the StoreKit Framework
|
|
41
|
+
|
|
42
|
+
1. Open your project in Xcode.
|
|
43
|
+
2. Select your project in the Project Navigator.
|
|
44
|
+
3. Select your app target.
|
|
45
|
+
4. Go to the "Build Phases" tab.
|
|
46
|
+
5. Expand the "Link Binary With Libraries" section.
|
|
47
|
+
6. Click the "+" button and add `StoreKit.framework`.
|
|
48
|
+
|
|
49
|
+
### Updating Info.plist
|
|
50
|
+
|
|
51
|
+
To allow your app to open the App Store and handle the in-app review functionality, you need to add the `LSApplicationQueriesSchemes` key to your `Info.plist` file.
|
|
52
|
+
|
|
53
|
+
1. Open your `Info.plist` file.
|
|
54
|
+
2. Add `itms-apps` string
|
|
55
|
+
|
|
56
|
+
Example:
|
|
57
|
+
```xml
|
|
58
|
+
<key>LSApplicationQueriesSchemes</key>
|
|
59
|
+
<array>
|
|
60
|
+
<string>itms-apps</string>
|
|
61
|
+
</array>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## API Reference
|
|
65
|
+
|
|
66
|
+
This library will throw an error if something goes wrong during the execution of its methods. Make sure to handle these errors appropriately in your application.
|
|
67
|
+
|
|
68
|
+
### `RateApp.requestReview()`
|
|
69
|
+
|
|
70
|
+
Requests a review from the user using the native in-app review dialog.
|
|
71
|
+
|
|
72
|
+
```javascript
|
|
73
|
+
const result = await RateApp.requestReview();
|
|
74
|
+
console.log(result); // true if successful, false otherwise
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Important Notes
|
|
78
|
+
|
|
79
|
+
- **Quotas**: In-app reviews are subject to rate limits set by the operating system. This means the review dialog might not always appear to the user, depending on how often it has been requested previously. Note that `requestReview` will return `true` even if the rate limits have been reached. For more information, please refer to the official documentation from Apple and Google.
|
|
80
|
+
- **Development Mode**: The in-app review dialog is always displayed in development mode, regardless of rate limits. This is useful for testing purposes.
|
|
81
|
+
- **Best Practices**: According to operating system guidelines, it is recommended to request a review during a natural flow in your app, rather than from a button. For example, you might request a review after a user has completed a task or achieved a milestone within your app.
|
|
82
|
+
|
|
83
|
+
[Apple Documentation](https://developer.apple.com/documentation/storekit/skstorereviewcontroller/3566727-requestreview#discussion)<br>
|
|
84
|
+
[Google Documentation](https://developer.android.com/guide/playcore/in-app-review)
|
|
85
|
+
|
|
86
|
+
### `RateApp.openStoreForReview(options)`
|
|
87
|
+
|
|
88
|
+
Opens the app store page for the app, allowing the user to leave a review.
|
|
89
|
+
|
|
90
|
+
```javascript
|
|
91
|
+
const result = await RateApp.openStoreForReview({
|
|
92
|
+
iOSAppId: "your-ios-app-id", // Required on iOS, macOS
|
|
93
|
+
androidPackageName: "your.android.package.name", // Required on Android
|
|
94
|
+
androidMarket: AndroidMarket.GOOGLE, // Optional, defaults to GOOGLE
|
|
95
|
+
});
|
|
96
|
+
console.log(result); // true if successful, false otherwise
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Supported Android Markets
|
|
100
|
+
|
|
101
|
+
The `androidMarket` option in `RateApp.openStoreForReview` supports the following markets:
|
|
102
|
+
|
|
103
|
+
- `AndroidMarket.GOOGLE`: Google Play Store
|
|
104
|
+
- `AndroidMarket.AMAZON`: Amazon Appstore
|
|
105
|
+
- `AndroidMarket.SAMSUNG`: Samsung Galaxy Store
|
|
106
|
+
- `AndroidMarket.HUAWEI`: Huawei AppGallery
|
|
107
|
+
|
|
108
|
+
### Updating Info.plist
|
|
109
|
+
|
|
110
|
+
You need to add the `LSApplicationQueriesSchemes` key to your `Info.plist` file to allow your app to open the App Store.
|
|
111
|
+
|
|
112
|
+
1. Open your `Info.plist` file.
|
|
113
|
+
2. Add the following entry:
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
## Contributing
|
|
117
|
+
|
|
118
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for more details.
|
|
119
|
+
|
|
120
|
+
## License
|
|
121
|
+
|
|
122
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
123
|
+
|
|
124
|
+
## Support
|
|
125
|
+
|
|
126
|
+
If you like this project, please consider supporting it by giving it a ⭐️ on GitHub!
|
|
127
|
+
|
|
128
|
+
## Acknowledgements
|
|
129
|
+
|
|
130
|
+
- [create-react-native-library](https://github.com/callstack/react-native-builder-bob) for the initial project setup
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
buildscript {
|
|
2
|
+
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
|
|
3
|
+
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["RateApp_kotlinVersion"]
|
|
4
|
+
|
|
5
|
+
repositories {
|
|
6
|
+
google()
|
|
7
|
+
mavenCentral()
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
dependencies {
|
|
11
|
+
classpath "com.android.tools.build:gradle:7.2.1"
|
|
12
|
+
// noinspection DifferentKotlinGradleVersion
|
|
13
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
def isNewArchitectureEnabled() {
|
|
18
|
+
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
apply plugin: "com.android.library"
|
|
22
|
+
apply plugin: "kotlin-android"
|
|
23
|
+
|
|
24
|
+
if (isNewArchitectureEnabled()) {
|
|
25
|
+
apply plugin: "com.facebook.react"
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
def getExtOrDefault(name) {
|
|
29
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["RateApp_" + name]
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
def getExtOrIntegerDefault(name) {
|
|
33
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["RateApp_" + name]).toInteger()
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
android {
|
|
37
|
+
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
|
|
38
|
+
if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
|
|
39
|
+
namespace "com.rateapp"
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
43
|
+
|
|
44
|
+
defaultConfig {
|
|
45
|
+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
46
|
+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
buildFeatures {
|
|
50
|
+
buildConfig true
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
buildTypes {
|
|
54
|
+
release {
|
|
55
|
+
minifyEnabled false
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
lintOptions {
|
|
60
|
+
disable "GradleCompatible"
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
compileOptions {
|
|
64
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
65
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
sourceSets {
|
|
69
|
+
main {
|
|
70
|
+
if (isNewArchitectureEnabled()) {
|
|
71
|
+
java.srcDirs += ["src/newarch"]
|
|
72
|
+
} else {
|
|
73
|
+
java.srcDirs += ["src/oldarch"]
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
repositories {
|
|
80
|
+
mavenCentral()
|
|
81
|
+
google()
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
85
|
+
|
|
86
|
+
dependencies {
|
|
87
|
+
//noinspection GradleDynamicVersion
|
|
88
|
+
implementation "com.facebook.react:react-native:+"
|
|
89
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
90
|
+
implementation "com.google.android.play:review:2.0.1"
|
|
91
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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: GenerateModuleJavaSpec.js
|
|
9
|
+
*
|
|
10
|
+
* @nolint
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
package com.rateapp;
|
|
14
|
+
|
|
15
|
+
import com.facebook.proguard.annotations.DoNotStrip;
|
|
16
|
+
import com.facebook.react.bridge.Promise;
|
|
17
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
18
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
19
|
+
import com.facebook.react.bridge.ReactMethod;
|
|
20
|
+
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
21
|
+
import javax.annotation.Nonnull;
|
|
22
|
+
|
|
23
|
+
public abstract class NativeRateAppSpec extends ReactContextBaseJavaModule implements TurboModule {
|
|
24
|
+
public static final String NAME = "RateApp";
|
|
25
|
+
|
|
26
|
+
public NativeRateAppSpec(ReactApplicationContext reactContext) {
|
|
27
|
+
super(reactContext);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@Override
|
|
31
|
+
public @Nonnull String getName() {
|
|
32
|
+
return NAME;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@ReactMethod
|
|
36
|
+
@DoNotStrip
|
|
37
|
+
public abstract void requestReview(Promise promise);
|
|
38
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT license found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
cmake_minimum_required(VERSION 3.13)
|
|
7
|
+
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
8
|
+
|
|
9
|
+
file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/RNRateAppSpec/*.cpp)
|
|
10
|
+
|
|
11
|
+
add_library(
|
|
12
|
+
react_codegen_RNRateAppSpec
|
|
13
|
+
SHARED
|
|
14
|
+
${react_codegen_SRCS}
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
target_include_directories(react_codegen_RNRateAppSpec PUBLIC . react/renderer/components/RNRateAppSpec)
|
|
18
|
+
|
|
19
|
+
target_link_libraries(
|
|
20
|
+
react_codegen_RNRateAppSpec
|
|
21
|
+
fbjni
|
|
22
|
+
folly_runtime
|
|
23
|
+
glog
|
|
24
|
+
jsi
|
|
25
|
+
react_codegen_rncore
|
|
26
|
+
react_debug
|
|
27
|
+
react_nativemodule_core
|
|
28
|
+
react_render_componentregistry
|
|
29
|
+
react_render_core
|
|
30
|
+
react_render_debug
|
|
31
|
+
react_render_graphics
|
|
32
|
+
react_render_imagemanager
|
|
33
|
+
react_render_mapbuffer
|
|
34
|
+
react_utils
|
|
35
|
+
rrc_image
|
|
36
|
+
rrc_view
|
|
37
|
+
turbomodulejsijni
|
|
38
|
+
yoga
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
target_compile_options(
|
|
42
|
+
react_codegen_RNRateAppSpec
|
|
43
|
+
PRIVATE
|
|
44
|
+
-DLOG_TAG=\"ReactNative\"
|
|
45
|
+
-fexceptions
|
|
46
|
+
-frtti
|
|
47
|
+
-std=c++20
|
|
48
|
+
-Wall
|
|
49
|
+
)
|
|
@@ -0,0 +1,32 @@
|
|
|
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: GenerateModuleJniCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include "RNRateAppSpec.h"
|
|
12
|
+
|
|
13
|
+
namespace facebook::react {
|
|
14
|
+
|
|
15
|
+
static facebook::jsi::Value __hostFunction_NativeRateAppSpecJSI_requestReview(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
16
|
+
static jmethodID cachedMethodId = nullptr;
|
|
17
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "requestReview", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
NativeRateAppSpecJSI::NativeRateAppSpecJSI(const JavaTurboModule::InitParams ¶ms)
|
|
21
|
+
: JavaTurboModule(params) {
|
|
22
|
+
methodMap_["requestReview"] = MethodMetadata {0, __hostFunction_NativeRateAppSpecJSI_requestReview};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
std::shared_ptr<TurboModule> RNRateAppSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms) {
|
|
26
|
+
if (moduleName == "RateApp") {
|
|
27
|
+
return std::make_shared<NativeRateAppSpecJSI>(params);
|
|
28
|
+
}
|
|
29
|
+
return nullptr;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,31 @@
|
|
|
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: GenerateModuleJniH.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma once
|
|
12
|
+
|
|
13
|
+
#include <ReactCommon/JavaTurboModule.h>
|
|
14
|
+
#include <ReactCommon/TurboModule.h>
|
|
15
|
+
#include <jsi/jsi.h>
|
|
16
|
+
|
|
17
|
+
namespace facebook::react {
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* JNI C++ class for module 'NativeRateApp'
|
|
21
|
+
*/
|
|
22
|
+
class JSI_EXPORT NativeRateAppSpecJSI : public JavaTurboModule {
|
|
23
|
+
public:
|
|
24
|
+
NativeRateAppSpecJSI(const JavaTurboModule::InitParams ¶ms);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
JSI_EXPORT
|
|
29
|
+
std::shared_ptr<TurboModule> RNRateAppSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms);
|
|
30
|
+
|
|
31
|
+
} // namespace facebook::react
|
package/android/generated/jni/react/renderer/components/RNRateAppSpec/ComponentDescriptors.cpp
ADDED
|
@@ -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
|
package/android/generated/jni/react/renderer/components/RNRateAppSpec/RNRateAppSpecJSI-generated.cpp
ADDED
|
@@ -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,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
|