expo-ads 0.1.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.
Files changed (35) hide show
  1. package/.prettierrc +8 -0
  2. package/CHANGELOG.md +11 -0
  3. package/LICENSE +21 -0
  4. package/README.md +44 -0
  5. package/android/build.gradle +34 -0
  6. package/android/src/main/AndroidManifest.xml +23 -0
  7. package/android/src/main/java/expo/modules/ads/google/GoogleAdsModule.kt +17 -0
  8. package/android/src/main/java/expo/modules/ads/meta/MetaAdsInitializer.kt +108 -0
  9. package/android/src/main/java/expo/modules/ads/meta/MetaAdsModule.kt +40 -0
  10. package/build/google/ExpoAdsGoogleModule.d.ts +6 -0
  11. package/build/google/ExpoAdsGoogleModule.d.ts.map +1 -0
  12. package/build/google/ExpoAdsGoogleModule.js +3 -0
  13. package/build/google/ExpoAdsGoogleModule.js.map +1 -0
  14. package/build/google/index.d.ts +2 -0
  15. package/build/google/index.d.ts.map +1 -0
  16. package/build/google/index.js +6 -0
  17. package/build/google/index.js.map +1 -0
  18. package/build/meta/ExpoAdsMetaModule.d.ts +7 -0
  19. package/build/meta/ExpoAdsMetaModule.d.ts.map +1 -0
  20. package/build/meta/ExpoAdsMetaModule.js +3 -0
  21. package/build/meta/ExpoAdsMetaModule.js.map +1 -0
  22. package/build/meta/index.d.ts +2 -0
  23. package/build/meta/index.d.ts.map +1 -0
  24. package/build/meta/index.js +4 -0
  25. package/build/meta/index.js.map +1 -0
  26. package/eslint.config.cjs +5 -0
  27. package/expo-module.config.json +13 -0
  28. package/ios/Expo-ads.podspec +23 -0
  29. package/ios/Expo-adsModule.swift +7 -0
  30. package/package.json +81 -0
  31. package/src/google/ExpoAdsGoogleModule.ts +6 -0
  32. package/src/google/index.ts +5 -0
  33. package/src/meta/ExpoAdsMetaModule.ts +7 -0
  34. package/src/meta/index.ts +3 -0
  35. package/tsconfig.json +28 -0
package/.prettierrc ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "printWidth": 100,
3
+ "tabWidth": 2,
4
+ "singleQuote": true,
5
+ "bracketSameLine": true,
6
+ "trailingComma": "es5",
7
+ "jsxSingleQuote": false,
8
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+
3
+ ## Unpublished
4
+
5
+ ### 🛠 Breaking changes
6
+
7
+ ### 🎉 New features
8
+
9
+ ### 🐛 Bug fixes
10
+
11
+ ### 💡 Others
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015-present 650 Industries, Inc. (aka Expo)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # Expo Ads
2
+
3
+ > 🚧 **This package is currently under construction.**
4
+
5
+ **Expo Ads** is a React Native / Expo native module for integrating mobile advertising networks into Expo applications.
6
+
7
+ ## Status
8
+
9
+ **⚠️ Work in Progress**
10
+
11
+ This package is currently under active development. APIs, features, configuration, and implementation details may change without notice.
12
+
13
+ **Not recommended for production use yet.**
14
+
15
+ ## Planned Ad Networks
16
+
17
+ - Google Mobile Ads
18
+ - Meta Audience Network
19
+
20
+ <!-- ## Planned Features
21
+
22
+ - Google Mobile Ads initialization
23
+ - Meta Audience Network initialization
24
+ - Banner Ads
25
+ - Interstitial Ads
26
+ - Rewarded Ads
27
+ - Native Ads
28
+ - Expo config plugin support
29
+ - Android support
30
+ - iOS support
31
+ - TypeScript API
32
+ - Expo/EAS Build compatibility
33
+
34
+ ## Installation
35
+
36
+ Installation instructions will be provided once the package reaches a stable release.
37
+
38
+ ## Development
39
+
40
+ This package is currently being developed and tested locally with Expo and React Native. -->
41
+
42
+ ## License
43
+
44
+ MIT
@@ -0,0 +1,34 @@
1
+ import groovy.json.JsonSlurper
2
+
3
+ plugins {
4
+ id 'com.android.library'
5
+ id 'expo-module-gradle-plugin'
6
+ }
7
+
8
+ group = 'expo.modules.ads'
9
+ version = '0.1.0'
10
+
11
+ def packageJson = new JsonSlurper().parseText(file("${projectDir}/../package.json").text)
12
+
13
+ def metaAudienceNetworkVersion = packageJson.sdkVersions.android.metaAudienceNetwork
14
+ def playServicesAdsIdentifierVersion = packageJson.sdkVersions.android.playServicesAdsIdentifier
15
+ def playServicesBasementVersion = packageJson.sdkVersions.android.playServicesBasement
16
+
17
+ android {
18
+ namespace "expo.modules.ads"
19
+ defaultConfig {
20
+ versionCode 1
21
+ versionName "0.1.0"
22
+ }
23
+ lintOptions {
24
+ abortOnError false
25
+ }
26
+ }
27
+
28
+
29
+
30
+ dependencies {
31
+ implementation("com.facebook.android:audience-network-sdk:${metaAudienceNetworkVersion}")
32
+ implementation("com.google.android.gms:play-services-ads-identifier:${playServicesAdsIdentifierVersion}")
33
+ implementation("com.google.android.gms:play-services-basement:${playServicesBasementVersion}")
34
+ }
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ package="expo.modules.meta">
4
+
5
+ <uses-permission android:name="android.permission.INTERNET" />
6
+ <uses-permission android:name="android.permission.WAKE_LOCK" />
7
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
8
+
9
+ <application>
10
+ <meta-data
11
+ android:name="com.google.android.gms.ads.APPLICATION_ID"
12
+ android:value="${appJSONGoogleMobileAdsAppID}"/>
13
+ <meta-data
14
+ android:name="com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT"
15
+ android:value="${appJSONGoogleMobileAdsDelayAppMeasurementInit}"/>
16
+ <meta-data
17
+ android:name="com.google.android.gms.ads.flag.OPTIMIZE_INITIALIZATION"
18
+ android:value="${appJSONGoogleMobileAdsOptimizeInitialization}"/>
19
+ <meta-data
20
+ android:name="com.google.android.gms.ads.flag.OPTIMIZE_AD_LOADING"
21
+ android:value="${appJSONGoogleMobileAdsOptimizeAdLoading}"/>
22
+ </application>
23
+ </manifest>
@@ -0,0 +1,17 @@
1
+ package expo.modules.ads.google
2
+
3
+ import expo.modules.kotlin.modules.Module
4
+ import expo.modules.kotlin.modules.ModuleDefinition
5
+
6
+ /**
7
+ * Placeholder module for Google Mobile Ads support.
8
+ * Will be filled in once the Meta implementation is complete.
9
+ */
10
+ class GoogleAdsModule : Module() {
11
+ override fun definition() = ModuleDefinition {
12
+ Name("ExpoAdsGoogle") // the name JS uses to find this module (import from "expo-ads/google")
13
+
14
+ // TODO: implement Google Mobile Ads initialization + functions here,
15
+ // mirroring the structure of MetaAdsModule / MetaAdsInitializer.
16
+ }
17
+ }
@@ -0,0 +1,108 @@
1
+ package expo.modules.ads.meta
2
+
3
+ import android.content.Context
4
+ import android.content.pm.ApplicationInfo
5
+ import android.os.Handler
6
+ import android.os.Looper
7
+ import android.util.Log
8
+ import com.facebook.ads.AdSettings
9
+ import com.facebook.ads.AudienceNetworkAds
10
+
11
+ object MetaAdsInitializer : AudienceNetworkAds.InitListener {
12
+
13
+ const val TAG = "ExpoAdsMeta"
14
+
15
+ private enum class State { IDLE, INITIALIZING, READY, FAILED }
16
+
17
+ private val lock = Any()
18
+ private var state = State.IDLE
19
+ private var lastMessage = ""
20
+ private val pending = mutableListOf<(Boolean, String) -> Unit>()
21
+
22
+ fun isReady(): Boolean = synchronized(lock) { state == State.READY }
23
+
24
+ fun whenReady(context: Context, callback: (success: Boolean, message: String) -> Unit) {
25
+ val appContext = context.applicationContext
26
+ var startInit = false
27
+ var immediate: Pair<Boolean, String>? = null
28
+
29
+ synchronized(lock) {
30
+ when (state) {
31
+ State.READY -> {
32
+ Log.d(TAG, "[Init] Already initialized, running callback immediately")
33
+ immediate = true to lastMessage
34
+ }
35
+ State.INITIALIZING -> {
36
+ pending.add(callback)
37
+ Log.d(TAG, "[Init] Initialization in progress, callback queued (${pending.size} waiting)")
38
+ }
39
+ State.IDLE -> {
40
+ Log.i(TAG, "[Init] First-time initialization requested")
41
+ state = State.INITIALIZING
42
+ pending.add(callback)
43
+ startInit = true
44
+ }
45
+ State.FAILED -> {
46
+ Log.w(TAG, "[Init] Previous initialization failed ($lastMessage), retrying")
47
+ state = State.INITIALIZING
48
+ pending.add(callback)
49
+ startInit = true
50
+ }
51
+ }
52
+ }
53
+
54
+ immediate?.let { callback(it.first, it.second); return }
55
+
56
+ if (startInit) {
57
+ Handler(Looper.getMainLooper()).post { doInitialize(appContext) }
58
+ }
59
+ }
60
+
61
+ private fun doInitialize(context: Context) {
62
+ try {
63
+ if (AudienceNetworkAds.isInitialized(context)) {
64
+ Log.i(TAG, "[Init] SDK reports it is already initialized (skipping initialize())")
65
+ finish(true, "Already initialized")
66
+ return
67
+ }
68
+
69
+ val isDebuggable = (context.applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE) != 0
70
+ if (isDebuggable) {
71
+ AdSettings.turnOnSDKDebugger(context)
72
+ Log.d(TAG, "[Debug] SDK debugger ENABLED (debuggable build)")
73
+ } else {
74
+ Log.d(TAG, "[Debug] SDK debugger NOT set (release build)")
75
+ }
76
+
77
+ Log.i(TAG, "[Init] Calling AudienceNetworkAds.initialize()")
78
+ AudienceNetworkAds
79
+ .buildInitSettings(context)
80
+ .withInitListener(this)
81
+ .initialize()
82
+ } catch (e: Exception) {
83
+ Log.e(TAG, "[Init] initialize() threw an exception: ${e.message}", e)
84
+ finish(false, e.message ?: "Unknown exception during initialize")
85
+ }
86
+ }
87
+
88
+ override fun onInitialized(result: AudienceNetworkAds.InitResult) {
89
+ if (result.isSuccess) {
90
+ Log.i(TAG, "[Init] SUCCESS: ${result.message}")
91
+ } else {
92
+ Log.e(TAG, "[Init] FAILED: ${result.message}")
93
+ }
94
+ finish(result.isSuccess, result.message)
95
+ }
96
+
97
+ private fun finish(success: Boolean, message: String) {
98
+ val callbacks: List<(Boolean, String) -> Unit>
99
+ synchronized(lock) {
100
+ state = if (success) State.READY else State.FAILED
101
+ lastMessage = message
102
+ callbacks = pending.toList()
103
+ pending.clear()
104
+ }
105
+ Log.d(TAG, "[Init] Notifying ${callbacks.size} waiting callback(s), success=$success")
106
+ callbacks.forEach { it(success, message) }
107
+ }
108
+ }
@@ -0,0 +1,40 @@
1
+ package expo.modules.ads.meta
2
+
3
+ import android.util.Log
4
+ import expo.modules.kotlin.Promise
5
+ import expo.modules.kotlin.modules.Module
6
+ import expo.modules.kotlin.modules.ModuleDefinition
7
+
8
+ class MetaAdsModule : Module() {
9
+ override fun definition() = ModuleDefinition {
10
+ Name("ExpoAdsMeta") // the name JS uses to find this module (import from "expo-ads/meta")
11
+
12
+ // Runs automatically when the module loads (warm-up)
13
+ OnCreate {
14
+ val ctx = appContext.reactContext
15
+ if (ctx == null) {
16
+ Log.w(MetaAdsInitializer.TAG, "[Module] OnCreate: React context is null, skipping warm-up")
17
+ } else {
18
+ Log.d(MetaAdsInitializer.TAG, "[Module] OnCreate: starting SDK warm-up")
19
+ MetaAdsInitializer.whenReady(ctx) { _, _ -> }
20
+ }
21
+ }
22
+
23
+ // Lets JS call: await ExpoAdsMeta.initialize()
24
+ AsyncFunction("initialize") { promise: Promise ->
25
+ val ctx = appContext.reactContext
26
+ if (ctx == null) {
27
+ Log.e(MetaAdsInitializer.TAG, "[Module] initialize() called from JS but React context is null")
28
+ promise.reject("ERR_NO_CONTEXT", "React context not available", null)
29
+ return@AsyncFunction
30
+ }
31
+ Log.d(MetaAdsInitializer.TAG, "[Module] initialize() called from JS")
32
+ MetaAdsInitializer.whenReady(ctx) { ok, msg ->
33
+ if (ok) promise.resolve(msg) else promise.reject("ERR_META_INIT", msg, null)
34
+ }
35
+ }
36
+
37
+ // If you have a banner view, register it here too:
38
+ // View(MetaBannerView::class) { ... }
39
+ }
40
+ }
@@ -0,0 +1,6 @@
1
+ import { NativeModule } from 'expo';
2
+ declare class ExpoAdsGoogleModule extends NativeModule<{}> {
3
+ }
4
+ declare const _default: ExpoAdsGoogleModule;
5
+ export default _default;
6
+ //# sourceMappingURL=ExpoAdsGoogleModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoAdsGoogleModule.d.ts","sourceRoot":"","sources":["../../src/google/ExpoAdsGoogleModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,MAAM,CAAC;AAGzD,OAAO,OAAO,mBAAoB,SAAQ,YAAY,CAAC,EAAE,CAAC;CAAG;;AAE7D,wBAAyE"}
@@ -0,0 +1,3 @@
1
+ import { requireNativeModule } from 'expo';
2
+ export default requireNativeModule('ExpoAdsGoogle');
3
+ //# sourceMappingURL=ExpoAdsGoogleModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoAdsGoogleModule.js","sourceRoot":"","sources":["../../src/google/ExpoAdsGoogleModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAKzD,eAAe,mBAAmB,CAAsB,eAAe,CAAC,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from 'expo';\n\n// TODO: fill in Google Mobile Ads API surface once implemented natively.\ndeclare class ExpoAdsGoogleModule extends NativeModule<{}> {}\n\nexport default requireNativeModule<ExpoAdsGoogleModule>('ExpoAdsGoogle');\n"]}
@@ -0,0 +1,2 @@
1
+ export { default } from './ExpoAdsGoogleModule';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/google/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,6 @@
1
+ // Reexport the Google ads native module. On web, it will be resolved to
2
+ // ExpoAdsGoogleModule.web.ts and on native platforms to ExpoAdsGoogleModule.ts
3
+ //
4
+ // TODO: this is a placeholder until the Google Mobile Ads native module is implemented.
5
+ export { default } from './ExpoAdsGoogleModule';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/google/index.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,+EAA+E;AAC/E,EAAE;AACF,wFAAwF;AACxF,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["// Reexport the Google ads native module. On web, it will be resolved to\n// ExpoAdsGoogleModule.web.ts and on native platforms to ExpoAdsGoogleModule.ts\n//\n// TODO: this is a placeholder until the Google Mobile Ads native module is implemented.\nexport { default } from './ExpoAdsGoogleModule';\n"]}
@@ -0,0 +1,7 @@
1
+ import { NativeModule } from 'expo';
2
+ declare class ExpoAdsMetaModule extends NativeModule<{}> {
3
+ initialize(): Promise<string>;
4
+ }
5
+ declare const _default: ExpoAdsMetaModule;
6
+ export default _default;
7
+ //# sourceMappingURL=ExpoAdsMetaModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoAdsMetaModule.d.ts","sourceRoot":"","sources":["../../src/meta/ExpoAdsMetaModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,MAAM,CAAC;AAEzD,OAAO,OAAO,iBAAkB,SAAQ,YAAY,CAAC,EAAE,CAAC;IACtD,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;CAC9B;;AAED,wBAAqE"}
@@ -0,0 +1,3 @@
1
+ import { requireNativeModule } from 'expo';
2
+ export default requireNativeModule('ExpoAdsMeta');
3
+ //# sourceMappingURL=ExpoAdsMetaModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoAdsMetaModule.js","sourceRoot":"","sources":["../../src/meta/ExpoAdsMetaModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAMzD,eAAe,mBAAmB,CAAoB,aAAa,CAAC,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from 'expo';\n\ndeclare class ExpoAdsMetaModule extends NativeModule<{}> {\n initialize(): Promise<string>;\n}\n\nexport default requireNativeModule<ExpoAdsMetaModule>('ExpoAdsMeta');\n"]}
@@ -0,0 +1,2 @@
1
+ export { default } from './ExpoAdsMetaModule';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/meta/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,4 @@
1
+ // Reexport the Meta ads native module. On web, it will be resolved to
2
+ // ExpoAdsMetaModule.web.ts and on native platforms to ExpoAdsMetaModule.ts
3
+ export { default } from './ExpoAdsMetaModule';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/meta/index.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,2EAA2E;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["// Reexport the Meta ads native module. On web, it will be resolved to\n// ExpoAdsMetaModule.web.ts and on native platforms to ExpoAdsMetaModule.ts\nexport { default } from './ExpoAdsMetaModule';\n"]}
@@ -0,0 +1,5 @@
1
+ const { defineConfig } = require('eslint/config');
2
+ const universe = require('eslint-config-universe/flat/native');
3
+ const universeWeb = require('eslint-config-universe/flat/web');
4
+
5
+ module.exports = defineConfig([{ ignores: ['build'] }, ...universe, ...universeWeb]);
@@ -0,0 +1,13 @@
1
+ {
2
+ "platforms": ["apple", "android"],
3
+ "apple": {
4
+ "modules": ["ExpoAdsModule", "MetaAdsModule", "GoogleAdsModule"]
5
+ },
6
+ "android": {
7
+ "modules": [
8
+ "expo.modules.ads.ExpoAdsModule",
9
+ "expo.modules.ads.meta.MetaAdsModule",
10
+ "expo.modules.ads.google.GoogleAdsModule"
11
+ ]
12
+ }
13
+ }
@@ -0,0 +1,23 @@
1
+ Pod::Spec.new do |s|
2
+ s.name = 'Expo-ads'
3
+ s.version = '1.0.0'
4
+ s.summary = 'A sample project summary'
5
+ s.description = 'A sample project description'
6
+ s.author = ''
7
+ s.homepage = 'https://docs.expo.dev/modules/'
8
+ s.platforms = {
9
+ :ios => '16.4',
10
+ :tvos => '16.4'
11
+ }
12
+ s.source = { git: '' }
13
+ s.static_framework = true
14
+
15
+ s.dependency 'ExpoModulesCore'
16
+
17
+ # Swift/Objective-C compatibility
18
+ s.pod_target_xcconfig = {
19
+ 'DEFINES_MODULE' => 'YES',
20
+ }
21
+
22
+ s.source_files = "**/*.{h,m,mm,swift,hpp,cpp}"
23
+ end
@@ -0,0 +1,7 @@
1
+ import ExpoModulesCore
2
+
3
+ public class ExpoAdsModule: Module {
4
+ public func definition() -> ModuleDefinition {
5
+ Name("ExpoAds")
6
+ }
7
+ }
package/package.json ADDED
@@ -0,0 +1,81 @@
1
+ {
2
+ "name": "expo-ads",
3
+ "version": "0.1.0",
4
+ "description": "Expo Ads is a React Native / Expo native module for integrating mobile advertising networks into Expo applications.",
5
+ "main": "build/index.js",
6
+ "types": "build/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./build/index.d.ts",
10
+ "default": "./build/index.js"
11
+ },
12
+ "./meta": {
13
+ "types": "./build/meta/index.d.ts",
14
+ "default": "./build/meta/index.js"
15
+ },
16
+ "./google": {
17
+ "types": "./build/google/index.d.ts",
18
+ "default": "./build/google/index.js"
19
+ },
20
+ "./package.json": "./package.json"
21
+ },
22
+ "sdkVersions": {
23
+ "android": {
24
+ "metaAudienceNetwork": "6.+",
25
+ "playServicesAdsIdentifier": "18.3.0",
26
+ "playServicesBasement": "18.12.0"
27
+ }
28
+ },
29
+ "scripts": {
30
+ "build": "node internal/module_scripts/build.js",
31
+ "clean": "node internal/module_scripts/clean.js",
32
+ "lint": "eslint src/",
33
+ "test": "node internal/module_scripts/test.js",
34
+ "prepare": "node internal/module_scripts/prepare.js",
35
+ "open:ios": "node internal/module_scripts/open-ios.js",
36
+ "open:android": "node internal/module_scripts/open-android.js"
37
+ },
38
+ "keywords": [
39
+ "react-native",
40
+ "expo",
41
+ "expo-ads",
42
+ "Expo-ads",
43
+ "Facebook Ads",
44
+ "Google Admob",
45
+ "Google Ads",
46
+ "Meta Audience Network"
47
+ ],
48
+ "repository": "https://github.com/vatsalpipalava/expo-ads.git",
49
+ "bugs": {
50
+ "url": "https://github.com/vatsalpipalava/expo-ads/issues"
51
+ },
52
+ "author": "Vatsal Pipalava <vatsalpipalava@gmail.com> (https://github.com/vatsalpipalava)",
53
+ "license": "MIT",
54
+ "homepage": "https://github.com/vatsalpipalava/expo-ads#readme",
55
+ "dependencies": {},
56
+ "devDependencies": {
57
+ "@babel/core": "^7.26.0",
58
+ "@types/jest": "^29.2.1",
59
+ "@types/react": "~19.2.4",
60
+ "babel-preset-expo": "~57.0.0",
61
+ "eslint": "~9.39.4",
62
+ "eslint-config-universe": "^15.0.3",
63
+ "expo": "^57.0.23",
64
+ "jest": "^29.7.0",
65
+ "jest-expo": "~57.0.5",
66
+ "prettier": "^3.0.0",
67
+ "react-native": "0.86.3",
68
+ "typescript": "~6.0.3"
69
+ },
70
+ "jest": {
71
+ "preset": "jest-expo",
72
+ "roots": [
73
+ "<rootDir>/src"
74
+ ]
75
+ },
76
+ "peerDependencies": {
77
+ "expo": "*",
78
+ "react": "*",
79
+ "react-native": "*"
80
+ }
81
+ }
@@ -0,0 +1,6 @@
1
+ import { NativeModule, requireNativeModule } from 'expo';
2
+
3
+ // TODO: fill in Google Mobile Ads API surface once implemented natively.
4
+ declare class ExpoAdsGoogleModule extends NativeModule<{}> {}
5
+
6
+ export default requireNativeModule<ExpoAdsGoogleModule>('ExpoAdsGoogle');
@@ -0,0 +1,5 @@
1
+ // Reexport the Google ads native module. On web, it will be resolved to
2
+ // ExpoAdsGoogleModule.web.ts and on native platforms to ExpoAdsGoogleModule.ts
3
+ //
4
+ // TODO: this is a placeholder until the Google Mobile Ads native module is implemented.
5
+ export { default } from './ExpoAdsGoogleModule';
@@ -0,0 +1,7 @@
1
+ import { NativeModule, requireNativeModule } from 'expo';
2
+
3
+ declare class ExpoAdsMetaModule extends NativeModule<{}> {
4
+ initialize(): Promise<string>;
5
+ }
6
+
7
+ export default requireNativeModule<ExpoAdsMetaModule>('ExpoAdsMeta');
@@ -0,0 +1,3 @@
1
+ // Reexport the Meta ads native module. On web, it will be resolved to
2
+ // ExpoAdsMetaModule.web.ts and on native platforms to ExpoAdsMetaModule.ts
3
+ export { default } from './ExpoAdsMetaModule';
package/tsconfig.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "compilerOptions": {
3
+ "lib": ["dom", "DOM.Iterable", "esnext"],
4
+ "types": ["jest"],
5
+ "typeRoots": ["./ts-declarations", "./node_modules/@types"],
6
+ "jsx": "react-native",
7
+ "target": "esnext",
8
+ "moduleResolution": "bundler",
9
+ "module": "esnext",
10
+ "moduleDetection": "force",
11
+ "esModuleInterop": true,
12
+ "sourceMap": true,
13
+ "declaration": true,
14
+ "declarationMap": true,
15
+ "inlineSources": true,
16
+ "skipLibCheck": true,
17
+ "strict": true,
18
+ "noFallthroughCasesInSwitch": true,
19
+ "noPropertyAccessFromIndexSignature": false,
20
+ "noImplicitReturns": true,
21
+ "noUnusedLocals": true,
22
+ "noUnusedParameters": false,
23
+ "rootDir": "./src",
24
+ "outDir": "./build"
25
+ },
26
+ "include": ["./src"],
27
+ "exclude": ["**/__mocks__/*", "**/__tests__/*"]
28
+ }