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
672 stars 135 forks source link

[🐛] Ad orientation is not supported by application #350

Closed sametcl2 closed 1 year ago

sametcl2 commented 1 year ago

What happened?

Hi, I have an app that has video lists. When the user clicks one of the videos, the phone orientation locks to the landscape. After 10 min watching the video, I want to show a rewarded ad. But I get this error sometimes [Error: [googleMobileAds/unknown] Ad orientation is not supported by application.].

How can I fix this? Thanks.

Platforms

Only on iOS

React Native Info

System:
    OS: macOS 13.0.1
    CPU: (8) arm64 Apple M1
    Memory: 98.97 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.6.1 - ~/Documents/epda/el-poder-del-amor-mobile/node_modules/.bin/npm
    Watchman: 2022.03.21.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.3 AI-213.7172.25.2113.9123335
    Xcode: 14.0.1/14A400 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.15 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: ^18.0.0 => 18.0.0 
    react-native: 0.69.7 => 0.69.7 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Are your using Typescript?

package.json

{
  "name": "elpoderdelamor",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "build:ios": "react-native bundle --entry-file='index.js' --bundle-output='./ios/ElPoderDelAmor/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios'",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint . --ext .js,.jsx,.ts,.tsx",
    "prettier": "prettier --write '**/*.{ts,tsx}"
  },
  "dependencies": {
    "@bam.tech/react-native-image-resizer": "^3.0.3",
    "@hookform/resolvers": "^2.9.7",
    "@react-native-async-storage/async-storage": "^1.17.7",
    "@react-native-community/datetimepicker": "^6.3.1",
    "@react-native-firebase/analytics": "^15.4.0",
    "@react-native-firebase/app": "^15.4.0",
    "@react-navigation/bottom-tabs": "^6.3.1",
    "@react-navigation/native": "^6.0.10",
    "@react-navigation/stack": "^6.3.2",
    "@reduxjs/toolkit": "^1.8.5",
    "@sentry/react-native": "^4.7.1",
    "@shopify/flash-list": "^1.4.1",
    "apisauce": "^2.1.5",
    "country-codes-list": "^1.6.10",
    "country-list-spanish": "^0.3.0",
    "crypto": "^1.0.1",
    "hybrid-crypto-js": "^0.2.4",
    "i18next": "^22.0.6",
    "install": "^0.13.0",
    "lottie-react-native": "^5.1.4",
    "moment": "^2.29.4",
    "native-base": "^3.4.25",
    "npm": "^9.6.1",
    "radio-buttons-react-native": "^1.0.4",
    "react": "^18.0.0",
    "react-hook-form": "^7.33.1",
    "react-i18next": "^12.0.0",
    "react-native": "0.69.7",
    "react-native-animate-number": "^0.1.2",
    "react-native-collapsible-tab-view": "^4.5.2",
    "react-native-confirmation-code-field": "^7.3.1",
    "react-native-create-thumbnail": "^2.0.0-rc.2",
    "react-native-device-info": "^9.0.2",
    "react-native-drop-shadow": "^0.0.5",
    "react-native-exception-handler": "^2.10.10",
    "react-native-fast-image": "^8.5.11",
    "react-native-geolocation-service": "^5.3.1",
    "react-native-gesture-handler": "^2.5.0",
    "react-native-google-mobile-ads": "^7.0.1",
    "react-native-hide-with-keyboard": "^1.2.1",
    "react-native-image-crop-picker": "^0.39.0",
    "react-native-image-picker": "^4.10.0",
    "react-native-iphone-x-helper": "^1.3.1",
    "react-native-keychain": "^8.1.1",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-localize": "^2.2.4",
    "react-native-mask-input": "^1.2.0",
    "react-native-modal": "^13.0.1",
    "react-native-modal-datetime-picker": "^10.2.0",
    "react-native-orientation-locker": "^1.5.0",
    "react-native-permissions": "^3.6.0",
    "react-native-reanimated": "^2.12.0",
    "react-native-restart": "^0.0.24",
    "react-native-safe-area-context": "^3.3.2",
    "react-native-screens": "^3.13.1",
    "react-native-select-dropdown": "^2.0.4",
    "react-native-share": "^8.1.0",
    "react-native-svg": "^12.1.1",
    "react-native-system-navigation-bar": "^2.1.0",
    "react-native-uuid": "^2.0.1",
    "react-native-video": "^6.0.0-alpha.5",
    "react-native-view-shot": "^3.4.0",
    "react-redux": "^8.0.2",
    "redux-persist": "^6.0.0",
    "sha256": "^0.2.0",
    "styled-components": "^5.3.5"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "^2.0.0",
    "@types/jest": "^26.0.23",
    "@types/react-native": "^0.67.3",
    "@types/react-native-video": "^5.0.13",
    "@types/react-redux": "^7.1.24",
    "@types/react-test-renderer": "^17.0.1",
    "@types/styled-components": "^5.1.26",
    "@types/styled-components-react-native": "^5.1.3",
    "@typescript-eslint/eslint-plugin": "^5.17.0",
    "@typescript-eslint/parser": "^5.17.0",
    "babel-jest": "^26.6.3",
    "eslint": "^7.32.0",
    "jest": "^26.6.3",
    "metro-react-native-babel-preset": "^0.67.0",
    "prettier": "^2.6.2",
    "react-native-dotenv": "^3.4.6",
    "react-test-renderer": "17.0.2",
    "typescript": "^4.4.4"
  },
  "resolutions": {
    "@types/react": "^17",
    "react-devtools-core": "~4.25.0"
  },
  "jest": {
    "preset": "react-native",
    "moduleFileExtensions": [
      "ts",
      "tsx",
      "js",
      "jsx",
      "json",
      "node"
    ]
  }
}

app.json

{
  "name": "ElPoderDelAmor",
  "displayName": "ElPoderDelAmor",
  "plugins": ["react-native-compressor"],
  "react-native-google-mobile-ads": {
    "android_app_id": "ca-app-pub-3047771859167712~2040915148",
    "ios_app_id": "ca-app-pub-3047771859167712~9170527756",
    "user_tracking_usage_description": "This identifier will be used to deliver personalized ads to you."
  }
}

ios/Podfile

No response

android/build.gradle

No response

android/app/build.gradle

No response

android/settings.gradle

No response

AndroidManifest.xml

No response

sametcl2 commented 1 year ago

Found it. If you want to show ads in landscape, you need to configure xcode like this

Screenshot 2023-03-25 at 04 31 15