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
702 stars 142 forks source link

FLUID Ad - returning ad height: 0 on Android #538

Closed MicahDavid closed 8 months ago

MicahDavid commented 9 months ago

What happened?

The FLUID ad request was filled, with width full screen (393px), but height (0). It returned the proper height on iOS.

Here is the banner request:

<GAMBannerAd
    sizes={[GAMBannerAdSize.FLUID]}
    unitId={headerAdUnit}
    onAdLoaded={size => {
        console.log('header ad loaded',size)
        setRevealHeaderAd(true)
    }}
    onAdFailedToLoad={error => {
        console.log('header ad failed',error)
        setRevealHeaderAd(false)
    }}
/>

Platforms

Only on Android

React Native Info

System:
  OS: macOS 13.6.1
  CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Memory: 22.41 MB / 32.00 GB
  Shell:
    version: 3.2.57
    path: /bin/bash
Binaries:
  Node:
    version: 18.12.1
    path: ~/.nvm/versions/node/v18.12.1/bin/node
  Yarn:
    version: 1.22.21
    path: ~/.nvm/versions/node/v18.12.1/bin/yarn
  npm:
    version: 8.19.2
    path: ~/.nvm/versions/node/v18.12.1/bin/npm
  Watchman:
    version: 2023.03.27.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.14.3
    path: /Users/micahsklut/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - visionOS 1.0
      - watchOS 10.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.1 AI-231.9392.1.2311.11255304
  Xcode:
    version: 15.2/15C500b
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.22
    path: /usr/bin/javac
  Ruby:
    version: 2.7.4
    path: /Users/micahsklut/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.7
    wanted: ^0.72.7
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Are your using Typescript?

package.json

{
  "name": "SurfCaptain",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "check-dependencies": "rnx-dep-check",
    "fix-dependencies": "rnx-dep-check-write"
  },
  "dependencies": {
    "@gorhom/bottom-sheet": "^4",
    "@invertase/react-native-apple-authentication": "^2.3.0",
    "@react-native-async-storage/async-storage": "^1.21.0",
    "@react-native-community/netinfo": "^11.2.1",
    "@react-native-firebase/analytics": "^18.7.3",
    "@react-native-firebase/app": "^18.7.3",
    "@react-native-google-signin/google-signin": "^10.1.1",
    "@react-navigation/bottom-tabs": "^6.5.11",
    "@react-navigation/material-top-tabs": "^6.6.5",
    "@react-navigation/native": "^6.1.9",
    "@react-navigation/stack": "^6.3.20",
    "@reduxjs/toolkit": "^2.0.1",
    "axios": "^1.6.2",
    "native-base": "^3.4.28",
    "patch-package": "^8.0.0",
    "postinstall-postinstall": "^2.1.0",
    "prop-types": "^15.7.2",
    "react": "18.2.0",
    "react-native": "^0.72.7",
    "react-native-check-version": "1.1.1",
    "react-native-deep-linking": "^2.2.0",
    "react-native-device-info": "^10.12.0",
    "react-native-fbsdk-next": "^12.1.2",
    "react-native-geolocation-service": "^5.3.1",
    "react-native-gesture-handler": "^2.14.0",
    "react-native-get-random-values": "^1.10.0",
    "react-native-google-mobile-ads": "^12.6.0",
    "react-native-iap": "^12.12.1",
    "react-native-maps": "^1.8.4",
    "react-native-pager-view": "^6.1.0",
    "react-native-permissions": "^3.9.0",
    "react-native-reanimated": "^3.6.1",
    "react-native-render-html": "^5.1.1",
    "react-native-responsive-fontsize": "^0.5.1",
    "react-native-responsive-screen": "^1.4.2",
    "react-native-safe-area-context": "^4.4.1",
    "react-native-screens": "^3.29.0",
    "react-native-svg": "^14.1.0",
    "react-native-svg-transformer": "^1.3.0",
    "react-native-tab-view": "^3.5.2",
    "react-native-vector-icons": "^10.0.3",
    "react-redux": "^9.0.4`",
    "reanimated": "^0.0.1-alpha",
    "redux-saga": "^1.3.0",
    "sync-storage": "^0.4.2",
    "uuid": "^9.0.1"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@react-native/eslint-config": "^0.72.2",
    "@react-native/metro-config": "^0.72.11",
    "@rnx-kit/align-deps": "^2.2.2",
    "@rnx-kit/dep-check": "^1.13.0",
    "@tsconfig/react-native": "^3.0.0",
    "@types/react": "^18.0.24",
    "@types/react-test-renderer": "^18.0.0",
    "babel-jest": "^29.2.1",
    "deprecated-react-native-prop-types": "^2.3.0",
    "eslint": "^8.19.0",
    "jest": "^29.2.1",
    "metro-react-native-babel-preset": "^0.76.8",
    "prettier": "^2.4.1",
    "react-native-clean-project": "^4.0.1",
    "react-native-codegen": "^0.0.7",
    "react-test-renderer": "18.1.0",
    "typescript": "^4.8.4"
  },
  "engines": {
    "node": ">=16"
  },
  "rnx-kit": {
    "reactNativeVersion": "^0.67",
    "kitType": "app",
    "capabilities": [
      "animation",
      "babel-preset-react-native",
      "core",
      "core-android",
      "core-ios",
      "gestures",
      "html",
      "jest",
      "navigation/native",
      "navigation/stack",
      "netinfo",
      "react",
      "react-test-renderer",
      "safe-area",
      "screens",
      "storage",
      "svg"
    ],
    "alignDeps": {
      "requirements": [
        "react-native@0.70"
      ],
      "capabilities": [
        "animation",
        "babel-preset-react-native",
        "core",
        "core-android",
        "core-ios",
        "gestures",
        "html",
        "jest",
        "navigation/native",
        "navigation/stack",
        "netinfo",
        "react",
        "react-test-renderer",
        "safe-area",
        "screens",
        "storage",
        "svg"
      ]
    }
  }
}

app.json

{
  "name": "SURF_CAPTAIN_NATIVE",
  "displayName": "Surf Captain",
  "react-native-google-mobile-ads": {
    "android_app_id": "ca-app-pub-4574386112911690~2644838733",
    "ios_app_id": "ca-app-pub-4574386112911690~3924419988",
    "user_tracking_usage_description": "This identifier will be used to deliver personalized ads to you.",
    "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

github-actions[bot] commented 8 months ago

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

MicahDavid commented 7 months ago

has anyone gotten FLUID banners to work on Android?

AftabUfaq commented 6 months ago

still not working on android . I have tested all ads but with FLUID NOT Showing any add.

MicahDavid commented 6 months ago

still not working on android . I have tested all ads but with FLUID NOT Showing any add.

To get around this, I just created a bunch of different banners with image sizes that will match the most popular android device widths.

For what its worth, the react-native-ad-manager package also has the same problem with the FLUID ads: https://github.com/NZME/react-native-ad-manager#readme

Perhaps its more of a platform issue, than package issue... It sure would be nice if we could use FLUID ads for Android, because it creates a lot of extra work to create the multiple mobile ad sizes and add in all the creatives to Ad Manager.