invertase / react-native-google-mobile-ads

React Native Google Mobile Ads enables you to monetize your app with AdMob.
https://docs.page/invertase/react-native-google-mobile-ads
Other
673 stars 135 forks source link

[🐛] Expo SDK 49 - EEA Consent Form is not showing up - Android #501

Closed dlenskyi closed 8 months ago

dlenskyi commented 9 months ago

What happened?

Hi, I'm reopening this issue. This bug still remains for Android. I don't know how to fix it. Here's the link to my past issue: https://github.com/invertase/react-native-google-mobile-ads/issues/459

Now the Google Admob gives a warning for android app that my app violates EEA rules and they will disable ads for android app.

Please help me with that!

Platforms

Only on Android

React Native Info

System:
  OS: macOS 13.5.2
  CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Memory: 686.88 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.17.1
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.17
    path: /usr/local/bin/yarn
  npm:
    version: 9.8.1
    path: /usr/local/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.11.3
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.0
      - iOS 17.0
      - macOS 14.0
      - tvOS 17.0
      - watchOS 10.0
  Android SDK:
    API Levels:
      - "30"
      - "31"
      - "32"
      - "33"
      - "33"
      - "33"
      - "34"
    Build Tools:
      - 30.0.2
      - 30.0.3
      - 31.0.0
    System Images:
      - android-30 | Google APIs Intel x86 Atom
      - android-30 | Google Play Intel x86 Atom
      - android-33 | Google Play Intel x86_64 Atom
      - android-34 | Google Play Intel x86_64 Atom
    Android NDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10671973
  Xcode:
    version: 15.0/15A240d
    path: /usr/bin/xcodebuild
Languages:
  Java: Not Found
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.4
    wanted: 0.72.4
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found
Are your using Typescript?

 My project is using Typescript
package.json

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@expo-google-fonts/montserrat": "^0.1.0",
    "@expo/vector-icons": "^13.0.0",
    "@grpc/grpc-js": "^1.9.1",
    "@react-native-async-storage/async-storage": "1.18.2",
    "@react-native-community/eslint-config": "^3.2.0",
    "@react-native-community/netinfo": "9.3.10",
    "@react-native-community/slider": "4.4.2",
    "@react-native-masked-view/masked-view": "0.2.9",
    "@react-navigation/bottom-tabs": "^5.11.7",
    "@react-navigation/drawer": "^5.12.3",
    "@react-navigation/native": "^5.9.8",
    "@react-navigation/stack": "^5.14.2",
    "@sentry/browser": "^6.0.2",
    "@sentry/react-native": "5.5.0",
    "axios": "^0.21.1",
    "babel-plugin-module-resolver": "^5.0.0",
    "deprecated-react-native-prop-types": "^4.2.1",
    "eslint": "^8.48.0",
    "eslint-config-airbnb": "^19.0.4",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-jsx-a11y": "^6.4.1",
    "eslint-plugin-react": "^7.22.0",
    "eslint-plugin-react-hooks": "^4.2.0",
    "esnext": "^3.3.1",
    "expo": "^49.0.8",
    "expo-application": "~5.3.0",
    "expo-asset": "~8.10.1",
    "expo-av": "~13.4.1",
    "expo-build-properties": "~0.8.3",
    "expo-cellular": "~5.3.0",
    "expo-constants": "~14.4.2",
    "expo-dev-client": "~2.4.8",
    "expo-device": "~5.4.0",
    "expo-font": "~11.4.0",
    "expo-linear-gradient": "~12.3.0",
    "expo-linking": "~5.0.2",
    "expo-localization": "~14.3.0",
    "expo-location": "~16.1.0",
    "expo-sharing": "~11.5.0",
    "expo-splash-screen": "~0.20.5",
    "expo-status-bar": "~1.6.0",
    "expo-system-ui": "~2.4.0",
    "expo-updates": "~0.18.12",
    "expo-video-player": "^1.6.1",
    "formik": "^2.2.6",
    "i18next": "^19.8.4",
    "intl": "^1.2.5",
    "lodash": "^4.17.20",
    "moment": "^2.29.1",
    "native-base": "github:arossoftware/NativeBase#stable-version",
    "prop-types": "^15.7.2",
    "qs": "^6.9.6",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-i18next": "^11.8.5",
    "react-native": "0.72.4",
    "react-native-axios": "^0.17.1",
    "react-native-daterange-picker": "github:dlenskyi/react-native-daterange-picker#master",
    "react-native-elements": "^3.3.2",
    "react-native-flash-message": "^0.1.21",
    "react-native-gesture-handler": "~2.12.0",
    "react-native-google-mobile-ads": "^12.1.2",
    "react-native-google-places-autocomplete": "^2.2.0",
    "react-native-international-phone-number": "^0.5.2",
    "react-native-loading-spinner-overlay": "^2.0.0",
    "react-native-localize": "^2.0.1",
    "react-native-maps": "1.7.1",
    "react-native-modal": "^13.0.1",
    "react-native-reanimated": "~3.3.0",
    "react-native-safe-area-context": "4.6.3",
    "react-native-screens": "~3.22.0",
    "react-native-snap-carousel": "^3.9.1",
    "react-native-view-more-text": "^2.1.0",
    "react-native-web": "~0.19.8",
    "react-native-webview": "13.2.2",
    "react-redux": "^7.2.2",
    "redux": "^4.0.5",
    "redux-logger": "^3.0.6",
    "redux-promise": "^0.6.0",
    "redux-thunk": "^2.3.0",
    "sentry-expo": "~7.0.0",
    "yup": "^0.32.8"
  },
  "devDependencies": {
    "@babel/core": "^7.22.11",
    "@babel/eslint-parser": "^7.22.11",
    "babel-preset-expo": "^9.5.0",
    "remote-redux-devtools": "^0.5.16"
  },
  "private": true,
  "name": "src",
  "version": "1.0.0"
}

Are your using Typescript?

package.json

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@expo-google-fonts/montserrat": "^0.1.0",
    "@expo/vector-icons": "^13.0.0",
    "@grpc/grpc-js": "^1.9.1",
    "@react-native-async-storage/async-storage": "1.18.2",
    "@react-native-community/eslint-config": "^3.2.0",
    "@react-native-community/netinfo": "9.3.10",
    "@react-native-community/slider": "4.4.2",
    "@react-native-masked-view/masked-view": "0.2.9",
    "@react-navigation/bottom-tabs": "^5.11.7",
    "@react-navigation/drawer": "^5.12.3",
    "@react-navigation/native": "^5.9.8",
    "@react-navigation/stack": "^5.14.2",
    "@sentry/browser": "^6.0.2",
    "@sentry/react-native": "5.5.0",
    "axios": "^0.21.1",
    "babel-plugin-module-resolver": "^5.0.0",
    "deprecated-react-native-prop-types": "^4.2.1",
    "eslint": "^8.48.0",
    "eslint-config-airbnb": "^19.0.4",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-jsx-a11y": "^6.4.1",
    "eslint-plugin-react": "^7.22.0",
    "eslint-plugin-react-hooks": "^4.2.0",
    "esnext": "^3.3.1",
    "expo": "^49.0.8",
    "expo-application": "~5.3.0",
    "expo-asset": "~8.10.1",
    "expo-av": "~13.4.1",
    "expo-build-properties": "~0.8.3",
    "expo-cellular": "~5.3.0",
    "expo-constants": "~14.4.2",
    "expo-dev-client": "~2.4.8",
    "expo-device": "~5.4.0",
    "expo-font": "~11.4.0",
    "expo-linear-gradient": "~12.3.0",
    "expo-linking": "~5.0.2",
    "expo-localization": "~14.3.0",
    "expo-location": "~16.1.0",
    "expo-sharing": "~11.5.0",
    "expo-splash-screen": "~0.20.5",
    "expo-status-bar": "~1.6.0",
    "expo-system-ui": "~2.4.0",
    "expo-updates": "~0.18.12",
    "expo-video-player": "^1.6.1",
    "formik": "^2.2.6",
    "i18next": "^19.8.4",
    "intl": "^1.2.5",
    "lodash": "^4.17.20",
    "moment": "^2.29.1",
    "native-base": "github:arossoftware/NativeBase#stable-version",
    "prop-types": "^15.7.2",
    "qs": "^6.9.6",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-i18next": "^11.8.5",
    "react-native": "0.72.4",
    "react-native-axios": "^0.17.1",
    "react-native-daterange-picker": "github:dlenskyi/react-native-daterange-picker#master",
    "react-native-elements": "^3.3.2",
    "react-native-flash-message": "^0.1.21",
    "react-native-gesture-handler": "~2.12.0",
    "react-native-google-mobile-ads": "^12.1.2",
    "react-native-google-places-autocomplete": "^2.2.0",
    "react-native-international-phone-number": "^0.5.2",
    "react-native-loading-spinner-overlay": "^2.0.0",
    "react-native-localize": "^2.0.1",
    "react-native-maps": "1.7.1",
    "react-native-modal": "^13.0.1",
    "react-native-reanimated": "~3.3.0",
    "react-native-safe-area-context": "4.6.3",
    "react-native-screens": "~3.22.0",
    "react-native-snap-carousel": "^3.9.1",
    "react-native-view-more-text": "^2.1.0",
    "react-native-web": "~0.19.8",
    "react-native-webview": "13.2.2",
    "react-redux": "^7.2.2",
    "redux": "^4.0.5",
    "redux-logger": "^3.0.6",
    "redux-promise": "^0.6.0",
    "redux-thunk": "^2.3.0",
    "sentry-expo": "~7.0.0",
    "yup": "^0.32.8"
  },
  "devDependencies": {
    "@babel/core": "^7.22.11",
    "@babel/eslint-parser": "^7.22.11",
    "babel-preset-expo": "^9.5.0",
    "remote-redux-devtools": "^0.5.16"
  },
  "private": true,
  "name": "src",
  "version": "1.0.0"
}

app.json

{
  "expo": {
    "name": "Flea Lover",
    "slug": "flea-lover",
    "scheme": "flea-lover",
    "version": "1.1.2",
    "orientation": "portrait",
    "icon": "./assets/icons/app-icon.png",
    "platforms": [
      "ios",
      "android"
    ],
    "userInterfaceStyle": "light",
    "backgroundColor": "#ffffff",
    "splash": {
      "image": "./assets/images/splash.png",
      "resizeMode": "cover",
      "backgroundColor": "#169516"
    },
    "updates": {
      "fallbackToCacheTimeout": 0,
      "url": "https://u.expo.dev/0ff6339c-5d0c-40d2-989f-cfb2cbfc60de"
    },
    "runtimeVersion": "1.1.2",
    "assetBundlePatterns": [
      "assets/**/*"
    ],
    "hooks": {
      "postPublish": [
        {
          "file": "sentry-expo/upload-sourcemaps",
          "config": {
            "organization": "novipos-aps",
            "project": "flea-lover-mobile"
          }
        }
      ]
    },
    "plugins": [
      [
        "expo-build-properties",
        {
          "android": {
            "extraProguardRules": "-keep class com.google.android.gms.internal.consent_sdk.** { *; }"
          }
        }
      ],
      "expo-localization",
      "sentry-expo"
    ],
    "ios": {
      "splash": {
        "image": "./assets/images/splash.png",
        "resizeMode": "cover",
        "backgroundColor": "#169516"
      },
      "associatedDomains": [
        "applinks:mit.loppeonline.dk",
        "applinks:loppestatus.dk",
        "applinks:store.flealover.com"
      ],
      "appStoreUrl": "https://apps.apple.com/us/app/flea-lover/id1567180764",
      "supportsTablet": true,
      "bundleIdentifier": "com.flealover",
      "buildNumber": "1.1.2",
      "config": {
        "googleMapsApiKey": "AIzaSyBoBDIsyPKXEAc0P5bBIsefKzk20GkLqPE",
        "usesNonExemptEncryption": false
      },
      "infoPlist": {
        "CFBundleAllowMixedLocalizations": true,
        "NSLocationWhenInUseUsageDescription": "Flea Lover requires users location so that the users can easily zoom in on the map view at their exact location, and easily find stores located close to this location. Flea Lover does not save this information in the log files."
      }
    },
    "android": {
      "icon": "./assets/icons/android-app-icon.png",
      "adaptiveIcon": {
        "foregroundImage": "./assets/icons/android-app-icon.png",
        "backgroundColor": "#169516"
      },
      "splash": {
        "mdpi": "./assets/images/splash_mdpi.png",
        "hdpi": "./assets/images/splash_hdpi.png",
        "xhdpi": "./assets/images/splash_xhdpi.png",
        "xxhdpi": "./assets/images/splash_xxhdpi.png",
        "xxxhdpi": "./assets/images/splash_xxxhdpi.png",
        "backgroundColor": "#169516",
        "resizeMode": "cover"
      },
      "intentFilters": [
        {
          "action": "VIEW",
          "autoVerify": true,
          "data": [
            {
              "scheme": "https",
              "host": "*.loppeonline.dk",
              "pathPrefix": "/market/*"
            },
            {
              "scheme": "https",
              "host": "*.loppestatus.dk",
              "pathPrefix": "*"
            },
            {
              "scheme": "https",
              "host": "*.flealover.com",
              "pathPrefix": "/market/*"
            }
          ],
          "category": [
            "BROWSABLE",
            "DEFAULT"
          ]
        }
      ],
      "playStoreUrl": "https://play.google.com/store/apps/details?id=com.flealover",
      "package": "com.flealover",
      "versionCode": 11,
      "config": {
        "googleMaps": {
          "apiKey": "AIzaSyAgzRECArCPXCphvaSiWzWH4UZyDMBsYb0"
        }
      }
    },
    "androidStatusBar": {
      "backgroundColor": "#169516",
      "translucent": false
    },
    "locales": {
      "en": "./locale/en/en.json",
      "da": "./locale/da/da.json",
      "de": "./locale/de/de.json"
    }
  },
  "react-native-google-mobile-ads": {
    "android_app_id": "ca-app-pub-7500897528043409~5166681758",
    "ios_app_id": "ca-app-pub-7500897528043409~8230793984",
    "user_tracking_usage_description": "This identifier will be used to deliver personalized ads to you.",
    "delay_app_measurement_init": true,
    "sk_ad_network_items": [
      "cstr6suwn9.skadnetwork",
      "4fzdc2evr5.skadnetwork",
      "4pfyvq9l8r.skadnetwork",
      "2fnua5tdw4.skadnetwork",
      "ydx93a7ass.skadnetwork",
      "5a6flpkh64.skadnetwork",
      "p78axxw29g.skadnetwork",
      "v72qych5uu.skadnetwork",
      "ludvb6z3bs.skadnetwork",
      "cp8zw746q7.skadnetwork",
      "c6k4g5qg8m.skadnetwork",
      "s39g8k73mm.skadnetwork",
      "3qy4746246.skadnetwork",
      "3sh42y64q3.skadnetwork",
      "f38h382jlk.skadnetwork",
      "hs6bdukanm.skadnetwork",
      "prcb7njmu6.skadnetwork",
      "v4nxqhlyqp.skadnetwork",
      "wzmmz9fp6w.skadnetwork",
      "yclnxrl5pm.skadnetwork",
      "t38b2kh725.skadnetwork",
      "7ug5zh24hu.skadnetwork",
      "9rd848q2bz.skadnetwork",
      "y5ghdn5j9k.skadnetwork",
      "n6fk4nfna4.skadnetwork",
      "v9wttpbfk9.skadnetwork",
      "n38lu8286q.skadnetwork",
      "47vhws6wlr.skadnetwork",
      "kbd757ywx3.skadnetwork",
      "9t245vhmpl.skadnetwork",
      "a2p9lx4jpn.skadnetwork",
      "22mmun2rn5.skadnetwork",
      "4468km3ulz.skadnetwork",
      "2u9pt9hc89.skadnetwork",
      "8s468mfl3y.skadnetwork",
      "av6w8kgt66.skadnetwork",
      "klf5c3l5u5.skadnetwork",
      "ppxm28t8ap.skadnetwork",
      "424m5254lk.skadnetwork",
      "ecpz2srf59.skadnetwork",
      "uw77j35x4d.skadnetwork",
      "mlmmfzh3r3.skadnetwork",
      "578prtvx9j.skadnetwork",
      "4dzt52r2t5.skadnetwork",
      "gta9lk7p23.skadnetwork",
      "e5fvkxwrpn.skadnetwork",
      "8c4e2ghe7u.skadnetwork",
      "zq492l623r.skadnetwork",
      "3rd42ekr43.skadnetwork",
      "3qcr597p9d.skadnetwork"
    ]
  }
}

ios/Podfile

No response

android/build.gradle

No response

android/app/build.gradle

No response

android/settings.gradle

No response

AndroidManifest.xml

No response

mikehardy commented 9 months ago

It appears you did not "reopen the issue" you logged a whole new one, which just fractures conversation and allows comments to be missed

In particular: It appears you did not address the comment on your previous issue

@unstableair but you described it only for emulator, and what to do with a real device?

Either way, showing an EEA form in an Expo 49 app is not a use case of mine so it appears you will need to dedicate more time to this issue in the form of detailed troubleshooting. I suggest instrumenting the javascript and native code directly at all the points around the EEA consent form process to log pre- and post- all the APIs with parameters and results detailed in the logs so you can discover what's happening (or what's not happening...) in the devices you succeed with and the ones you fail with and then go from there

dlenskyi commented 9 months ago

Hi @mikehardy Thanks a lot for your reply!

Yeah, it seems I didn't answer to the comment at time and it was closed.

Regarding the troubleshooting, I cannot really write any native code, because I have managed Expo workflow, so it's quite hard for me.

mikehardy commented 9 months ago

It's quite hard is a valid response but not a blocker, sorry. If it's important, you'll have to allocate the resource to figure out how and make it happen. Perhaps temporarily eject, right? Then the extent of the native code to right is debug prints which have stackoverflow answers available for any programming language

dlenskyi commented 9 months ago

I'm really wondering that nobody on Expo 49 has this issue or at least didn't create the ticket for that...

Eject is not an option for me, unfortunately.

mikehardy commented 9 months ago

Eject is always an option. And it's a great way to do a temporary test where eject is not the point but enables the test Source control allows branching, eject in the branch, do the test There are always reasons things can't be done - the key is to focus on the ways to do things and do them

dlenskyi commented 9 months ago

Thanks for advise, I will do it then and once I figure this out I will post details afterwards