react-native-rate-app 1.1.4 → 1.1.5

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/app.plugin.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require("./lib/commonjs/plugin/withReactNativeRateApp");
package/ios/RateApp.h CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  #ifdef RCT_NEW_ARCH_ENABLED
3
- #import "RateAppSpec.h"
3
+ #import "generated/RNRateAppSpec/RNRateAppSpec.h"
4
4
 
5
5
  @interface RateApp : NSObject <NativeRateAppSpec>
6
6
  #else
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _configPlugins = require("@expo/config-plugins");
8
+ /**
9
+ * Modifies the `Info.plist` file to add `LSApplicationQueriesSchemes`,
10
+ * allowing the app to open App Store links.
11
+ *
12
+ * @param {ConfigPlugin} config - The Expo configuration object.
13
+ * @returns {ConfigPlugin} - The modified Expo configuration.
14
+ */
15
+ const withCustomInfoPlist = config => {
16
+ return (0, _configPlugins.withInfoPlist)(config, config => {
17
+ config.modResults.LSApplicationQueriesSchemes = ["itms-apps"];
18
+ return config;
19
+ });
20
+ };
21
+
22
+ /**
23
+ * Adds the `StoreKit.framework` to the iOS Xcode project.
24
+ * This framework is required for in-app review prompts.
25
+ *
26
+ * @param {ConfigPlugin} config - The Expo configuration object.
27
+ * @returns {ConfigPlugin} - The modified Expo configuration.
28
+ */
29
+ const withStoreKitFramework = config => {
30
+ return (0, _configPlugins.withXcodeProject)(config, config => {
31
+ config.modResults.addFramework("StoreKit.framework", {
32
+ required: true
33
+ });
34
+ return config;
35
+ });
36
+ };
37
+
38
+ /**
39
+ * Applies both `withCustomInfoPlist` and `withStoreKitFramework`
40
+ * to enable in-app rating functionality in a React Native app.
41
+ *
42
+ * @param {ConfigPlugin} config - The Expo configuration object.
43
+ * @returns {ConfigPlugin} - The modified Expo configuration.
44
+ */
45
+ const withReactNativeRateApp = config => {
46
+ const configWithInfoPlist = withCustomInfoPlist(config);
47
+ const configWithStoreKit = withStoreKitFramework(configWithInfoPlist);
48
+ return configWithStoreKit;
49
+ };
50
+ var _default = exports.default = withReactNativeRateApp;
51
+ //# sourceMappingURL=withReactNativeRateApp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_configPlugins","require","withCustomInfoPlist","config","withInfoPlist","modResults","LSApplicationQueriesSchemes","withStoreKitFramework","withXcodeProject","addFramework","required","withReactNativeRateApp","configWithInfoPlist","configWithStoreKit","_default","exports","default"],"sourceRoot":"../../../src","sources":["plugin/withReactNativeRateApp.ts"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAiC,GAAIC,MAAM,IAAK;EACpD,OAAO,IAAAC,4BAAa,EAACD,MAAM,EAAGA,MAAM,IAAK;IACvCA,MAAM,CAACE,UAAU,CAACC,2BAA2B,GAAG,CAAC,WAAW,CAAC;IAC7D,OAAOH,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMI,qBAAmC,GAAIJ,MAAM,IAAK;EACtD,OAAO,IAAAK,+BAAgB,EAACL,MAAM,EAAGA,MAAM,IAAK;IAC1CA,MAAM,CAACE,UAAU,CAACI,YAAY,CAAC,oBAAoB,EAAE;MAAEC,QAAQ,EAAE;IAAK,CAAC,CAAC;IACxE,OAAOP,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMQ,sBAAoC,GAAIR,MAAM,IAAK;EACvD,MAAMS,mBAAmB,GAAGV,mBAAmB,CAACC,MAAM,CAAC;EACvD,MAAMU,kBAAkB,GAAGN,qBAAqB,CAACK,mBAAmB,CAAC;EACrE,OAAOC,kBAAkB;AAC3B,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaL,sBAAsB","ignoreList":[]}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ import { withInfoPlist, withXcodeProject } from "@expo/config-plugins";
4
+ /**
5
+ * Modifies the `Info.plist` file to add `LSApplicationQueriesSchemes`,
6
+ * allowing the app to open App Store links.
7
+ *
8
+ * @param {ConfigPlugin} config - The Expo configuration object.
9
+ * @returns {ConfigPlugin} - The modified Expo configuration.
10
+ */
11
+ const withCustomInfoPlist = config => {
12
+ return withInfoPlist(config, config => {
13
+ config.modResults.LSApplicationQueriesSchemes = ["itms-apps"];
14
+ return config;
15
+ });
16
+ };
17
+
18
+ /**
19
+ * Adds the `StoreKit.framework` to the iOS Xcode project.
20
+ * This framework is required for in-app review prompts.
21
+ *
22
+ * @param {ConfigPlugin} config - The Expo configuration object.
23
+ * @returns {ConfigPlugin} - The modified Expo configuration.
24
+ */
25
+ const withStoreKitFramework = config => {
26
+ return withXcodeProject(config, config => {
27
+ config.modResults.addFramework("StoreKit.framework", {
28
+ required: true
29
+ });
30
+ return config;
31
+ });
32
+ };
33
+
34
+ /**
35
+ * Applies both `withCustomInfoPlist` and `withStoreKitFramework`
36
+ * to enable in-app rating functionality in a React Native app.
37
+ *
38
+ * @param {ConfigPlugin} config - The Expo configuration object.
39
+ * @returns {ConfigPlugin} - The modified Expo configuration.
40
+ */
41
+ const withReactNativeRateApp = config => {
42
+ const configWithInfoPlist = withCustomInfoPlist(config);
43
+ const configWithStoreKit = withStoreKitFramework(configWithInfoPlist);
44
+ return configWithStoreKit;
45
+ };
46
+ export default withReactNativeRateApp;
47
+ //# sourceMappingURL=withReactNativeRateApp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["withInfoPlist","withXcodeProject","withCustomInfoPlist","config","modResults","LSApplicationQueriesSchemes","withStoreKitFramework","addFramework","required","withReactNativeRateApp","configWithInfoPlist","configWithStoreKit"],"sourceRoot":"../../../src","sources":["plugin/withReactNativeRateApp.ts"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,gBAAgB,QAAQ,sBAAsB;AAGtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAiC,GAAIC,MAAM,IAAK;EACpD,OAAOH,aAAa,CAACG,MAAM,EAAGA,MAAM,IAAK;IACvCA,MAAM,CAACC,UAAU,CAACC,2BAA2B,GAAG,CAAC,WAAW,CAAC;IAC7D,OAAOF,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,qBAAmC,GAAIH,MAAM,IAAK;EACtD,OAAOF,gBAAgB,CAACE,MAAM,EAAGA,MAAM,IAAK;IAC1CA,MAAM,CAACC,UAAU,CAACG,YAAY,CAAC,oBAAoB,EAAE;MAAEC,QAAQ,EAAE;IAAK,CAAC,CAAC;IACxE,OAAOL,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,sBAAoC,GAAIN,MAAM,IAAK;EACvD,MAAMO,mBAAmB,GAAGR,mBAAmB,CAACC,MAAM,CAAC;EACvD,MAAMQ,kBAAkB,GAAGL,qBAAqB,CAACI,mBAAmB,CAAC;EACrE,OAAOC,kBAAkB;AAC3B,CAAC;AAED,eAAeF,sBAAsB","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ import type { ConfigPlugin } from "expo/config-plugins";
2
+ /**
3
+ * Applies both `withCustomInfoPlist` and `withStoreKitFramework`
4
+ * to enable in-app rating functionality in a React Native app.
5
+ *
6
+ * @param {ConfigPlugin} config - The Expo configuration object.
7
+ * @returns {ConfigPlugin} - The modified Expo configuration.
8
+ */
9
+ declare const withReactNativeRateApp: ConfigPlugin;
10
+ export default withReactNativeRateApp;
11
+ //# sourceMappingURL=withReactNativeRateApp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withReactNativeRateApp.d.ts","sourceRoot":"","sources":["../../../src/plugin/withReactNativeRateApp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AA8BxD;;;;;;GAMG;AACH,QAAA,MAAM,sBAAsB,EAAE,YAI7B,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-rate-app",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "React Native module for In App Rating on Android and iOS",
5
5
  "source": "src/index.tsx",
6
6
  "main": "lib/commonjs/index.js",
@@ -23,7 +23,8 @@
23
23
  "!**/__tests__",
24
24
  "!**/__fixtures__",
25
25
  "!**/__mocks__",
26
- "!**/.*"
26
+ "!**/.*",
27
+ "app.plugin.js"
27
28
  ],
28
29
  "scripts": {
29
30
  "example": "yarn workspace react-native-rate-app-example",
@@ -65,19 +66,21 @@
65
66
  "@biomejs/biome": "1.9.4",
66
67
  "@commitlint/cli": "19.7.1",
67
68
  "@commitlint/config-conventional": "19.7.1",
69
+ "@react-native-community/cli": "15.1.3",
68
70
  "@semantic-release/changelog": "6.0.3",
69
71
  "@semantic-release/git": "10.0.1",
70
72
  "@types/jest": "29.5.14",
71
73
  "@types/react": "19.0.10",
72
74
  "commitlint": "19.7.1",
73
75
  "del-cli": "6.0.0",
76
+ "expo": "^52.0.31",
74
77
  "husky": "9.1.7",
75
78
  "jest": "29.7.0",
76
79
  "react": "19.0.0",
77
80
  "react-native": "0.78.0",
78
81
  "react-native-builder-bob": "0.37.0",
79
82
  "semantic-release": "24.2.3",
80
- "turbo": "2.4.2",
83
+ "turbo": "2.4.4",
81
84
  "typescript": "5.7.3"
82
85
  },
83
86
  "resolutions": {
@@ -87,6 +90,11 @@
87
90
  "react": "*",
88
91
  "react-native": "*"
89
92
  },
93
+ "peerDependenciesMeta": {
94
+ "expo": {
95
+ "optional": true
96
+ }
97
+ },
90
98
  "workspaces": [
91
99
  "example"
92
100
  ],
@@ -104,7 +112,8 @@
104
112
  "src/**/*.ts",
105
113
  "src/**/*.tsx",
106
114
  "!src/types.ts",
107
- "!src/codegenSpec/**"
115
+ "!src/codegenSpec/**",
116
+ "!src/plugin/**"
108
117
  ],
109
118
  "collectCoverage": true
110
119
  },
@@ -123,7 +132,7 @@
123
132
  ]
124
133
  },
125
134
  "codegenConfig": {
126
- "name": "RateAppSpec",
135
+ "name": "RNRateAppSpec",
127
136
  "type": "all",
128
137
  "jsSrcsDir": "./src/codegenSpec",
129
138
  "outputDir": {
@@ -132,7 +141,8 @@
132
141
  },
133
142
  "android": {
134
143
  "javaPackageName": "com.rateapp"
135
- }
144
+ },
145
+ "includesGeneratedCode": true
136
146
  },
137
147
  "create-react-native-library": {
138
148
  "type": "module-mixed",
@@ -1,6 +1,7 @@
1
1
  require "json"
2
2
 
3
3
  package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
4
5
 
5
6
  Pod::Spec.new do |s|
6
7
  s.name = "react-native-rate-app"
@@ -14,10 +15,27 @@ Pod::Spec.new do |s|
14
15
  s.source = { :git => "https://github.com/huextrat/react-native-rate-app.git", :tag => "v#{s.version}" }
15
16
 
16
17
  s.source_files = "ios/**/*.{h,m,mm,cpp}"
18
+ s.private_header_files = "ios/generated/**/*.h"
17
19
 
18
- if defined?(install_modules_dependencies()) != nil
20
+ if respond_to?(:install_modules_dependencies, true)
19
21
  install_modules_dependencies(s)
20
22
  else
21
23
  s.dependency "React-Core"
24
+
25
+ # Don't install the dependencies when we run `pod install` in the old architecture.
26
+ if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
27
+ s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
28
+ s.pod_target_xcconfig = {
29
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
30
+ "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
31
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
32
+ }
33
+ s.dependency "React-RCTFabric"
34
+ s.dependency "React-Codegen"
35
+ s.dependency "RCT-Folly"
36
+ s.dependency "RCTRequired"
37
+ s.dependency "RCTTypeSafety"
38
+ s.dependency "ReactCommon/turbomodule/core"
39
+ end
22
40
  end
23
41
  end
@@ -0,0 +1,45 @@
1
+ import { withInfoPlist, withXcodeProject } from "@expo/config-plugins";
2
+ import type { ConfigPlugin } from "expo/config-plugins";
3
+
4
+ /**
5
+ * Modifies the `Info.plist` file to add `LSApplicationQueriesSchemes`,
6
+ * allowing the app to open App Store links.
7
+ *
8
+ * @param {ConfigPlugin} config - The Expo configuration object.
9
+ * @returns {ConfigPlugin} - The modified Expo configuration.
10
+ */
11
+ const withCustomInfoPlist: ConfigPlugin = (config) => {
12
+ return withInfoPlist(config, (config) => {
13
+ config.modResults.LSApplicationQueriesSchemes = ["itms-apps"];
14
+ return config;
15
+ });
16
+ };
17
+
18
+ /**
19
+ * Adds the `StoreKit.framework` to the iOS Xcode project.
20
+ * This framework is required for in-app review prompts.
21
+ *
22
+ * @param {ConfigPlugin} config - The Expo configuration object.
23
+ * @returns {ConfigPlugin} - The modified Expo configuration.
24
+ */
25
+ const withStoreKitFramework: ConfigPlugin = (config) => {
26
+ return withXcodeProject(config, (config) => {
27
+ config.modResults.addFramework("StoreKit.framework", { required: true });
28
+ return config;
29
+ });
30
+ };
31
+
32
+ /**
33
+ * Applies both `withCustomInfoPlist` and `withStoreKitFramework`
34
+ * to enable in-app rating functionality in a React Native app.
35
+ *
36
+ * @param {ConfigPlugin} config - The Expo configuration object.
37
+ * @returns {ConfigPlugin} - The modified Expo configuration.
38
+ */
39
+ const withReactNativeRateApp: ConfigPlugin = (config) => {
40
+ const configWithInfoPlist = withCustomInfoPlist(config);
41
+ const configWithStoreKit = withStoreKitFramework(configWithInfoPlist);
42
+ return configWithStoreKit;
43
+ };
44
+
45
+ export default withReactNativeRateApp;