feat: update rateapp (#139)
This commit is contained in:
parent
d6f95ad892
commit
a605e5f04a
@ -4,19 +4,21 @@ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
||||
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "react-native-rate-app"
|
||||
s.name = "RateApp"
|
||||
s.version = package["version"]
|
||||
s.summary = package["description"]
|
||||
s.homepage = package["homepage"]
|
||||
s.license = package["license"]
|
||||
s.authors = package["author"]
|
||||
|
||||
s.platforms = { :ios => "14.0" }
|
||||
s.source = { :git => "https://github.com/huextrat/react-native-rate-app.git", :tag => "v#{s.version}" }
|
||||
s.platforms = { :ios => min_ios_version_supported }
|
||||
s.source = { :git => "https://github.com/huextrat/react-native-rate-app.git", :tag => "#{s.version}" }
|
||||
|
||||
s.source_files = "ios/**/*.{h,m,mm,cpp}"
|
||||
s.private_header_files = "ios/generated/**/*.h"
|
||||
|
||||
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
||||
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
||||
if respond_to?(:install_modules_dependencies, true)
|
||||
install_modules_dependencies(s)
|
||||
else
|
||||
@ -30,7 +32,6 @@ Pod::Spec.new do |s|
|
||||
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
||||
}
|
||||
s.dependency "React-RCTFabric"
|
||||
s.dependency "React-Codegen"
|
||||
s.dependency "RCT-Folly"
|
||||
s.dependency "RCTRequired"
|
||||
@ -1,6 +1,7 @@
|
||||
buildscript {
|
||||
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
|
||||
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["RateApp_kotlinVersion"]
|
||||
ext.getExtOrDefault = {name ->
|
||||
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['RateApp_' + name]
|
||||
}
|
||||
|
||||
repositories {
|
||||
google()
|
||||
@ -8,12 +9,13 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "com.android.tools.build:gradle:7.2.1"
|
||||
classpath "com.android.tools.build:gradle:8.7.2"
|
||||
// noinspection DifferentKotlinGradleVersion
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def isNewArchitectureEnabled() {
|
||||
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
||||
}
|
||||
@ -25,18 +27,28 @@ if (isNewArchitectureEnabled()) {
|
||||
apply plugin: "com.facebook.react"
|
||||
}
|
||||
|
||||
def getExtOrDefault(name) {
|
||||
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["RateApp_" + name]
|
||||
}
|
||||
|
||||
def getExtOrIntegerDefault(name) {
|
||||
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["RateApp_" + name]).toInteger()
|
||||
}
|
||||
|
||||
def supportsNamespace() {
|
||||
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
|
||||
def major = parsed[0].toInteger()
|
||||
def minor = parsed[1].toInteger()
|
||||
|
||||
// Namespace support was added in 7.3.0
|
||||
return (major == 7 && minor >= 3) || major >= 8
|
||||
}
|
||||
|
||||
android {
|
||||
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
|
||||
if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
|
||||
if (supportsNamespace()) {
|
||||
namespace "com.rateapp"
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
manifest.srcFile "src/main/AndroidManifestNew.xml"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
||||
@ -44,6 +56,7 @@ android {
|
||||
defaultConfig {
|
||||
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
||||
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
||||
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
@ -68,9 +81,10 @@ android {
|
||||
sourceSets {
|
||||
main {
|
||||
if (isNewArchitectureEnabled()) {
|
||||
java.srcDirs += ["src/newarch"]
|
||||
} else {
|
||||
java.srcDirs += ["src/oldarch"]
|
||||
java.srcDirs += [
|
||||
"generated/java",
|
||||
"generated/jni"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -84,8 +98,15 @@ repositories {
|
||||
def kotlin_version = getExtOrDefault("kotlinVersion")
|
||||
|
||||
dependencies {
|
||||
//noinspection GradleDynamicVersion
|
||||
implementation "com.facebook.react:react-native:+"
|
||||
implementation "com.facebook.react:react-android"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
implementation "com.google.android.play:review:2.0.1"
|
||||
}
|
||||
|
||||
if (isNewArchitectureEnabled()) {
|
||||
react {
|
||||
jsRootDir = file("../src/")
|
||||
libraryName = "RateApp"
|
||||
codegenJavaPackageName = "com.rateapp"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
RateApp_kotlinVersion=1.9.24
|
||||
RateApp_minSdkVersion=21
|
||||
RateApp_kotlinVersion=2.0.21
|
||||
RateApp_minSdkVersion=24
|
||||
RateApp_targetSdkVersion=34
|
||||
RateApp_compileSdkVersion=34
|
||||
RateApp_ndkversion=26.1.10909125
|
||||
RateApp_compileSdkVersion=35
|
||||
RateApp_ndkVersion=27.1.12297006
|
||||
|
||||
@ -1 +1,3 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"/>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.rateapp">
|
||||
</manifest>
|
||||
|
||||
2
android/src/main/AndroidManifestNew.xml
Normal file
2
android/src/main/AndroidManifestNew.xml
Normal file
@ -0,0 +1,2 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
</manifest>
|
||||
@ -12,22 +12,23 @@ import com.facebook.react.bridge.ActivityEventListener
|
||||
import com.facebook.react.bridge.ReactApplicationContext
|
||||
import com.facebook.react.bridge.ReactMethod
|
||||
import com.facebook.react.bridge.Promise
|
||||
import com.facebook.react.module.annotations.ReactModule
|
||||
|
||||
import com.google.android.play.core.review.ReviewManager
|
||||
import com.google.android.play.core.review.ReviewManagerFactory
|
||||
|
||||
class RateAppModule internal constructor(context: ReactApplicationContext) :
|
||||
RateAppSpec(context), ActivityEventListener {
|
||||
@ReactModule(name = RateAppModule.NAME)
|
||||
class RateAppModule(reactContext: ReactApplicationContext) :
|
||||
NativeRateAppSpec(reactContext), ActivityEventListener {
|
||||
|
||||
init {
|
||||
context.addActivityEventListener(this)
|
||||
reactContext.addActivityEventListener(this)
|
||||
}
|
||||
|
||||
override fun getName(): String {
|
||||
return NAME
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
override fun requestReview(promise: Promise) {
|
||||
val manager: ReviewManager = ReviewManagerFactory.create(reactApplicationContext)
|
||||
val request = manager.requestReviewFlow()
|
||||
@ -52,7 +53,6 @@ class RateAppModule internal constructor(context: ReactApplicationContext) :
|
||||
}
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
override fun requestReviewAppGallery(promise: Promise) {
|
||||
promiseAppGallery = promise;
|
||||
val intent = Intent("com.huawei.appmarket.intent.action.guidecomment")
|
||||
@ -72,7 +72,6 @@ class RateAppModule internal constructor(context: ReactApplicationContext) :
|
||||
}
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
override fun requestReviewGalaxyStore(packageName: String, promise: Promise) {
|
||||
val ai = reactApplicationContext.packageManager.getApplicationInfo("com.sec.android.app.samsungapps", PackageManager.GET_META_DATA)
|
||||
val inappReviewVersion = ai.metaData.getInt("com.sec.android.app.samsungapps.review.inappReview", 0)
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
package com.rateapp
|
||||
|
||||
import com.facebook.react.TurboReactPackage
|
||||
import com.facebook.react.bridge.ReactApplicationContext
|
||||
import com.facebook.react.BaseReactPackage
|
||||
import com.facebook.react.bridge.NativeModule
|
||||
import com.facebook.react.module.model.ReactModuleInfoProvider
|
||||
import com.facebook.react.bridge.ReactApplicationContext
|
||||
import com.facebook.react.module.model.ReactModuleInfo
|
||||
import com.facebook.react.module.model.ReactModuleInfoProvider
|
||||
import java.util.HashMap
|
||||
|
||||
class RateAppPackage : TurboReactPackage() {
|
||||
class RateAppPackage : BaseReactPackage() {
|
||||
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
|
||||
return if (name == RateAppModule.NAME) {
|
||||
RateAppModule(reactContext)
|
||||
@ -24,7 +24,6 @@ class RateAppPackage : TurboReactPackage() {
|
||||
RateAppModule.NAME,
|
||||
false, // canOverrideExistingModule
|
||||
false, // needsEagerInit
|
||||
true, // hasConstants
|
||||
false, // isCxxModule
|
||||
true // isTurboModule
|
||||
)
|
||||
|
||||
@ -1,8 +0,0 @@
|
||||
package com.rateapp
|
||||
|
||||
import com.facebook.react.bridge.ActivityEventListener
|
||||
import com.facebook.react.bridge.ReactApplicationContext
|
||||
|
||||
abstract class RateAppSpec internal constructor(context: ReactApplicationContext) :
|
||||
NativeRateAppSpec(context), ActivityEventListener {
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
package com.rateapp
|
||||
|
||||
import com.facebook.react.bridge.ActivityEventListener
|
||||
import com.facebook.react.bridge.ReactApplicationContext
|
||||
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
||||
import com.facebook.react.bridge.Promise
|
||||
|
||||
abstract class RateAppSpec internal constructor(context: ReactApplicationContext) :
|
||||
ReactContextBaseJavaModule(context), ActivityEventListener {
|
||||
|
||||
abstract fun requestReview(promise: Promise)
|
||||
abstract fun requestReviewAppGallery(promise: Promise)
|
||||
abstract fun requestReviewGalaxyStore(packageName: String, promise: Promise)
|
||||
}
|
||||
@ -1,5 +1,3 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
['module:react-native-builder-bob/babel-preset', { modules: 'commonjs' }],
|
||||
],
|
||||
presets: ['module:react-native-builder-bob/babel-preset'],
|
||||
};
|
||||
|
||||
@ -8,6 +8,27 @@ PODS:
|
||||
- hermes-engine (0.78.0):
|
||||
- hermes-engine/Pre-built (= 0.78.0)
|
||||
- hermes-engine/Pre-built (0.78.0)
|
||||
- RateApp (0.1.0):
|
||||
- DoubleConversion
|
||||
- glog
|
||||
- hermes-engine
|
||||
- RCT-Folly (= 2024.11.18.00)
|
||||
- RCTRequired
|
||||
- RCTTypeSafety
|
||||
- React-Core
|
||||
- React-debug
|
||||
- React-Fabric
|
||||
- React-featureflags
|
||||
- React-graphics
|
||||
- React-ImageManager
|
||||
- React-NativeModulesApple
|
||||
- React-RCTFabric
|
||||
- React-rendererdebug
|
||||
- React-utils
|
||||
- ReactCodegen
|
||||
- ReactCommon/turbomodule/bridging
|
||||
- ReactCommon/turbomodule/core
|
||||
- Yoga
|
||||
- RCT-Folly (2024.11.18.00):
|
||||
- boost
|
||||
- DoubleConversion
|
||||
@ -1238,27 +1259,6 @@ PODS:
|
||||
- React-jsiexecutor
|
||||
- React-RCTFBReactNativeSpec
|
||||
- ReactCommon/turbomodule/core
|
||||
- react-native-rate-app (1.1.4):
|
||||
- DoubleConversion
|
||||
- glog
|
||||
- hermes-engine
|
||||
- RCT-Folly (= 2024.11.18.00)
|
||||
- RCTRequired
|
||||
- RCTTypeSafety
|
||||
- React-Core
|
||||
- React-debug
|
||||
- React-Fabric
|
||||
- React-featureflags
|
||||
- React-graphics
|
||||
- React-ImageManager
|
||||
- React-NativeModulesApple
|
||||
- React-RCTFabric
|
||||
- React-rendererdebug
|
||||
- React-utils
|
||||
- ReactCodegen
|
||||
- ReactCommon/turbomodule/bridging
|
||||
- ReactCommon/turbomodule/core
|
||||
- Yoga
|
||||
- React-NativeModulesApple (0.78.0):
|
||||
- glog
|
||||
- hermes-engine
|
||||
@ -1557,6 +1557,7 @@ DEPENDENCIES:
|
||||
- fmt (from `../node_modules/react-native/third-party-podspecs/fmt.podspec`)
|
||||
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
|
||||
- hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
|
||||
- RateApp (from `../..`)
|
||||
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
|
||||
- RCT-Folly/Fabric (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
|
||||
- RCTDeprecation (from `../node_modules/react-native/ReactApple/Libraries/RCTFoundation/RCTDeprecation`)
|
||||
@ -1589,7 +1590,6 @@ DEPENDENCIES:
|
||||
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
|
||||
- React-Mapbuffer (from `../node_modules/react-native/ReactCommon`)
|
||||
- React-microtasksnativemodule (from `../node_modules/react-native/ReactCommon/react/nativemodule/microtasks`)
|
||||
- react-native-rate-app (from `../..`)
|
||||
- React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
|
||||
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
|
||||
- React-performancetimeline (from `../node_modules/react-native/ReactCommon/react/performance/timeline`)
|
||||
@ -1640,6 +1640,8 @@ EXTERNAL SOURCES:
|
||||
hermes-engine:
|
||||
:podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec"
|
||||
:tag: hermes-2025-01-13-RNv0.78.0-a942ef374897d85da38e9c8904574f8376555388
|
||||
RateApp:
|
||||
:path: "../.."
|
||||
RCT-Folly:
|
||||
:podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
|
||||
RCTDeprecation:
|
||||
@ -1700,8 +1702,6 @@ EXTERNAL SOURCES:
|
||||
:path: "../node_modules/react-native/ReactCommon"
|
||||
React-microtasksnativemodule:
|
||||
:path: "../node_modules/react-native/ReactCommon/react/nativemodule/microtasks"
|
||||
react-native-rate-app:
|
||||
:path: "../.."
|
||||
React-NativeModulesApple:
|
||||
:path: "../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios"
|
||||
React-perflogger:
|
||||
@ -1769,6 +1769,7 @@ SPEC CHECKSUMS:
|
||||
fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd
|
||||
glog: eb93e2f488219332457c3c4eafd2738ddc7e80b8
|
||||
hermes-engine: b417d2b2aee3b89b58e63e23a51e02be91dc876d
|
||||
RateApp: 5c6e01fcc85788223cb10e33b3695dfb365c4c9e
|
||||
RCT-Folly: e78785aa9ba2ed998ea4151e314036f6c49e6d82
|
||||
RCTDeprecation: b2eecf2d60216df56bc5e6be5f063826d3c1ee35
|
||||
RCTRequired: 78522de7dc73b81f3ed7890d145fa341f5bb32ea
|
||||
@ -1799,7 +1800,6 @@ SPEC CHECKSUMS:
|
||||
React-logger: 018826bfd51b9f18e87f67db1590bc510ad20664
|
||||
React-Mapbuffer: 3c11cee7737609275c7b66bd0b1de475f094cedf
|
||||
React-microtasksnativemodule: 843f352b32aacbe13a9c750190d34df44c3e6c2c
|
||||
react-native-rate-app: e539f4df5dce5dc58cb23df0dae0bd8de2d64b12
|
||||
React-NativeModulesApple: 88433b6946778bea9c153e27b671de15411bf225
|
||||
React-perflogger: 9e8d3c0dc0194eb932162812a168aa5dc662f418
|
||||
React-performancetimeline: 5a2d6efef52bdcefac079c7baa30934978acd023
|
||||
|
||||
@ -11,8 +11,8 @@
|
||||
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
|
||||
761780ED2CA45674006654EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 761780EC2CA45674006654EE /* AppDelegate.swift */; };
|
||||
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
|
||||
9A55F00E2D7224A40096D762 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A55F00D2D7224A40096D762 /* StoreKit.framework */; };
|
||||
DD8A9FD9E40EC7651DAF8D3E /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; };
|
||||
9A5F697E2D724A57007F50BF /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A5F697D2D724A57007F50BF /* StoreKit.framework */; };
|
||||
F0D24A8CD5CB6DD69DC4E371 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@ -25,7 +25,7 @@
|
||||
5DCACB8F33CDC322A6C60F78 /* libPods-RateAppExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RateAppExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = RateAppExample/AppDelegate.swift; sourceTree = "<group>"; };
|
||||
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = RateAppExample/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
9A55F00D2D7224A40096D762 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
|
||||
9A5F697D2D724A57007F50BF /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
|
||||
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
9A55F00E2D7224A40096D762 /* StoreKit.framework in Frameworks */,
|
||||
9A5F697E2D724A57007F50BF /* StoreKit.framework in Frameworks */,
|
||||
0C80B921A6F3F58F76C31292 /* libPods-RateAppExample.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@ -57,7 +57,7 @@
|
||||
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9A55F00D2D7224A40096D762 /* StoreKit.framework */,
|
||||
9A5F697D2D724A57007F50BF /* StoreKit.framework */,
|
||||
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
|
||||
5DCACB8F33CDC322A6C60F78 /* libPods-RateAppExample.a */,
|
||||
);
|
||||
@ -164,7 +164,7 @@
|
||||
files = (
|
||||
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
|
||||
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
|
||||
DD8A9FD9E40EC7651DAF8D3E /* PrivacyInfo.xcprivacy in Resources */,
|
||||
F0D24A8CD5CB6DD69DC4E371 /* PrivacyInfo.xcprivacy in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
@ -1,56 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>RateAppExample</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<!-- Do not change NSAllowsArbitraryLoads to true, or you will risk app rejection! -->
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<false/>
|
||||
<key>NSAllowsLocalNetworking</key>
|
||||
<true/>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>RateAppExample</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true />
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<!-- Do not change NSAllowsArbitraryLoads to true, or you will risk app rejection! -->
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<false />
|
||||
<key>NSAllowsLocalNetworking</key>
|
||||
<true />
|
||||
</dict>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string></string>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<false />
|
||||
<key>LSApplicationQueriesSchemes</key>
|
||||
<array>
|
||||
<string>itms-apps</string>
|
||||
</array>
|
||||
</dict>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string></string>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<false/>
|
||||
<key>LSApplicationQueriesSchemes</key>
|
||||
<array>
|
||||
<string>itms-apps</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
</plist>
|
||||
@ -19,7 +19,7 @@
|
||||
"@babel/runtime": "^7.25.0",
|
||||
"@react-native-community/cli": "15.1.3",
|
||||
"@react-native-community/cli-platform-android": "15.1.3",
|
||||
"@react-native-community/cli-platform-ios": "15.0.1",
|
||||
"@react-native-community/cli-platform-ios": "15.1.3",
|
||||
"@react-native/babel-preset": "0.78.0",
|
||||
"@react-native/metro-config": "0.78.0",
|
||||
"@react-native/typescript-config": "0.78.0",
|
||||
|
||||
15
package.json
15
package.json
@ -14,6 +14,7 @@
|
||||
"ios",
|
||||
"cpp",
|
||||
"*.podspec",
|
||||
"react-native.config.js",
|
||||
"!ios/build",
|
||||
"!android/build",
|
||||
"!android/gradle",
|
||||
@ -84,7 +85,7 @@
|
||||
"typescript": "5.8.2"
|
||||
},
|
||||
"resolutions": {
|
||||
"@types/react": "19.0.10"
|
||||
"@types/react": "^19.0.10"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "*",
|
||||
@ -98,7 +99,7 @@
|
||||
"workspaces": [
|
||||
"example"
|
||||
],
|
||||
"packageManager": "yarn@4.6.0",
|
||||
"packageManager": "yarn@3.6.1",
|
||||
"jest": {
|
||||
"preset": "react-native",
|
||||
"modulePathIgnorePatterns": [
|
||||
@ -112,7 +113,7 @@
|
||||
"src/**/*.ts",
|
||||
"src/**/*.tsx",
|
||||
"!src/types.ts",
|
||||
"!src/codegenSpec/**",
|
||||
"!src/NativeRateApp.ts",
|
||||
"!src/plugin/**"
|
||||
],
|
||||
"collectCoverage": true
|
||||
@ -133,8 +134,8 @@
|
||||
},
|
||||
"codegenConfig": {
|
||||
"name": "RNRateAppSpec",
|
||||
"type": "all",
|
||||
"jsSrcsDir": "./src/codegenSpec",
|
||||
"type": "modules",
|
||||
"jsSrcsDir": "src",
|
||||
"outputDir": {
|
||||
"ios": "ios/generated",
|
||||
"android": "android/generated"
|
||||
@ -145,8 +146,8 @@
|
||||
"includesGeneratedCode": true
|
||||
},
|
||||
"create-react-native-library": {
|
||||
"type": "module-mixed",
|
||||
"type": "turbo-module",
|
||||
"languages": "kotlin-objc",
|
||||
"version": "0.41.2"
|
||||
"version": "0.48.3"
|
||||
}
|
||||
}
|
||||
|
||||
12
react-native.config.js
Normal file
12
react-native.config.js
Normal file
@ -0,0 +1,12 @@
|
||||
/**
|
||||
* @type {import('@react-native-community/cli-types').UserDependencyConfig}
|
||||
*/
|
||||
module.exports = {
|
||||
dependency: {
|
||||
platforms: {
|
||||
android: {
|
||||
cmakeListsPath: 'generated/jni/CMakeLists.txt',
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
@ -1,8 +1,6 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:recommended"
|
||||
],
|
||||
"extends": ["config:recommended"],
|
||||
"enabledManagers": ["npm", "github-actions"],
|
||||
"packageRules": [
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Linking, Platform } from "react-native";
|
||||
import NativeRateApp from "../codegenSpec/NativeRateApp";
|
||||
import NativeRateApp from "../NativeRateApp";
|
||||
import RateApp, { IOS_REVIEW_URL } from "../index";
|
||||
import { AndroidMarket } from "../types";
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Linking, Platform } from "react-native";
|
||||
import NativeRateApp from "./codegenSpec/NativeRateApp";
|
||||
import RateApp from "./NativeRateApp";
|
||||
import { ANDROID_MARKET_URLS, IOS_REVIEW_URL } from "./constants";
|
||||
import {
|
||||
AndroidMarket,
|
||||
@ -17,7 +17,7 @@ class RateAppError extends Error {
|
||||
}
|
||||
}
|
||||
|
||||
const RateApp = {
|
||||
const RNRateApp = {
|
||||
/**
|
||||
* Requests a review from the user.
|
||||
*
|
||||
@ -39,16 +39,14 @@ const RateApp = {
|
||||
"androidPackageName is required for Samsung Galaxy Store",
|
||||
);
|
||||
}
|
||||
return await NativeRateApp.requestReviewGalaxyStore(
|
||||
androidPackageName,
|
||||
);
|
||||
return await RateApp.requestReviewGalaxyStore(androidPackageName);
|
||||
case AndroidMarket.HUAWEI:
|
||||
return await NativeRateApp.requestReviewAppGallery();
|
||||
return await RateApp.requestReviewAppGallery();
|
||||
default:
|
||||
return await NativeRateApp.requestReview();
|
||||
return await RateApp.requestReview();
|
||||
}
|
||||
}
|
||||
return await NativeRateApp.requestReview();
|
||||
return await RateApp.requestReview();
|
||||
} catch (error) {
|
||||
throw new RateAppError(`Failed to request review: ${error}`);
|
||||
}
|
||||
@ -115,5 +113,5 @@ const RateApp = {
|
||||
export * from "./types";
|
||||
export * from "./constants";
|
||||
export const { requestReview, openStoreForReview, getAndroidMarketUrl } =
|
||||
RateApp;
|
||||
export default RateApp;
|
||||
RNRateApp;
|
||||
export default RNRateApp;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user