@react-native-google-mobile-ads/facebook 16.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,32 @@
1
+ Apache-2.0 License
2
+ ------------------
3
+
4
+ Copyright (c) 2021-present Invertase Limited <oss@invertase.io>
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License");
7
+ you may not use this library except in compliance with the License.
8
+
9
+ You may obtain a copy of the Apache-2.0 License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
18
+
19
+
20
+ Creative Commons Attribution 3.0 License
21
+ ----------------------------------------
22
+
23
+ Copyright (c) 2016-present Invertase Limited <oss@invertase.io>
24
+
25
+ Documentation and other instructional materials provided for this project
26
+ (including on a separate documentation repository or it's documentation website) are
27
+ licensed under the Creative Commons Attribution 3.0 License. Code samples/blocks
28
+ contained therein are licensed under the Apache License, Version 2.0 (the "License"), as above.
29
+
30
+ You may obtain a copy of the Creative Commons Attribution 3.0 License at
31
+
32
+ https://creativecommons.org/licenses/by/3.0/
package/README.md ADDED
@@ -0,0 +1,70 @@
1
+ # `@react-native-google-mobile-ads/facebook`
2
+
3
+ Meta Audience Network (Facebook) **Google Ad Manager / AdMob mediation** adapter package for [`react-native-google-mobile-ads`](https://github.com/invertase/react-native-google-mobile-ads).
4
+
5
+ This package links Google’s official Meta Audience Network mediation adapter on Android and iOS. It does **not** ship AppLovin MAX, CloudX, or any JS ad APIs — use core `initialize()` / adapter status for discovery.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ yarn add @react-native-google-mobile-ads/facebook
11
+ # peer: react-native-google-mobile-ads
12
+ ```
13
+
14
+ Autolinking pulls in the native mediation artifacts. Rebuild the app after install.
15
+
16
+ ## Native adapter class names (GAM / AdMob UI)
17
+
18
+ | Platform | Class name |
19
+ | -------- | ---------- |
20
+ | Android | `com.google.ads.mediation.facebook.FacebookMediationAdapter` |
21
+ | iOS | `GADMediationAdapterFacebook` |
22
+
23
+ Also exported from JS:
24
+
25
+ ```ts
26
+ import {
27
+ nativeAdapterClassName,
28
+ networkSlug,
29
+ } from '@react-native-google-mobile-ads/facebook';
30
+ ```
31
+
32
+ ## Mediation dependencies (pinned in this package)
33
+
34
+ | Platform | Coordinate | Version pin |
35
+ | -------- | ---------- | ----------- |
36
+ | Android | `com.google.ads.mediation:facebook` | `6.22.0.0` |
37
+ | iOS | CocoaPods `GoogleMobileAdsMediationFacebook` | `6.22.0.0` |
38
+
39
+ Citations (verify at upgrade time):
40
+
41
+ - Android: https://developers.google.com/admob/android/mediation/meta
42
+ - iOS: https://developers.google.com/admob/ios/mediation/meta
43
+ - CocoaPods: https://cocoapods.org/pods/GoogleMobileAdsMediationFacebook
44
+
45
+ Core continues to own `play-services-ads` / `Google-Mobile-Ads-SDK`. This package does not re-pin the GMA SDK.
46
+
47
+ Platform floors align with core: iOS **15.1** and Android minSdk **24**. The Meta Audience Network mediation adapter `6.22.0.0` requires iOS 15.0, below the React Native-driven product floor.
48
+
49
+ > Google’s mediation guide permits Android minSdk 23 upstream; this product advertises 24 to match core.
50
+
51
+ ## Expo (optional)
52
+
53
+ ```js
54
+ // app.json / app.config.js plugins
55
+ [
56
+ '@react-native-google-mobile-ads/facebook',
57
+ {
58
+ // Pass Meta Audience Network SKAdNetwork IDs from Meta’s current docs
59
+ skAdNetworkItems: [/* ... */],
60
+ },
61
+ ]
62
+ ```
63
+
64
+ App IDs stay in the core Expo plugin.
65
+
66
+ ## Out of scope
67
+
68
+ - AppLovin MAX host SDK
69
+ - CloudX / other non-GAM hosts
70
+ - Fyber/DT Exchange (no Google GAM adapter — do not invent)
@@ -0,0 +1,35 @@
1
+ require 'json'
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
+ gam_adapter = package['gamAdapter']
5
+ mediation_pod = gam_adapter['iosPod']
6
+ mediation_version = package['sdkVersions']['ios']['googleMobileAdsMediation']
7
+
8
+ Pod::Spec.new do |s|
9
+ s.name = "RNGoogleMobileAdsAdapterFacebook"
10
+ s.version = package["version"]
11
+ s.summary = package["description"]
12
+ s.description = package["description"]
13
+ s.homepage = "https://github.com/invertase/react-native-google-mobile-ads"
14
+ s.license = package["license"]
15
+ s.authors = "Invertase Limited"
16
+ s.source = {
17
+ :git => "#{package["repository"]["url"]}.git",
18
+ :tag => "v#{s.version}"
19
+ }
20
+ # Core requires iOS 15.1+; Meta Audience Network mediation adapter 6.22.0.0 requires iOS 15.0+.
21
+ # https://developers.google.com/admob/ios/mediation/meta
22
+ s.platforms = { :ios => "15.1" }
23
+ s.source_files = "ios/**/*.{h,m,mm,swift}"
24
+
25
+ if respond_to?(:install_modules_dependencies, true)
26
+ install_modules_dependencies(s)
27
+ else
28
+ s.dependency "React-Core"
29
+ end
30
+
31
+ # Google-published Meta Audience Network GAM mediation adapter.
32
+ # https://developers.google.com/admob/ios/mediation/meta
33
+ # https://cocoapods.org/pods/GoogleMobileAdsMediationFacebook
34
+ s.dependency mediation_pod, mediation_version
35
+ end
@@ -0,0 +1,67 @@
1
+ import groovy.json.JsonSlurper
2
+
3
+ buildscript {
4
+ ext.getExtOrDefault = { name, fallback ->
5
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : fallback
6
+ }
7
+
8
+ // AGP is only required when opening this android/ folder stand-alone.
9
+ if (project == rootProject) {
10
+ repositories {
11
+ google()
12
+ mavenCentral()
13
+ }
14
+ dependencies {
15
+ classpath("com.android.tools.build:gradle:8.6.0")
16
+ }
17
+ }
18
+ }
19
+
20
+ apply plugin: "com.android.library"
21
+
22
+ def packageJson = new JsonSlurper().parseText(file("${projectDir}/../package.json").text)
23
+ def gamAdapter = packageJson.gamAdapter
24
+ def sdkVersions = packageJson.sdkVersions.android
25
+ def mediationArtifact = "${gamAdapter.androidArtifact}:${sdkVersions.googleMobileAdsMediation}"
26
+
27
+ android {
28
+ namespace "io.invertase.googlemobileads.adapters.facebook"
29
+
30
+ compileSdkVersion sdkVersions.compileSdk as Integer
31
+ buildToolsVersion sdkVersions.buildTools
32
+
33
+ defaultConfig {
34
+ minSdkVersion sdkVersions.minSdk as Integer
35
+ targetSdkVersion sdkVersions.targetSdk as Integer
36
+ buildConfigField "String", "GAM_ADAPTER_NETWORK", "\"${gamAdapter.network}\""
37
+ buildConfigField "String", "GAM_ADAPTER_ANDROID_CLASS", "\"${gamAdapter.androidAdapterClassName}\""
38
+ }
39
+
40
+ compileOptions {
41
+ sourceCompatibility JavaVersion.VERSION_1_8
42
+ targetCompatibility JavaVersion.VERSION_1_8
43
+ }
44
+
45
+ buildFeatures {
46
+ buildConfig true
47
+ }
48
+
49
+ sourceSets {
50
+ main {
51
+ java.srcDirs = ["src/main/java"]
52
+ }
53
+ }
54
+ }
55
+
56
+ repositories {
57
+ google()
58
+ mavenCentral()
59
+ }
60
+
61
+ dependencies {
62
+ // Google-published Meta Audience Network GAM mediation adapter.
63
+ // Pin: package.json sdkVersions.android.googleMobileAdsMediation (docs: 6.22.0.0 as of package publish; verify against current docs/Maven).
64
+ // Core GMA is provided by react-native-google-mobile-ads; do not re-pin it here.
65
+ // https://developers.google.com/admob/android/mediation/meta
66
+ api mediationArtifact
67
+ }
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!--
3
+ GAM adapter packages carry Google mediation artifacts only.
4
+ App ID / measurement flags live in core (react-native-google-mobile-ads).
5
+ -->
6
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android" />
@@ -0,0 +1,10 @@
1
+ package io.invertase.googlemobileads.adapters.facebook;
2
+
3
+ /**
4
+ * Package marker so the Android library module has a compilable source root.
5
+ * This package does not expose a TurboModule — mediation is linked via Gradle
6
+ * ({@code com.google.ads.mediation:facebook}).
7
+ */
8
+ public final class AdapterPackageMarker {
9
+ private AdapterPackageMarker() {}
10
+ }
package/app.plugin.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./plugin/build');
@@ -0,0 +1,11 @@
1
+ #import <Foundation/Foundation.h>
2
+
3
+ /**
4
+ * Package marker so the podspec has a compilable source file.
5
+ * Mediation is linked via the GoogleMobileAdsMediationFacebook pod dependency.
6
+ */
7
+ @interface RNGoogleMobileAdsAdapterFacebookMarker : NSObject
8
+ @end
9
+
10
+ @implementation RNGoogleMobileAdsAdapterFacebookMarker
11
+ @end
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.networkSlug = exports.nativeAdapterClassName = void 0;
7
+ /**
8
+ * Meta Audience Network (Facebook) GAM mediation adapter package public surface.
9
+ *
10
+ * Exports adapter class-name constants for GAM UI paste / docs only. Does **not**
11
+ * add JS ad APIs — core `initialize()` adapter statuses remain the discovery
12
+ * signal (API design §5.3).
13
+ *
14
+ * Native mediation is linked via Google's published adapter:
15
+ * - Android: `com.google.ads.mediation:facebook`
16
+ * - iOS: `GoogleMobileAdsMediationFacebook`
17
+ */
18
+
19
+ /** Network slug for this Character GAM adapter package. */
20
+ const networkSlug = exports.networkSlug = 'facebook';
21
+
22
+ /**
23
+ * Fully-qualified native mediation adapter class names for AdMob / GAM console paste.
24
+ * @see https://developers.google.com/admob/android/mediation/meta
25
+ * @see https://developers.google.com/admob/ios/mediation/meta
26
+ */
27
+ const nativeAdapterClassName = exports.nativeAdapterClassName = {
28
+ android: 'com.google.ads.mediation.facebook.FacebookMediationAdapter',
29
+ ios: 'GADMediationAdapterFacebook'
30
+ };
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["networkSlug","exports","nativeAdapterClassName","android","ios"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA;AACO,MAAMA,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,UAAmB;;AAE9C;AACA;AACA;AACA;AACA;AACO,MAAME,sBAA8C,GAAAD,OAAA,CAAAC,sBAAA,GAAG;EAC5DC,OAAO,EAAE,4DAA4D;EACrEC,GAAG,EAAE;AACP,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Meta Audience Network (Facebook) GAM mediation adapter package public surface.
5
+ *
6
+ * Exports adapter class-name constants for GAM UI paste / docs only. Does **not**
7
+ * add JS ad APIs — core `initialize()` adapter statuses remain the discovery
8
+ * signal (API design §5.3).
9
+ *
10
+ * Native mediation is linked via Google's published adapter:
11
+ * - Android: `com.google.ads.mediation:facebook`
12
+ * - iOS: `GoogleMobileAdsMediationFacebook`
13
+ */
14
+
15
+ /** Network slug for this Character GAM adapter package. */
16
+ export const networkSlug = 'facebook';
17
+
18
+ /**
19
+ * Fully-qualified native mediation adapter class names for AdMob / GAM console paste.
20
+ * @see https://developers.google.com/admob/android/mediation/meta
21
+ * @see https://developers.google.com/admob/ios/mediation/meta
22
+ */
23
+ export const nativeAdapterClassName = {
24
+ android: 'com.google.ads.mediation.facebook.FacebookMediationAdapter',
25
+ ios: 'GADMediationAdapterFacebook'
26
+ };
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["networkSlug","nativeAdapterClassName","android","ios"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA;AACA,OAAO,MAAMA,WAAW,GAAG,UAAmB;;AAE9C;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAA8C,GAAG;EAC5DC,OAAO,EAAE,4DAA4D;EACrEC,GAAG,EAAE;AACP,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Meta Audience Network (Facebook) GAM mediation adapter package public surface.
3
+ *
4
+ * Exports adapter class-name constants for GAM UI paste / docs only. Does **not**
5
+ * add JS ad APIs — core `initialize()` adapter statuses remain the discovery
6
+ * signal (API design §5.3).
7
+ *
8
+ * Native mediation is linked via Google's published adapter:
9
+ * - Android: `com.google.ads.mediation:facebook`
10
+ * - iOS: `GoogleMobileAdsMediationFacebook`
11
+ */
12
+ export type NativeAdapterClassName = {
13
+ android: string;
14
+ ios: string;
15
+ };
16
+ /** Network slug for this Character GAM adapter package. */
17
+ export declare const networkSlug: "facebook";
18
+ /**
19
+ * Fully-qualified native mediation adapter class names for AdMob / GAM console paste.
20
+ * @see https://developers.google.com/admob/android/mediation/meta
21
+ * @see https://developers.google.com/admob/ios/mediation/meta
22
+ */
23
+ export declare const nativeAdapterClassName: NativeAdapterClassName;
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,WAAW,EAAG,UAAmB,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,sBAGpC,CAAC"}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Meta Audience Network (Facebook) GAM mediation adapter package public surface.
3
+ *
4
+ * Exports adapter class-name constants for GAM UI paste / docs only. Does **not**
5
+ * add JS ad APIs — core `initialize()` adapter statuses remain the discovery
6
+ * signal (API design §5.3).
7
+ *
8
+ * Native mediation is linked via Google's published adapter:
9
+ * - Android: `com.google.ads.mediation:facebook`
10
+ * - iOS: `GoogleMobileAdsMediationFacebook`
11
+ */
12
+ export type NativeAdapterClassName = {
13
+ android: string;
14
+ ios: string;
15
+ };
16
+ /** Network slug for this Character GAM adapter package. */
17
+ export declare const networkSlug: "facebook";
18
+ /**
19
+ * Fully-qualified native mediation adapter class names for AdMob / GAM console paste.
20
+ * @see https://developers.google.com/admob/android/mediation/meta
21
+ * @see https://developers.google.com/admob/ios/mediation/meta
22
+ */
23
+ export declare const nativeAdapterClassName: NativeAdapterClassName;
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,WAAW,EAAG,UAAmB,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,sBAGpC,CAAC"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
package/package.json ADDED
@@ -0,0 +1,131 @@
1
+ {
2
+ "name": "@react-native-google-mobile-ads/facebook",
3
+ "version": "16.5.0",
4
+ "description": "Meta Audience Network (Facebook) Google Mobile Ads (GAM) mediation adapter for react-native-google-mobile-ads. Links the official Google mediation adapter on Android and iOS; does not add JS ad APIs.",
5
+ "author": "Invertase <oss@invertase.io> (http://invertase.io)",
6
+ "license": "Apache-2.0",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/invertase/react-native-google-mobile-ads",
10
+ "directory": "packages/facebook"
11
+ },
12
+ "keywords": [
13
+ "react-native",
14
+ "google-mobile-ads",
15
+ "admob",
16
+ "mediation",
17
+ "gam",
18
+ "facebook",
19
+ "meta",
20
+ "audience-network"
21
+ ],
22
+ "main": "lib/commonjs/index.js",
23
+ "module": "lib/module/index.js",
24
+ "react-native": "src/index.ts",
25
+ "types": "lib/typescript/commonjs/index.d.ts",
26
+ "exports": {
27
+ ".": {
28
+ "react-native": {
29
+ "types": "./lib/typescript/module/index.d.ts",
30
+ "default": "./src/index.ts"
31
+ },
32
+ "source": {
33
+ "types": "./lib/typescript/module/index.d.ts",
34
+ "default": "./src/index.ts"
35
+ },
36
+ "import": {
37
+ "types": "./lib/typescript/module/index.d.ts",
38
+ "default": "./lib/module/index.js"
39
+ },
40
+ "require": {
41
+ "types": "./lib/typescript/commonjs/index.d.ts",
42
+ "default": "./lib/commonjs/index.js"
43
+ },
44
+ "default": "./lib/commonjs/index.js"
45
+ },
46
+ "./app.plugin": "./app.plugin.js",
47
+ "./app.plugin.js": "./app.plugin.js",
48
+ "./package.json": "./package.json"
49
+ },
50
+ "files": [
51
+ "/android/",
52
+ "/ios/",
53
+ "/lib/",
54
+ "/plugin/",
55
+ "/src/",
56
+ "/LICENSE",
57
+ "/RNGoogleMobileAdsAdapterFacebook.podspec",
58
+ "/app.plugin.js",
59
+ "/react-native.config.js"
60
+ ],
61
+ "publishConfig": {
62
+ "access": "public"
63
+ },
64
+ "gamAdapter": {
65
+ "network": "facebook",
66
+ "androidArtifact": "com.google.ads.mediation:facebook",
67
+ "androidAdapterClassName": "com.google.ads.mediation.facebook.FacebookMediationAdapter",
68
+ "iosPod": "GoogleMobileAdsMediationFacebook",
69
+ "iosAdapterClassName": "GADMediationAdapterFacebook"
70
+ },
71
+ "sdkVersions": {
72
+ "ios": {
73
+ "googleMobileAdsMediation": "6.22.0.0"
74
+ },
75
+ "android": {
76
+ "minSdk": 24,
77
+ "targetSdk": 36,
78
+ "compileSdk": 36,
79
+ "buildTools": "36.0.0",
80
+ "googleMobileAdsMediation": "6.22.0.0"
81
+ }
82
+ },
83
+ "react-native-builder-bob": {
84
+ "source": "src",
85
+ "output": "lib",
86
+ "targets": [
87
+ [
88
+ "commonjs",
89
+ {
90
+ "esm": true
91
+ }
92
+ ],
93
+ [
94
+ "module",
95
+ {
96
+ "esm": true
97
+ }
98
+ ],
99
+ "typescript"
100
+ ]
101
+ },
102
+ "scripts": {
103
+ "prepare": "yarn build && yarn build:plugin",
104
+ "build": "bob build",
105
+ "build:clean": "rimraf android/build && rimraf ios/build && rimraf lib && rimraf plugin/build",
106
+ "build:plugin": "yarn tsc --build plugin"
107
+ },
108
+ "peerDependencies": {
109
+ "@expo/config-plugins": ">=5.0.0",
110
+ "expo": ">=47.0.0",
111
+ "react": "*",
112
+ "react-native": ">=0.76",
113
+ "react-native-google-mobile-ads": ">=17.0.0"
114
+ },
115
+ "peerDependenciesMeta": {
116
+ "@expo/config-plugins": {
117
+ "optional": true
118
+ },
119
+ "expo": {
120
+ "optional": true
121
+ }
122
+ },
123
+ "devDependencies": {
124
+ "@expo/config-plugins": "^54.0.4",
125
+ "react-native-builder-bob": "^0.40.13",
126
+ "react-native-google-mobile-ads": "16.5.0",
127
+ "rimraf": "^6.0.1",
128
+ "typescript": "^5.9.3"
129
+ },
130
+ "gitHead": "5229e2daf94d943a9aa6c8501dd31bf9c554cd0b"
131
+ }
@@ -0,0 +1,15 @@
1
+ import { ConfigPlugin } from '@expo/config-plugins';
2
+ type PluginParameters = {
3
+ /**
4
+ * Meta Audience Network SKAdNetwork identifiers to merge into Info.plist.
5
+ * Core's Expo plugin owns app IDs; this adapter only merges mediation network rows.
6
+ * Pass identifiers from Meta's current SKAdNetwork documentation at integrate time.
7
+ */
8
+ skAdNetworkItems?: string[];
9
+ };
10
+ /**
11
+ * Optional Expo config plugin for `@react-native-google-mobile-ads/facebook`.
12
+ * Does not set GMA app IDs (core plugin).
13
+ */
14
+ declare const withRNGoogleMobileAdsAdapterFacebook: ConfigPlugin<PluginParameters>;
15
+ export default withRNGoogleMobileAdsAdapterFacebook;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const config_plugins_1 = require("@expo/config-plugins");
4
+ const withAdapterSkAdNetworkItems = (config, skAdNetworkItems) => {
5
+ if (skAdNetworkItems === undefined || skAdNetworkItems.length === 0) {
6
+ return config;
7
+ }
8
+ return (0, config_plugins_1.withInfoPlist)(config, config => {
9
+ config.modResults.SKAdNetworkItems = config.modResults.SKAdNetworkItems ?? [];
10
+ const existingIdentifiers = config.modResults.SKAdNetworkItems.map((item) => item.SKAdNetworkIdentifier);
11
+ const missingIdentifiers = skAdNetworkItems.filter(identifier => !existingIdentifiers.includes(identifier));
12
+ config.modResults.SKAdNetworkItems.push(...missingIdentifiers.map(identifier => ({
13
+ SKAdNetworkIdentifier: identifier,
14
+ })));
15
+ return config;
16
+ });
17
+ };
18
+ /**
19
+ * Optional Expo config plugin for `@react-native-google-mobile-ads/facebook`.
20
+ * Does not set GMA app IDs (core plugin).
21
+ */
22
+ const withRNGoogleMobileAdsAdapterFacebook = (config, { skAdNetworkItems } = {}) => {
23
+ return (0, config_plugins_1.withPlugins)(config, [[withAdapterSkAdNetworkItems, skAdNetworkItems]]);
24
+ };
25
+ exports.default = withRNGoogleMobileAdsAdapterFacebook;
@@ -0,0 +1,52 @@
1
+ import { ConfigPlugin, withInfoPlist, withPlugins } from '@expo/config-plugins';
2
+
3
+ type PluginParameters = {
4
+ /**
5
+ * Meta Audience Network SKAdNetwork identifiers to merge into Info.plist.
6
+ * Core's Expo plugin owns app IDs; this adapter only merges mediation network rows.
7
+ * Pass identifiers from Meta's current SKAdNetwork documentation at integrate time.
8
+ */
9
+ skAdNetworkItems?: string[];
10
+ };
11
+
12
+ const withAdapterSkAdNetworkItems: ConfigPlugin<PluginParameters['skAdNetworkItems']> = (
13
+ config,
14
+ skAdNetworkItems,
15
+ ) => {
16
+ if (skAdNetworkItems === undefined || skAdNetworkItems.length === 0) {
17
+ return config;
18
+ }
19
+
20
+ return withInfoPlist(config, config => {
21
+ config.modResults.SKAdNetworkItems = config.modResults.SKAdNetworkItems ?? [];
22
+
23
+ const existingIdentifiers = config.modResults.SKAdNetworkItems.map(
24
+ (item: { SKAdNetworkIdentifier: string }) => item.SKAdNetworkIdentifier,
25
+ );
26
+
27
+ const missingIdentifiers = skAdNetworkItems.filter(
28
+ identifier => !existingIdentifiers.includes(identifier),
29
+ );
30
+
31
+ config.modResults.SKAdNetworkItems.push(
32
+ ...missingIdentifiers.map(identifier => ({
33
+ SKAdNetworkIdentifier: identifier,
34
+ })),
35
+ );
36
+
37
+ return config;
38
+ });
39
+ };
40
+
41
+ /**
42
+ * Optional Expo config plugin for `@react-native-google-mobile-ads/facebook`.
43
+ * Does not set GMA app IDs (core plugin).
44
+ */
45
+ const withRNGoogleMobileAdsAdapterFacebook: ConfigPlugin<PluginParameters> = (
46
+ config,
47
+ { skAdNetworkItems } = {},
48
+ ) => {
49
+ return withPlugins(config, [[withAdapterSkAdNetworkItems, skAdNetworkItems]]);
50
+ };
51
+
52
+ export default withRNGoogleMobileAdsAdapterFacebook;
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "expo-module-scripts/tsconfig.plugin",
3
+ "compilerOptions": {
4
+ "outDir": "build",
5
+ "rootDir": "src"
6
+ },
7
+ "include": ["./src"],
8
+ "exclude": ["**/__mocks__/*", "**/__tests__/*"]
9
+ }
@@ -0,0 +1 @@
1
+ {"root":["./src/index.ts"],"version":"5.9.3"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Autolinking entry for the GAM adapter package.
3
+ * Adapters ship native mediation artifacts only — no TurboModule / Fabric view.
4
+ */
5
+ module.exports = {
6
+ dependency: {
7
+ platforms: {
8
+ android: {},
9
+ ios: {},
10
+ },
11
+ },
12
+ };
package/src/index.ts ADDED
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Meta Audience Network (Facebook) GAM mediation adapter package public surface.
3
+ *
4
+ * Exports adapter class-name constants for GAM UI paste / docs only. Does **not**
5
+ * add JS ad APIs — core `initialize()` adapter statuses remain the discovery
6
+ * signal (API design §5.3).
7
+ *
8
+ * Native mediation is linked via Google's published adapter:
9
+ * - Android: `com.google.ads.mediation:facebook`
10
+ * - iOS: `GoogleMobileAdsMediationFacebook`
11
+ */
12
+
13
+ export type NativeAdapterClassName = {
14
+ android: string;
15
+ ios: string;
16
+ };
17
+
18
+ /** Network slug for this Character GAM adapter package. */
19
+ export const networkSlug = 'facebook' as const;
20
+
21
+ /**
22
+ * Fully-qualified native mediation adapter class names for AdMob / GAM console paste.
23
+ * @see https://developers.google.com/admob/android/mediation/meta
24
+ * @see https://developers.google.com/admob/ios/mediation/meta
25
+ */
26
+ export const nativeAdapterClassName: NativeAdapterClassName = {
27
+ android: 'com.google.ads.mediation.facebook.FacebookMediationAdapter',
28
+ ios: 'GADMediationAdapterFacebook',
29
+ };