Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛] Meta (Facebook Audience Network) Mediation Not Working on iOS Real Devices #652

Open
1 task done
gaiaml opened this issue Nov 9, 2024 · 0 comments
Open
1 task done
Labels
help wanted Extra attention is needed

Comments

@gaiaml
Copy link

gaiaml commented Nov 9, 2024

What happened?

Dears,

I'm facing an issue with Meta Audience Network mediation on iOS real devices. While everything works perfectly on Android (simulator + real devices) and on iOS simulators, no ads are shown on physical iOS devices (even test ads).

Ad Inspector reports "No ad returned." I've meticulously configured AdMob mediation, ATT, and user consent management, and tried multiple SDK versions (from 11.5.0 to 11.12.0 and Meta Audience Network Adapter from 6.15.0 to 6.16.0).

Despite everything being correctly set up, the issue persists...

Can anyone confirm if Meta mediation is working correctly on iOS real devices with this library?

Platforms

Only on iOS

React Native Info

System:
  OS: macOS 14.6
  CPU: (8) x64 Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz
  Memory: 46.72 MB / 8.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.17.1
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.22
    path: /usr/local/bin/yarn
  npm:
    version: 9.8.1
    path: /usr/local/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.15.2
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.0
      - iOS 18.0
      - macOS 15.0
      - tvOS 18.0
      - visionOS 2.0
      - watchOS 11.0
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10671973
  Xcode:
    version: 16.0/16A242d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /usr/local/opt/openjdk@17/bin/javac
  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.74.5
    wanted: ^0.74.5
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Are your using Typescript?

  • My project is using Typescript

package.json

{
  "name": "*****",
  "main": "expo-router/entry",
  "version": "1.0.0",
  "scripts": {
    "start": "expo start",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "test": "jest --watchAll",
    "lint": "eslint .",
    "lint:fix": "eslint . --fix",
    "format": "prettier --write \"**/*.ts\" \"**/*.tsx\"",
    "format:check": "prettier --check \"**/*.ts\" \"**/*.tsx\""
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "@expo/vector-icons": "^14.0.0",
    "@gorhom/bottom-sheet": "^4.4.7",
    "@ptomasroos/react-native-multi-slider": "^2.2.2",
    "@react-native-community/datetimepicker": "^8.0.1",
    "@react-native-firebase/analytics": "^20.3.0",
    "@react-native-firebase/app": "^20.3.0",
    "@react-native-firebase/crashlytics": "^20.3.0",
    "@react-native-firebase/in-app-messaging": "^20.3.0",
    "@react-native-google-signin/google-signin": "^12.1.1",
    "@react-navigation/native": "^6.0.2",
    "ably": "^2.3.0",
    "eas-cli": "^9.1.0",
    "expo": "^51.0.2",
    "expo-apple-authentication": "~6.4.2",
    "expo-build-properties": "^0.12.3",
    "expo-dev-client": "^4.0.14",
    "expo-device": "^6.0.2",
    "expo-font": "~12.0.4",
    "expo-image": "~1.12.9",
    "expo-image-manipulator": "^12.0.5",
    "expo-image-picker": "~15.0.4",
    "expo-linear-gradient": "^13.0.2",
    "expo-linking": "~6.3.1",
    "expo-localization": "~15.0.3",
    "expo-location": "~17.0.1",
    "expo-router": "~3.5.11",
    "expo-secure-store": "~13.0.1",
    "expo-splash-screen": "~0.27.4",
    "expo-status-bar": "~1.12.1",
    "expo-system-ui": "~3.0.4",
    "expo-tracking-transparency": "~4.0.2",
    "expo-updates": "^0.25.22",
    "expo-web-browser": "^13.0.3",
    "h3-js": "^4.1.0",
    "i18next": "^23.7.3",
    "jwt-decode": "^4.0.0",
    "lottie-react-native": "^6.7.2",
    "moment": "^2.30.1",
    "nodes2ts": "^3.0.0",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-i18next": "^13.4.0",
    "react-native": "^0.74.5",
    "react-native-confetti-cannon": "^1.5.2",
    "react-native-date-picker": "^4.4.2",
    "react-native-datepicker": "^1.7.2",
    "react-native-element-dropdown": "^2.12.1",
    "react-native-gesture-handler": "~2.16.1",
    "react-native-gifted-chat": "^2.4.0",
    "react-native-google-mobile-ads": "^14.2.5",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-keyboard-aware-scrollview": "^2.1.0",
    "react-native-logs": "^5.0.1",
    "react-native-modal": "^13.0.1",
    "react-native-modal-datetime-picker": "^17.1.0",
    "react-native-modern-datepicker": "^1.0.0-beta.91",
    "react-native-paper": "^5.10.6",
    "react-native-purchases": "^7.27.2",
    "react-native-raw-bottom-sheet": "^2.2.0",
    "react-native-reanimated": "~3.10.1",
    "react-native-safe-area-context": "4.10.1",
    "react-native-screens": "3.31.1",
    "react-native-snackbar": "^2.8.0",
    "react-native-svg": "15.2.0",
    "react-native-toast-message": "^2.1.6",
    "react-native-uuid": "^2.0.1",
    "react-native-virtualized-view": "^1.0.0",
    "react-native-web": "~0.19.10",
    "react-query": "^3.39.3",
    "uninstall": "^0.0.0",
    "validate.js": "^0.13.1",
    "zod": "^3.22.4"
  },
  "devDependencies": {
    "@babel/core": "^7.24.0",
    "@faker-js/faker": "^8.0.2",
    "@types/react": "~18.2.79",
    "@types/react-native-modern-datepicker": "^1.0.1",
    "@typescript-eslint/eslint-plugin": "^7.8.0",
    "@typescript-eslint/parser": "^7.8.0",
    "eslint-config-prettier": "^9.0.0",
    "eslint-plugin-prettier": "^5.0.0",
    "eslint-plugin-react": "^7.34.1",
    "eslint-plugin-react-native": "^4.0.0",
    "jest": "^29.2.1",
    "jest-expo": "~51.0.1",
    "prettier": "^3.0.1",
    "react-test-renderer": "18.2.0",
    "typescript": "~5.3.3"
  },
  "overrides": {
    "react-refresh": "~0.14.0"
  },
  "resolutions": {
    "react-refresh": "~0.14.0"
  },
  "private": true
}

app.json

{
  "name": "*****",
  "slug": "*****",
  "version": "*****",
  "orientation": "portrait",
  "icon": "./assets/icons/icon.png",
  "scheme": "*****",
  "platforms": [
    "ios",
    "android"
  ],
  "userInterfaceStyle": "automatic",
  "splash": {
    "image": "./assets/images/splash.png",
    "resizeMode": "contain",
    "backgroundColor": "#ffffff"
  },
  "assetBundlePatterns": [
    "**/*"
  ],
  "ios": {
    "supportsTablet": true,
    "usesAppleSignIn": true,
    "bundleIdentifier": "*****",
    "buildNumber": "5",
    "icon": "./assets/icons/icon.png",
    "googleServicesFile": "GoogleService-Info.plist",
    "associatedDomains": [
      "applinks:***************"
    ]
  },
  "android": {
    "googleServicesFile": "google-services.json",
    "adaptiveIcon": {
      "foregroundImage": "./assets/icons/adaptive-icon.png",
      "backgroundColor": "#ffffff"
    },
    "package": "*****",
    "permissions": [
      "com.android.vending.BILLING"
    ],
    "versionCode": 9,
    "intentFilters": [
      {
        "action": "VIEW",
        "autoVerify": true,
        "data": {
          "scheme": "https",
          "host": "*****",
          "pathPrefix": "/deeplink"
        },
        "category": [
          "BROWSABLE",
          "DEFAULT"
        ]
      }
    ]
  },
  "web": {
    "bundler": "metro",
    "output": "static",
    "favicon": "./assets/images/favicon.png"
  },
  "plugins": [
    "expo-router",
    "expo-localization",
    "@react-native-firebase/app",
    "@react-native-firebase/crashlytics",
    "expo-apple-authentication",
    [
      "expo-build-properties",
      {
        "ios": {
          "useFrameworks": "static"
        }
      }
    ],
    [
      "@react-native-google-signin/google-signin",
      {
        "iosUrlScheme": "*****"
      }
    ],
    "expo-tracking-transparency",
    "./plugins/withFacebookMediation",
    [
      "react-native-google-mobile-ads",
      {
        "androidAppId": "ca-app-pub-*****",
        "iosAppId": "ca-app-pub-*****",
        "userTrackingUsageDescription": "This identifier will be used to deliver personalized ads to you.",
        "skAdNetworkItems": [
          "cstr6suwn9.skadnetwork",
          "4fzdc2evr5.skadnetwork",
          "4pfyvq9l8r.skadnetwork",
          "2fnua5tdw4.skadnetwork",
          "ydx93a7ass.skadnetwork",
          "5a6flpkh64.skadnetwork",
          "p78axxw29g.skadnetwork",
          "v72qych5uu.skadnetwork",
          "ludvb6z3bs.skadnetwork",
          "cp8zw746q7.skadnetwork",
          "3sh42y64q3.skadnetwork",
          "c6k4g5qg8m.skadnetwork",
          "s39g8k73mm.skadnetwork",
          "3qy4746246.skadnetwork",
          "f38h382jlk.skadnetwork",
          "hs6bdukanm.skadnetwork",
          "v4nxqhlyqp.skadnetwork",
          "wzmmz9fp6w.skadnetwork",
          "yclnxrl5pm.skadnetwork",
          "t38b2kh725.skadnetwork",
          "7ug5zh24hu.skadnetwork",
          "gta9lk7p23.skadnetwork",
          "vutu7akeur.skadnetwork",
          "y5ghdn5j9k.skadnetwork",
          "n6fk4nfna4.skadnetwork",
          "v9wttpbfk9.skadnetwork",
          "n38lu8286q.skadnetwork",
          "47vhws6wlr.skadnetwork",
          "kbd757ywx3.skadnetwork",
          "9t245vhmpl.skadnetwork",
          "eh6m2bh4zr.skadnetwork",
          "a2p9lx4jpn.skadnetwork",
          "22mmun2rn5.skadnetwork",
          "4468km3ulz.skadnetwork",
          "2u9pt9hc89.skadnetwork",
          "8s468mfl3y.skadnetwork",
          "klf5c3l5u5.skadnetwork",
          "ppxm28t8ap.skadnetwork",
          "ecpz2srf59.skadnetwork",
          "uw77j35x4d.skadnetwork",
          "pwa73g5rt2.skadnetwork",
          "mlmmfzh3r3.skadnetwork",
          "578prtvx9j.skadnetwork",
          "4dzt52r2t5.skadnetwork",
          "e5fvkxwrpn.skadnetwork",
          "8c4e2ghe7u.skadnetwork",
          "zq492l623r.skadnetwork",
          "3rd42ekr43.skadnetwork",
          "3qcr597p9d.skadnetwork"
      ] 
      }
    ]
  ],
  "experiments": {
    "typedRoutes": true
  },
  "extra": {
    "router": {
      "origin": false
    },
    "eas": {
      "projectId": "*****"
    }
  },
  "updates": {
    "url": "*****"
  }
}

ios/Podfile

require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")

require 'json'
podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}

ENV['RCT_NEW_ARCH_ENABLED'] = podfile_properties['newArchEnabled'] == 'true' ? '1' : '0'
ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR']

use_autolinking_method_symbol = ('use' + '_native' + '_modules!').to_sym
origin_autolinking_method = self.method(use_autolinking_method_symbol)
self.define_singleton_method(use_autolinking_method_symbol) do |*args|
  if ENV['EXPO_UNSTABLE_CORE_AUTOLINKING'] == '1'
    Pod::UI.puts('Using expo-modules-autolinking as core autolinking source'.green)
    config_command = [
      'node',
      '--no-warnings',
      '--eval',
      'require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'expo/package.json\')] }))(process.argv.slice(1))',
      'react-native-config',
      '--json',
      '--platform',
      'ios'
    ]
    origin_autolinking_method.call(config_command)
  else
    origin_autolinking_method.call()
  end
end

platform :ios, podfile_properties['ios.deploymentTarget'] || '13.4'
install! 'cocoapods',
  :deterministic_uuids => false

prepare_react_native_project!

target '*****' do
  pod 'GoogleMobileAdsMediationFacebook'
pod 'GoogleMobileAdsMediationInMobi'
  use_expo_modules!
  config = use_native_modules!

  use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
  use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']

  use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/..",
    :privacy_file_aggregation_enabled => podfile_properties['apple.privacyManifestAggregationEnabled'] != 'false',
  )

  post_install do |installer|
    react_native_post_install(
      installer,
      config[:reactNativePath],
      :mac_catalyst_enabled => false,
      :ccache_enabled => podfile_properties['apple.ccacheEnabled'] == 'true',
    )

    # This is necessary for Xcode 14, because it signs resource bundles by default
    # when building for devices.
    installer.target_installation_results.pod_target_installation_results
      .each do |pod_name, target_installation_result|
      target_installation_result.resource_bundle_targets.each do |resource_bundle_target|
        resource_bundle_target.build_configurations.each do |config|
          config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
        end
      end
    end
  end

  post_integrate do |installer|
    begin
      expo_patch_react_imports!(installer)
    rescue => e
      Pod::UI.warn e
    end
  end
end

android/build.gradle

No response

android/app/build.gradle

No response

android/settings.gradle

No response

AndroidManifest.xml

No response

@gaiaml gaiaml added the help wanted Extra attention is needed label Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant