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

Live Ads not showing in release/pro build - iOS #457

Closed railsfactory-ashish closed 12 months ago

railsfactory-ashish commented 1 year ago

What happened?

I have installed the latest version of the package. Currently test ads working fine but live ads not working.
Giving this error -> [Error: [googleMobileAds/no-fill] Request Error: No ad to show.] All the configuration completed as per the doc. I have setup the ads in google admob for the last 6-7 days.

Platforms

Only on iOS

React Native Info

.

Are your using Typescript?

package.json

{
  "name": "app",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint .",
    "build": "cd android && ./gradlew assembleRelease && cd ..",
    "apk": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/build/intermediates/res/merged/release/ && cd android && ./gradlew assembleRelease && cd ..",
    "production": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/build/intermediates/res/merged/release/ && cd android && ./gradlew bundleRelease && cd .."
  },
  "dependencies": {
    "@notifee/react-native": "^7.8.0",
    "@react-native-async-storage/async-storage": "^1.19.3",
    "@react-native-community/art": "^1.2.0",
    "@react-native-community/datetimepicker": "^7.5.0",
    "@react-native-community/netinfo": "^9.4.1",
    "@react-native-firebase/app": "^18.3.2",
    "@react-native-firebase/firestore": "^18.3.2",
    "@react-native-google-signin/google-signin": "^10.0.1",
    "@react-navigation/bottom-tabs": "^6.5.8",
    "@react-navigation/drawer": "^6.6.3",
    "@react-navigation/native": "^6.1.7",
    "@react-navigation/native-stack": "^6.9.13",
    "@reduxjs/toolkit": "^1.9.5",
    "eklipse-react-native-circular-progress": "^1.0.0",
    "luxon": "^3.4.3",
    "react": "18.2.0",
    "react-native": "0.72.4",
    "react-native-autostart": "^1.0.7",
    "react-native-background-timer-android": "^1.0.4",
    "react-native-calendars": "^1.1301.0",
    "react-native-document-picker": "^9.0.1",
    "react-native-fs": "^2.20.0",
    "react-native-gesture-handler": "^2.12.1",
    "react-native-get-random-values": "^1.9.0",
    "react-native-google-mobile-ads": "^12.1.2",
    "react-native-in-app-review": "^4.3.3",
    "react-native-keyboard-avoiding-scroll-view": "^1.0.1",
    "react-native-modal": "^13.0.1",
    "react-native-modal-datetime-picker": "^17.1.0",
    "react-native-permissions": "^3.9.1",
    "react-native-pie-chart": "^3.0.1",
    "react-native-purchases": "^6.6.4",
    "react-native-reanimated": "^3.4.2",
    "react-native-safe-area-context": "^4.7.2",
    "react-native-screens": "^3.25.0",
    "react-native-simple-encryption": "^1.2.1",
    "react-native-sound": "^0.11.2",
    "react-native-store-version": "^1.4.1",
    "react-native-svg": "^13.13.0",
    "react-native-toast-message": "^2.1.6",
    "react-native-vector-icons": "^10.0.0",
    "react-redux": "^8.1.2",
    "redux": "^4.2.1",
    "uuid": "^9.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.22.15",
    "@babel/preset-env": "^7.22.15",
    "@babel/runtime": "^7.22.15",
    "@react-native/eslint-config": "^0.72.2",
    "@react-native/metro-config": "^0.72.11",
    "@tsconfig/react-native": "^3.0.2",
    "babel-jest": "^29.6.4",
    "eslint": "^8.48.0",
    "jest": "^29.6.4",
    "metro-react-native-babel-preset": "0.77.0",
    "prettier": "^3.0.3",
    "react-test-renderer": "18.2.0"
  },
  "engines": {
    "node": ">=16"
  }
}

app.json

{
  "name": "app",
  "displayName": "app",
  "react-native-google-mobile-ads": {
    "android_app_id": "id~number",
    "ios_app_id": "id~number",
    "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

def node_require(script)
  # Resolve script with node to allow for hoisting
  require Pod::Executable.execute_command('node', ['-p',
    "require.resolve(
      '#{script}',
      {paths: [process.argv[1]]},
    )", __dir__]).strip
end

node_require('react-native/scripts/react_native_pods.rb')
node_require('react-native-permissions/scripts/setup.rb')

platform :ios, min_ios_version_supported
prepare_react_native_project!

setup_permissions([
  'AppTrackingTransparency'
])

use_frameworks! :linkage => :static
$RNFirebaseAsStaticFramework = true
$RNGoogleMobileAdsAsStaticFramework = true
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
#
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
# 
# module.exports = {
#   dependencies: {
#     ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
# 
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled

linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
  Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
  use_frameworks! :linkage => linkage.to_sym
end

target 'makeItHabbit' do
  config = use_native_modules!

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    # Hermes is now enabled by default. Disable by setting this flag to false.
    # Upcoming versions of React Native may rely on get_default_flags(), but
    # we make it explicit here to aid in the React Native upgrade process.
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    # Enables Flipper.
    #
    # Note that if you have use_frameworks! enabled, Flipper will not work and
    # you should disable the next line.
    # :flipper_configuration => flipper_config,
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'appTests' do
    inherit! :complete
    # Pods for testing
  end

  post_install do |installer|
    react_native_post_install(
      installer,
      config[:reactNativePath],
      # Set `mac_catalyst_enabled` to `true` in order to apply patches
      # necessary for Mac Catalyst builds
      :mac_catalyst_enabled => false
    )
    # NOTE: Change IPHONEOS_DEPLOYMENT_TARGET to 12.4.
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.4'
      end
    end
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

android/build.gradle

.

android/app/build.gradle

.

android/settings.gradle

.

AndroidManifest.xml

.
DoctorJohn commented 1 year ago

In many cases production ads only start showing after the app has been released to the app store and it's "Approval status" on the AdMob dashboard is "Ready".

github-actions[bot] commented 1 year 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.

phamhieu1412 commented 12 months ago

same issue, can i help me?? issue is not done

mikehardy commented 11 months ago

@phamhieu1412 you might like https://docs.page/invertase/react-native-google-mobile-ads/common-reasons-for-ads-not-showing

We have no ability to troubleshoot individual user's problems with showing ads but we are certain that when configured correctly with a valid account etc etc this library does work. It's not the library's fault.

If the information you need is not in that FAQ, we recommend pursuing your question on stackoverflow