Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

expo-ads-admob

Package Overview
Dependencies
Maintainers
21
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expo-ads-admob - npm Package Compare versions

Comparing version 7.0.0 to 8.0.0

android/src/main/java/expo/modules/ads/admob/AdMobModule.java

14

build/AdMobBanner.d.ts

@@ -24,6 +24,2 @@ import PropTypes from 'prop-types';

/**
* Test device ID
*/
testDeviceID?: string;
/**
* Additional request params added to underlying request for the ad.

@@ -70,5 +66,2 @@ */

renderToHardwareTextureAndroid?: PropTypes.Validator<boolean | undefined> | undefined;
accessibilityViewIsModal?: PropTypes.Validator<boolean | undefined> | undefined;
accessibilityActions?: PropTypes.Validator<string[] | undefined> | undefined;
onAccessibilityAction?: PropTypes.Validator<(() => void) | undefined> | undefined;
shouldRasterizeIOS?: PropTypes.Validator<boolean | undefined> | undefined;

@@ -100,2 +93,6 @@ isTVSelectable?: PropTypes.Validator<boolean | undefined> | undefined;

accessible?: PropTypes.Validator<boolean | undefined> | undefined;
accessibilityActions?: PropTypes.Validator<readonly Readonly<{
name: import("react-native").AccessibilityActionName;
label?: string | undefined;
}>[] | undefined> | undefined;
accessibilityLabel?: PropTypes.Validator<string | undefined> | undefined;

@@ -106,2 +103,3 @@ accessibilityRole?: PropTypes.Validator<"button" | "header" | "link" | "menu" | "menuitem" | "summary" | "image" | "switch" | "text" | "none" | "search" | "keyboardkey" | "adjustable" | "imagebutton" | "alert" | "checkbox" | "combobox" | "menubar" | "progressbar" | "radio" | "radiogroup" | "scrollbar" | "spinbutton" | "tab" | "tablist" | "timer" | "toolbar" | undefined> | undefined;

accessibilityHint?: PropTypes.Validator<string | undefined> | undefined;
onAccessibilityAction?: PropTypes.Validator<((event: import("react-native").AccessibilityActionEvent) => void) | undefined> | undefined;
accessibilityComponentType?: PropTypes.Validator<"button" | "none" | "radiobutton_checked" | "radiobutton_unchecked" | undefined> | undefined;

@@ -112,2 +110,3 @@ accessibilityLiveRegion?: PropTypes.Validator<"none" | "polite" | "assertive" | undefined> | undefined;

accessibilityTraits?: PropTypes.Validator<"button" | "header" | "link" | "summary" | "image" | "text" | "none" | "search" | "adjustable" | "disabled" | "selected" | "plays" | "key" | "frequentUpdates" | "startsMedia" | "allowsDirectInteraction" | "pageTurn" | import("react-native").AccessibilityTrait[] | undefined> | undefined;
accessibilityViewIsModal?: PropTypes.Validator<boolean | undefined> | undefined;
onAccessibilityTap?: PropTypes.Validator<(() => void) | undefined> | undefined;

@@ -118,3 +117,2 @@ onMagicTap?: PropTypes.Validator<(() => void) | undefined> | undefined;

adUnitID: PropTypes.Requireable<string>;
testDeviceID: PropTypes.Requireable<string>;
servePersonalizedAds: PropTypes.Requireable<boolean>;

@@ -121,0 +119,0 @@ onAdViewDidReceiveAd: PropTypes.Requireable<(...args: any[]) => any>;

@@ -5,2 +5,3 @@ import { requireNativeViewManager } from '@unimodules/core';

import { View, ViewPropTypes } from 'react-native';
let _hasWarnedAboutTestDeviceID = false;
export default class AdMobBanner extends React.Component {

@@ -18,8 +19,14 @@ constructor() {

render() {
let additionalRequestParams = { ...this.props.additionalRequestParams };
let additionalRequestParams = {
...this.props.additionalRequestParams,
};
if (!this.props.servePersonalizedAds) {
additionalRequestParams.npa = "1";
additionalRequestParams.npa = '1';
}
if (this.props.testDeviceID && !_hasWarnedAboutTestDeviceID) {
console.warn('The `testDeviceID` prop of AdMobBanner is deprecated. Test device IDs are now set globally. Use AdMob.setTestDeviceIDAsync instead.');
_hasWarnedAboutTestDeviceID = true;
}
return (<View style={this.props.style}>
<ExpoBannerView style={this.state.style} adUnitID={this.props.adUnitID} bannerSize={this.props.bannerSize} testDeviceID={this.props.testDeviceID} onSizeChange={this._handleSizeChange} additionalRequestParams={additionalRequestParams} onAdViewDidReceiveAd={this.props.onAdViewDidReceiveAd} onDidFailToReceiveAdWithError={this._handleDidFailToReceiveAdWithError} onAdViewWillPresentScreen={this.props.onAdViewWillPresentScreen} onAdViewWillDismissScreen={this.props.onAdViewWillDismissScreen} onAdViewDidDismissScreen={this.props.onAdViewDidDismissScreen} onAdViewWillLeaveApplication={this.props.onAdViewWillLeaveApplication}/>
<ExpoBannerView style={this.state.style} adUnitID={this.props.adUnitID} bannerSize={this.props.bannerSize} onSizeChange={this._handleSizeChange} additionalRequestParams={additionalRequestParams} onAdViewDidReceiveAd={this.props.onAdViewDidReceiveAd} onDidFailToReceiveAdWithError={this._handleDidFailToReceiveAdWithError} onAdViewWillPresentScreen={this.props.onAdViewWillPresentScreen} onAdViewWillDismissScreen={this.props.onAdViewWillDismissScreen} onAdViewDidDismissScreen={this.props.onAdViewDidDismissScreen} onAdViewWillLeaveApplication={this.props.onAdViewWillLeaveApplication}/>
</View>);

@@ -39,3 +46,2 @@ }

adUnitID: PropTypes.string,
testDeviceID: PropTypes.string,
servePersonalizedAds: PropTypes.bool,

@@ -42,0 +48,0 @@ onAdViewDidReceiveAd: PropTypes.func,

import { EventEmitter, UnavailabilityError } from '@unimodules/core';
import AdMobNativeModule from './ExpoAdsAdMobInterstitialManager';
import { setTestDeviceIDAsync } from './AdMob';
const moduleName = 'AdMobInterstitial';

@@ -24,6 +25,4 @@ const eventNames = [

async setTestDeviceID(id) {
if (!AdMobNativeModule.setTestDeviceID) {
throw new UnavailabilityError(moduleName, 'setTestDeviceID');
}
await AdMobNativeModule.setTestDeviceID(id);
console.warn('AdMobInterstitial.setTestDeviceID is deprecated. Test device IDs are now set globally. Use AdMob.setTestDeviceIDAsync instead.');
await setTestDeviceIDAsync(id);
},

@@ -30,0 +29,0 @@ async requestAdAsync(options = {}) {

import { EventEmitter, UnavailabilityError } from '@unimodules/core';
import AdMobNativeModule from './ExpoAdsAdMobRewardedVideoAdManager';
import { setTestDeviceIDAsync } from './AdMob';
const moduleName = 'AdMobRewarded';

@@ -26,6 +27,4 @@ const eventNames = [

async setTestDeviceID(id) {
if (!AdMobNativeModule.setTestDeviceID) {
throw new UnavailabilityError(moduleName, 'setTestDeviceID');
}
await AdMobNativeModule.setTestDeviceID(id);
console.warn('AdMobRewarded.setTestDeviceID is deprecated. Test device IDs are now set globally. Use AdMob.setTestDeviceIDAsync instead.');
await setTestDeviceIDAsync(id);
},

@@ -32,0 +31,0 @@ async requestAdAsync(options = {}) {

@@ -5,1 +5,2 @@ export { default as AdMobBanner } from './AdMobBanner';

export { default as PublisherBanner } from './PublisherBanner';
export * from './AdMob';

@@ -5,2 +5,3 @@ export { default as AdMobBanner } from './AdMobBanner';

export { default as PublisherBanner } from './PublisherBanner';
export * from './AdMob';
//# sourceMappingURL=index.js.map

@@ -27,6 +27,2 @@ import PropTypes from 'prop-types';

/**
* Test device ID
*/
testDeviceID?: string;
/**
* Additional request params added to underlying request for the ad.

@@ -74,5 +70,2 @@ */

renderToHardwareTextureAndroid?: PropTypes.Validator<boolean | undefined> | undefined;
accessibilityViewIsModal?: PropTypes.Validator<boolean | undefined> | undefined;
accessibilityActions?: PropTypes.Validator<string[] | undefined> | undefined;
onAccessibilityAction?: PropTypes.Validator<(() => void) | undefined> | undefined;
shouldRasterizeIOS?: PropTypes.Validator<boolean | undefined> | undefined;

@@ -104,2 +97,6 @@ isTVSelectable?: PropTypes.Validator<boolean | undefined> | undefined;

accessible?: PropTypes.Validator<boolean | undefined> | undefined;
accessibilityActions?: PropTypes.Validator<readonly Readonly<{
name: import("react-native").AccessibilityActionName;
label?: string | undefined;
}>[] | undefined> | undefined;
accessibilityLabel?: PropTypes.Validator<string | undefined> | undefined;

@@ -110,2 +107,3 @@ accessibilityRole?: PropTypes.Validator<"button" | "header" | "link" | "menu" | "menuitem" | "summary" | "image" | "switch" | "text" | "none" | "search" | "keyboardkey" | "adjustable" | "imagebutton" | "alert" | "checkbox" | "combobox" | "menubar" | "progressbar" | "radio" | "radiogroup" | "scrollbar" | "spinbutton" | "tab" | "tablist" | "timer" | "toolbar" | undefined> | undefined;

accessibilityHint?: PropTypes.Validator<string | undefined> | undefined;
onAccessibilityAction?: PropTypes.Validator<((event: import("react-native").AccessibilityActionEvent) => void) | undefined> | undefined;
accessibilityComponentType?: PropTypes.Validator<"button" | "none" | "radiobutton_checked" | "radiobutton_unchecked" | undefined> | undefined;

@@ -116,2 +114,3 @@ accessibilityLiveRegion?: PropTypes.Validator<"none" | "polite" | "assertive" | undefined> | undefined;

accessibilityTraits?: PropTypes.Validator<"button" | "header" | "link" | "summary" | "image" | "text" | "none" | "search" | "adjustable" | "disabled" | "selected" | "plays" | "key" | "frequentUpdates" | "startsMedia" | "allowsDirectInteraction" | "pageTurn" | import("react-native").AccessibilityTrait[] | undefined> | undefined;
accessibilityViewIsModal?: PropTypes.Validator<boolean | undefined> | undefined;
onAccessibilityTap?: PropTypes.Validator<(() => void) | undefined> | undefined;

@@ -122,3 +121,2 @@ onMagicTap?: PropTypes.Validator<(() => void) | undefined> | undefined;

adUnitID: PropTypes.Requireable<string>;
testDeviceID: PropTypes.Requireable<string>;
servePersonalizedAds: PropTypes.Requireable<boolean>;

@@ -125,0 +123,0 @@ onAdViewDidReceiveAd: PropTypes.Requireable<(...args: any[]) => any>;

@@ -5,2 +5,3 @@ import { requireNativeViewManager } from '@unimodules/core';

import { View, ViewPropTypes } from 'react-native';
let _hasWarnedAboutTestDeviceID = false;
export default class PublisherBanner extends React.Component {

@@ -18,8 +19,14 @@ constructor() {

render() {
let additionalRequestParams = { ...this.props.additionalRequestParams };
let additionalRequestParams = {
...this.props.additionalRequestParams,
};
if (!this.props.servePersonalizedAds) {
additionalRequestParams.npa = "1";
additionalRequestParams.npa = '1';
}
if (this.props.testDeviceID && !_hasWarnedAboutTestDeviceID) {
console.warn('The `testDeviceID` prop of PublisherBanner is deprecated. Test device IDs are now set globally. Use AdMob.setTestDeviceID instead.');
_hasWarnedAboutTestDeviceID = true;
}
return (<View style={this.props.style}>
<ExpoBannerView style={this.state.style} adUnitID={this.props.adUnitID} bannerSize={this.props.bannerSize} testDeviceID={this.props.testDeviceID} onSizeChange={this._handleSizeChange} additionalRequestParams={additionalRequestParams} onAdViewDidReceiveAd={this.props.onAdViewDidReceiveAd} onDidFailToReceiveAdWithError={this._handleDidFailToReceiveAdWithError} onAdViewWillPresentScreen={this.props.onAdViewWillPresentScreen} onAdViewWillDismissScreen={this.props.onAdViewWillDismissScreen} onAdViewDidDismissScreen={this.props.onAdViewDidDismissScreen} onAdViewWillLeaveApplication={this.props.onAdViewWillLeaveApplication} onAdmobDispatchAppEvent={this.props.onAdMobDispatchAppEvent}/>
<ExpoBannerView style={this.state.style} adUnitID={this.props.adUnitID} bannerSize={this.props.bannerSize} onSizeChange={this._handleSizeChange} additionalRequestParams={additionalRequestParams} onAdViewDidReceiveAd={this.props.onAdViewDidReceiveAd} onDidFailToReceiveAdWithError={this._handleDidFailToReceiveAdWithError} onAdViewWillPresentScreen={this.props.onAdViewWillPresentScreen} onAdViewWillDismissScreen={this.props.onAdViewWillDismissScreen} onAdViewDidDismissScreen={this.props.onAdViewDidDismissScreen} onAdViewWillLeaveApplication={this.props.onAdViewWillLeaveApplication} onAdmobDispatchAppEvent={this.props.onAdMobDispatchAppEvent}/>
</View>);

@@ -39,3 +46,2 @@ }

adUnitID: PropTypes.string,
testDeviceID: PropTypes.string,
servePersonalizedAds: PropTypes.bool,

@@ -42,0 +48,0 @@ onAdViewDidReceiveAd: PropTypes.func,

{
"name": "expo-ads-admob",
"version": "7.0.0",
"version": "8.0.0",
"description": "Provides support for the Google AdMob SDK (https://www.google.com/admob/) for mobile advertising. This module is largely based of the react-native-admob (https://github.com/sbugert/react-native-admob) module, as the documentation and questions surrounding that module may prove helpful. A simple example implementing AdMob SDK can be found at https://github.com/deadcoder0904/expo-google-admob",

@@ -35,3 +35,3 @@ "main": "build/index.js",

"jest": {
"preset": "expo-module-scripts"
"preset": "expo-module-scripts/ios"
},

@@ -47,3 +47,3 @@ "unimodulePeerDependencies": {

},
"gitHead": "4e13b3cb88d9205f14bee7764038ab2dd9ef1fbd"
"gitHead": "ec7878b9ce54f2537721218ae0fe4017e4004806"
}

@@ -21,3 +21,3 @@ # expo-ads-admob

```
npm install expo-ads-admob
expo install expo-ads-admob
```

@@ -24,0 +24,0 @@

import { EventEmitter, Subscription, UnavailabilityError } from '@unimodules/core';
import AdMobNativeModule from './ExpoAdsAdMobInterstitialManager';
import { setTestDeviceIDAsync } from './AdMob';

@@ -41,7 +42,6 @@ const moduleName = 'AdMobInterstitial';

async setTestDeviceID(id: string): Promise<void> {
if (!AdMobNativeModule.setTestDeviceID) {
throw new UnavailabilityError(moduleName, 'setTestDeviceID');
}
await AdMobNativeModule.setTestDeviceID(id);
console.warn(
'AdMobInterstitial.setTestDeviceID is deprecated. Test device IDs are now set globally. Use AdMob.setTestDeviceIDAsync instead.'
);
await setTestDeviceIDAsync(id);
},

@@ -48,0 +48,0 @@ async requestAdAsync(

import { EventEmitter, Subscription, UnavailabilityError } from '@unimodules/core';
import AdMobNativeModule from './ExpoAdsAdMobRewardedVideoAdManager';
import { setTestDeviceIDAsync } from './AdMob';

@@ -45,7 +46,6 @@ const moduleName = 'AdMobRewarded';

async setTestDeviceID(id: string): Promise<void> {
if (!AdMobNativeModule.setTestDeviceID) {
throw new UnavailabilityError(moduleName, 'setTestDeviceID');
}
await AdMobNativeModule.setTestDeviceID(id);
console.warn(
'AdMobRewarded.setTestDeviceID is deprecated. Test device IDs are now set globally. Use AdMob.setTestDeviceIDAsync instead.'
);
await setTestDeviceIDAsync(id);
},

@@ -52,0 +52,0 @@ async requestAdAsync(

@@ -5,1 +5,2 @@ export { default as AdMobBanner } from './AdMobBanner';

export { default as PublisherBanner } from './PublisherBanner';
export * from './AdMob';

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc