react-native-google-mobile-ads 14.0.1 → 14.1.0

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.
@@ -1,67 +1,30 @@
1
1
  import groovy.json.JsonOutput
2
2
  import groovy.json.JsonSlurper
3
3
 
4
- String[] fileNames = ["app.json", "app.config.js"]
5
- String fileName = null
4
+ String fileName = "app.json"
6
5
  String jsonRoot = "react-native-google-mobile-ads"
7
6
  String jsonRaw = "GOOGLE_MOBILE_ADS_JSON_RAW"
8
7
 
9
- File configFile = null
8
+ File jsonFile = null
10
9
  File parentDir = rootProject.projectDir
11
10
 
12
11
  for (int i = 0; i <= 3; i++) {
13
12
  if (parentDir == null) break
14
13
  parentDir = parentDir.parentFile
15
14
  if (parentDir != null) {
16
- configFile = new File(parentDir, fileNames[0])
17
- if (configFile.exists()) {
18
- fileName = fileNames[0]
19
- break
20
- }
21
- else {
22
- configFile = new File(parentDir, fileNames[1])
23
- if (configFile.exists()) {
24
- fileName = fileNames[0]
25
- break
26
- }
27
- }
15
+ jsonFile = new File(parentDir, fileName)
16
+ if (jsonFile.exists()) break
28
17
  }
29
18
  }
30
19
 
31
- if (configFile != null && configFile.exists()) {
32
- rootProject.logger.info ":${project.name} ${fileName} found at ${configFile.toString()}"
20
+ if (jsonFile != null && jsonFile.exists()) {
21
+ rootProject.logger.info ":${project.name} ${fileName} found at ${jsonFile.toString()}"
33
22
  Object json = null
34
23
 
35
24
  try {
36
- // On windows, we need to escape path separators in the path before exec'ing shell
37
- def configFileAbsolutePath = configFile.absolutePath
38
- if (System.properties['os.name'].toLowerCase().contains('windows')) {
39
- configFileAbsolutePath = configFileAbsolutePath.replace("\\", "\\\\")
40
- }
41
- // rootProject.logger.warn "have a path of ${configFileAbsolutePath}"
42
-
43
- // The config may be either in Expo javascript (app.config.js) or JSON (app.json)
44
- // If it is configured in Expo javascript, requiring it will generate a config
45
- // If it is configured in JSON, requiring it will also generate the config
46
- // So, use node to pull in the config file to get us a JSON string for either case
47
- def configOutput = new StringBuffer();
48
- def configReadProc = [
49
- "node",
50
- "-e",
51
- "console.log(JSON.stringify(require('${configFileAbsolutePath}')));"
52
- ]
53
- .execute(null, projectDir)
54
- configReadProc.waitForProcessOutput(configOutput, System.err)
55
- configOutput = configOutput.toString().trim()
56
- // rootProject.logger.warn "got configOutput of ${configOutput.toString()}"
57
-
58
- if (configOutput && !configOutput.isEmpty()) {
59
- json = new JsonSlurper().parseText(configOutput)
60
- } else {
61
- throw new Exception(":${project.name} received empty output while parsing ${configFile} found at ${configFile.toString()}.")
62
- }
25
+ json = new JsonSlurper().parseText(jsonFile.text)
63
26
  } catch (Exception ignored) {
64
- rootProject.logger.warn ":${project.name} failed to parse ${configFile} found at ${configFile.toString()}."
27
+ rootProject.logger.warn ":${project.name} failed to parse ${fileName} found at ${jsonFile.toString()}."
65
28
  rootProject.logger.warn ignored.toString()
66
29
  }
67
30
 
@@ -92,7 +92,7 @@ if (!appJSONGoogleMobileAdsAppIDString && !isExpoProject) {
92
92
  println "\n\n\n"
93
93
  println "**************************************************************************************************************"
94
94
  println "\n\n\n"
95
- println "ERROR: react-native-google-mobile-ads requires an 'android_app_id' property inside a 'react-native-google-mobile-ads' key in your app.json or app.config.js."
95
+ println "ERROR: react-native-google-mobile-ads requires an 'android_app_id' property inside a 'react-native-google-mobile-ads' key in your app.json."
96
96
  println " No android_app_id property was found in this location. The native Google Mobile Ads SDK will crash on startup without it."
97
97
  println "\n\n\n"
98
98
  println "**************************************************************************************************************"
@@ -28,6 +28,19 @@ If you set up an app-ads.txt file for your app, you need to also include this li
28
28
 
29
29
  Alternatively, you can enable test devices and use your own ad unit IDs instead.
30
30
 
31
+ ### Check Your ApplicationId
32
+
33
+ If you initiated your project with `react-native init`, the auto-generated `applicationId` might not fulfill the required structure or uniqueness needed for AdMob integration. This can lead to issues where the request was succesfull but no ads are shown. Here are common reasons and fixes related to `applicationId` issues:
34
+
35
+ - **Non-unique ApplicationId**: The default `applicationId` may clash with existing apps, especially if you haven't customized it. AdMob requires a unique identifier for each app to correctly manage ad requests and revenue.
36
+
37
+ - **Improperly Structured ApplicationId**: The `applicationId` should generally follow Java package name conventions, such as `com.companyname.appname`. It must start with a letter, and can only include letters (a-z, A-Z), numbers (0-9), and underscores (_).
38
+
39
+ Google documentation: [Configure the app module](https://developer.android.com/build/configure-app-module?hl=de)
40
+
41
+ **Important**: If you change the application ID of an already published app, Google Play Store treats the upload as a completely different app!
42
+
43
+
31
44
  ### Enable test devices
32
45
 
33
46
  If you want to do more rigorous testing with production-looking ads, configure your device as a test device and use your own ad unit IDs that you've created in the AdMob UI.
package/ios_config.sh CHANGED
@@ -28,13 +28,6 @@
28
28
 
29
29
  set -e
30
30
 
31
- if [[ -f "$PODS_ROOT/../.xcode.env" ]]; then
32
- source "$PODS_ROOT/../.xcode.env"
33
- fi
34
- if [[ -f "$PODS_ROOT/../.xcode.env.local" ]]; then
35
- source "$PODS_ROOT/../.xcode.env.local"
36
- fi
37
-
38
31
  _MAX_LOOKUPS=2;
39
32
  _SEARCH_RESULT=''
40
33
  _RN_ROOT_EXISTS=''
@@ -42,13 +35,11 @@ _CURRENT_LOOKUPS=1
42
35
  _PROJECT_ABBREVIATION="RNGoogleMobileAds"
43
36
  _JSON_ROOT="'react-native-google-mobile-ads'"
44
37
  _JSON_FILE_NAME='app.json'
45
- _JS_APP_CONFIG_FILE_NAME='app.config.js'
46
38
  _JSON_OUTPUT_BASE64='e30=' # { }
47
39
  _CURRENT_SEARCH_DIR=${PROJECT_DIR}
48
40
  _PLIST_BUDDY=/usr/libexec/PlistBuddy
49
41
  _TARGET_PLIST="${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}"
50
42
  _DSYM_PLIST="${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist"
51
- _IS_CONFIG_JS=false
52
43
  _PACKAGE_JSON_NAME='package.json'
53
44
 
54
45
  # plist arrays
@@ -87,26 +78,13 @@ fi;
87
78
 
88
79
  while true; do
89
80
  _CURRENT_SEARCH_DIR=$(dirname "$_CURRENT_SEARCH_DIR")
90
-
91
- if [[ "$_CURRENT_SEARCH_DIR" == "/" ]] || [[ ${_CURRENT_LOOKUPS} -gt ${_MAX_LOOKUPS} ]]; then
92
- break;
93
- fi;
94
-
95
- echo "info: ($_CURRENT_LOOKUPS of $_MAX_LOOKUPS) Searching in '$_CURRENT_SEARCH_DIR' for a ${_JSON_FILE_NAME}/${_JS_APP_CONFIG_FILE_NAME} file."
96
-
97
- _SEARCH_RESULT=$(find "$_CURRENT_SEARCH_DIR" -maxdepth 2 \( -name ${_JSON_FILE_NAME} -o -name ${_JS_APP_CONFIG_FILE_NAME} \) -print | /usr/bin/head -n 1)
98
-
99
- if [[ "$(basename ${_SEARCH_RESULT})" = "${_JS_APP_CONFIG_FILE_NAME}" ]]; then
100
- _IS_CONFIG_JS=true
101
- echo "info: ${_JS_APP_CONFIG_FILE_NAME} found at $_SEARCH_RESULT"
81
+ if [[ "$_CURRENT_SEARCH_DIR" == "/" ]] || [[ ${_CURRENT_LOOKUPS} -gt ${_MAX_LOOKUPS} ]]; then break; fi;
82
+ echo "info: ($_CURRENT_LOOKUPS of $_MAX_LOOKUPS) Searching in '$_CURRENT_SEARCH_DIR' for a ${_JSON_FILE_NAME} file."
83
+ _SEARCH_RESULT=$(find "$_CURRENT_SEARCH_DIR" -maxdepth 2 -name ${_JSON_FILE_NAME} -print | /usr/bin/head -n 1)
84
+ if [[ ${_SEARCH_RESULT} ]]; then
85
+ echo "info: ${_JSON_FILE_NAME} found at $_SEARCH_RESULT"
102
86
  break;
103
87
  fi;
104
-
105
- if [[ "$(basename ${_SEARCH_RESULT})" = "${_JSON_FILE_NAME}" ]]; then
106
- echo "info: ${_JSON_FILE_NAME} found at ${_SEARCH_RESULT}"
107
- break;
108
- fi;
109
-
110
88
  _CURRENT_LOOKUPS=$((_CURRENT_LOOKUPS+1))
111
89
  done
112
90
 
@@ -120,12 +98,7 @@ if [[ ${_IS_PROJECT_USING_EXPO} == "true" ]]; then
120
98
  fi
121
99
 
122
100
  if [[ ${_SEARCH_RESULT} ]]; then
123
- if [[ ${_IS_CONFIG_JS} == "true" ]]; then
124
- _JSON_OUTPUT_RAW=$("${NODE_BINARY}" -e "console.log(JSON.stringify(require('${_SEARCH_RESULT}')));")
125
- else
126
- _JSON_OUTPUT_RAW=$(cat "${_SEARCH_RESULT}")
127
- fi;
128
-
101
+ _JSON_OUTPUT_RAW=$(cat "${_SEARCH_RESULT}")
129
102
  _RN_ROOT_EXISTS=$(ruby -KU -e "require 'rubygems';require 'json'; output=JSON.parse('$_JSON_OUTPUT_RAW'); puts output[$_JSON_ROOT]" || echo '')
130
103
 
131
104
  if [[ ${_RN_ROOT_EXISTS} ]]; then
@@ -225,4 +198,3 @@ for plist in "${_TARGET_PLIST}" "${_DSYM_PLIST}" ; do
225
198
  done
226
199
 
227
200
  echo "info: <- ${_PROJECT_ABBREVIATION} build script finished"
228
-
@@ -5,5 +5,5 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = void 0;
7
7
  // Generated by genversion.
8
- const version = exports.version = '14.0.1';
8
+ const version = exports.version = '14.1.0';
9
9
  //# sourceMappingURL=version.js.map
@@ -1,3 +1,3 @@
1
1
  // Generated by genversion.
2
- export const version = '14.0.1';
2
+ export const version = '14.1.0';
3
3
  //# sourceMappingURL=version.js.map
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "14.0.1";
1
+ export declare const SDK_VERSION = "14.1.0";
2
2
  export { default, MobileAds } from './MobileAds';
3
3
  export { AdsConsentDebugGeography } from './AdsConsentDebugGeography';
4
4
  export { AdsConsentPurposes } from './AdsConsentPurposes';
@@ -1,2 +1,2 @@
1
- export declare const version = "14.0.1";
1
+ export declare const version = "14.1.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-google-mobile-ads",
3
- "version": "14.0.1",
3
+ "version": "14.1.0",
4
4
  "author": "Invertase <oss@invertase.io> (http://invertase.io)",
5
5
  "description": "React Native Google Mobile Ads is an easy way to monetize mobile apps with targeted, in-app advertising.",
6
6
  "main": "lib/commonjs/index.js",
@@ -43,16 +43,16 @@
43
43
  ],
44
44
  "sdkVersions": {
45
45
  "ios": {
46
- "googleMobileAds": "11.5.0",
47
- "googleUmp": "2.4.0"
46
+ "googleMobileAds": "11.7.0",
47
+ "googleUmp": "2.5.0"
48
48
  },
49
49
  "android": {
50
50
  "minSdk": 21,
51
51
  "targetSdk": 34,
52
52
  "compileSdk": 34,
53
53
  "buildTools": "34.0.0",
54
- "googleMobileAds": "23.1.0",
55
- "googleUmp": "2.2.0"
54
+ "googleMobileAds": "23.2.0",
55
+ "googleUmp": "3.0.0"
56
56
  }
57
57
  },
58
58
  "react-native-builder-bob": {
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '14.0.1';
2
+ export const version = '14.1.0';