Code Monkey home page Code Monkey logo

admob's Introduction

admob's People

Contributors

ahmetbicer avatar erubio avatar ifsnow avatar magrinj avatar manuhook avatar wjaykim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

admob's Issues

App crush

I just start using this lib after I installed it and follow the documentation after running on android the application crash each time I tried to run it.

Anyone using this on production?

As title. Would like to see is it production ready.
And to the author @wjaykim will you consider enabling the "Sponsor" button or link to issuehunt or anything similar so someone like me who couldn't contribute on coding could help a little bit.

How can I detect the Interstitial Ad is dismissed cause of the user's abusing?

Reproduction: Interstitial Ad is shown > Go background (Home) > Tap App Icon > Interstitial Ad is dismissed (While showing)

Can it be possible to detect user's behavior that goes to background while ad is showing and then execute app by touching the App's icon for dismissing Interstitial ad immediately?

I used AppState of react native but in Android, the state is going to 'background' with Ad's showing and back to 'active' with Ad's dismissing so I couldn't detect user's additional/manual behavior to go out and in to App during the Ad is showing.

Thoughts about architecture

Hey, thanks for your efforts

Just want to reveal some thoughts about your logical decisions.

Moving all logic into hooks significantly reduces the developer's ability to manage ads in their application. For example I would want to start load interstitial on start and show it inside few different screens depending of what user would open, so I would move adv logic in my app to redux-sagas (for example) and dispatch "show actions" when I need, check if enough time has gone since previous interstitial and etc
So you literally overcoded. It would be better to just have ability to load / show / listen events ( loaded, error, etc). And leave the ability to developers make their own hooks

message:"No ad config", "code:3"

Description

Expected behavior

I expected to see a Banner Ad from admob

Actual behavior & steps to reproduce

instead i got an error saying no ad config, code:3

Snack or minimal code example

import React from 'react'
import { View, Text,Image, TouchableOpacity } from 'react-native'
import styles from './styles'
import { useNavigation } from '@react-navigation/native'
import { PAYMENT_PAGE } from '../../constants/routeNames'
import Icon from '../common/Icon'
import { BannerAd,TestIds,BannerAdSize} from '@react-native-admob/admob';

const CheckCoinComponent = ({coinamount,isPremium,showAds,name,daysLeft}) => {
const {navigate} = useNavigation()
//console.log(isPremium)
return (




<BannerAd
size={BannerAdSize.ADAPTIVE_BANNER}
unitId={"ca-app-pub-7467526896400501/3262508535"}
onAdFailedToLoad={(error) => console.error(error)}
requestOptions={{
requestNonPersonalizedAdsOnly: true,
}}
/>

Package versions

  • React Native: 0.64.2
  • React Native AdMob:1.2.0
  • Google Mobile Ads SDK(if specified):20.4.0
  • Xcode:
  • Java & Gradle:
    Android gradle plugin: 4.2.2
    gradle plugin version: 6.8.3

Affected platforms

Android

Release JavaScript version to npm?

Currently the npm package contains only typescript, which leads to errors like this.

Metro has encountered an error: While trying to resolve module `@react-native-admob/admob` from file `/XXXXX/src/components/adsBanner.tsx`, the package `/XXXXX/node_modules/@react-native-admob/admob/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/XXXXX/node_modules/@react-native-admob/admob/src/index.js`. Indeed, none of these files exist:

  * /XXXXX/node_modules/@react-native-admob/admob/src/index.js(.native|.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.svg|.native.svg|.svg)
  * /XXXXX/node_modules/@react-native-admob/admob/src/index.js/index(.native|.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.svg|.native.svg|.svg): /XXXXX/app/node_modules/metro/src/node-haste/DependencyGraph.js (376:17)

Please make sure to package your complied JavaScript & TypeScript types in npm. Here's a tutorial that you might find useful: https://cameronnokes.com/blog/the-30-second-guide-to-publishing-a-typescript-package-to-npm/

Can we use this in production?

is anyone using this in production?
i tried in production with Real UnitID and its giving error in AD LOAD FAILED. but error is also not specified.
my app is still not in playstore

Conflict with newer RNFB SDK version

I am having a conflict when updating my pods with react-native-firebase version "12.6.1"
The error I get is:

CocoaPods could not find compatible versions for pod "GoogleAppMeasurement":
  In Podfile:
    Google-Mobile-Ads-SDK (~> 8.0.0) was resolved to 8.0.0, which depends on
      GoogleAppMeasurement (~> 7.0)

    RNFBAnalytics (from `../node_modules/@react-native-firebase/analytics`) was resolved to 12.6.1, which depends on
      Firebase/Analytics (= 8.5.0) was resolved to 8.5.0, which depends on
        Firebase/Core (= 8.5.0) was resolved to 8.5.0, which depends on
          FirebaseAnalytics (~> 8.5.0) was resolved to 8.5.0, which depends on
            FirebaseAnalytics/AdIdSupport (= 8.5.0) was resolved to 8.5.0, which depends on
              GoogleAppMeasurement (= 8.5.0)

Can this be fixed?

Thank you for creating and maintaining this package much love ๐Ÿ™๐Ÿผ
Would be helpful too to include a change log for the new releases.

Could not build

I've got this issue when trying to build from xcode(@react-native-admob/admob v1.0.3)

Screen Shot 2021-08-18 at 4 04 33 pm

App open Ad error

sometimes i get error:

{"code": 3, "message": "No ad config."}

code:

import {useEffect, useState} from 'react';
import AdMob, {useAppOpenAd} from '@react-native-admob/admob';

const useOpenAppAd = (unitId: string) => {
  const [initialized, setInitialized] = useState(false);

  useAppOpenAd(
    initialized ? unitId : null,
    {
      showOnColdStart: true,
      showOnAppForeground: true,
    },
  );

  useEffect(() => {
    (async () => {
      await AdMob.initialize();
      setInitialized(true);
    })();
  });
};

export default useOpenAppAd;

App.ts:

const App = () => {
  useOpenAppAd('ca-app-pub-....');

  return (
     ....
  );
};

How to handle airplane mode / no internet available?

Does anyone have a way to handle airplane mode or no connection available when using this library. Right now for example, my hook line is giving me unhandled promise rejection -> Error while connecting to ad server, when I cant connect to the internet and try to load this line: const { adLoadError, adLoaded, show, load, reward, adPresented, adDismissed } = useRewardedAd(TestIds.REWARDED );

I am not well versed with hooks and I'm not really sure how to go about resolving this or if I should take a different approach? Thanks.

App laggy

When AD loads the app is very choppy for some moment.
i have already initialised the AdMob.initialize() at app launch.

When using hooks adding parameters causes infinite rendering loop

I am using v1.2.1 and get the same response on IOS and Android. When using hooks like useRewardedAd, if I include parameters (doesnt seem to matter which ones, though my goal was to use requestNonPersonalizedAdsOnly) then the app goes into an infinite rendering loop. Below is an example setting almost all of the parameters, but I also just tried the requestNonPersonalizedAdsOnly one and got the same result.
const op = { loadOnMounted: true, showOnLoaded: false, loadOnDismissed:true, requestOptions: { requestNonPersonalizedAdsOnly: true}}; const { adLoadError, adLoaded, show, load, reward, adPresented, adDismissed } = useRewardedAd(TestIds.REWARDED, op);

Or this code:
const requestOptions = { requestNonPersonalizedAdsOnly: true, }; const { adLoadError, adLoaded, show, load, reward, adPresented, adDismissed } = useRewardedAd(TestIds.REWARDED, requestOptions);
image

AppOpenAd and frequency cap issue

If I set frequency cap per Ad I will get Unhandled Promise Rejection after Ad has been shown:

Possible Unhandled Promise Rejection (id: 0):
Error: Frequency cap reached. <https://support.google.com/admob/answer/9905175#6>

and Ad won't show in the future until I reload app.

As I understand, admob tries to load new Ad but fails. How to deal in such case?

useAppOpenAd blocks splash screen

When I exit app, it will still remain in task manager. If I reopen app again, Ad will never present, so adDismissed, adLoadError never change and splash screen never hides. If I force remove app from task manager before reopening again, everything works OK. Same behavior for showOnAppForeground: true.

The issue can be reproduced in the example app too.

adDismissed, reward never change their values

Description

adDismissed always false, and reward always undefined

Expected those values to change

const {adLoaded, adDismissed, reward, adShowing, show} = useRewardedAd(
    TestIds.REWARDED,
    {
      requestOptions: {
        requestNonPersonalizedAdsOnly: true,
      },
    },
  );
  useEffect(() => {
    console.log('rewardrewardrewardrewardss', adDismissed, nameToShow);
    if (adDismissed) {
        /// do something
    }
  }, [adDismissed]);


  • React Native: 0.66.0
  • React Native AdMob: 1.1.0

app stop responding when loadOnDismissed: true

When useRewardedAd or useInterstitialAd are used with parameter loadOnDismissed: true,
the app becomes laggy after closing ads and any touchable element won't respond in time.

package version : 1.0.10
react version : 16.13.1
react-native version : 0.63.4

Event adDismissed not getting fired, after closing ad

Description

Expected behavior: Event adDismissed should be triggered when an ad gets closed or dismissed

Actual behavior & steps to reproduce

Nothing happen. Not getting notified after closing an ad

Snack or minimal code example

    this.advert = InterstitialAd.createAd(admob_interstitial_id);
    this.advert.load();
    this.advert.addEventListener('adLoaded', () => {
        this.adLoaded = true;
        console.warn('Advert ready to show.');
    });
    this.advert.addEventListener('adDismissed', () => {
        Cache.setItem('viewedProfiles', 0);
        // this.closeChat();
    });
    this.advert.addEventListener('adFailedToLoad', error => {
        this.adFailedToLoad = true;
        console.warn('Advert failed to load.', error);
    });

Package versions

  • React Native: 0.66.1
  • React Native AdMob: 1.1.2
  • Google Mobile Ads SDK(if specified):
  • Xcode: 13
  • Java & Gradle: Gradle 6.9

Affected platforms

  • [x ] Android
  • [x ] iOS

Include test ids

please include ad test ids in the library:

export const TestIds = {
  APP_OPEN: 'ca-app-pub-3940256099942544/3419835294',
  BANNER: 'ca-app-pub-3940256099942544/6300978111',
  INTERSTITIAL: 'ca-app-pub-3940256099942544/1033173712',
  INTERSTITIAL_VIDEO: 'ca-app-pub-3940256099942544/8691691433',
  REWARDED: 'ca-app-pub-3940256099942544/5224354917',
  REWARDED_INTERSTITIAL:  'ca-app-pub-3940256099942544/5354046379',
  NATIVE_ADVANCED: 'ca-app-pub-3940256099942544/2247696110',
  NATIVE_ADVANCED_VIDEO: 'ca-app-pub-3940256099942544/1044960115',
}

(ERROR) No ad to show

Hi,

Anyone can help me, pls ?

I am using this library to show ads on my app. BannerAd and InterstitialAd works fine, but RewardedAd and RewardedInterstitialAd don't work for me.

I receive this error and I don't know what to do:

{
	"code": "E_AD_LOAD_FAILED",
	"domain": "com.google.admob",
	"message": "Request Error: No ad to show.",
	"nativeStackIOS": [
"0   Veek                                0x0000000102abc9f7 RCTJSErrorFromCodeMessageAndNSError + 135", 
"1   Veek                                0x000000010281e8fc __69-[RNAdMobRewarded requestAd:unitId:requestOptions:resolver:rejecter:]_block_invoke + 252", 
"2   Veek                                0x0000000102ff85b4 GAD_GADRewardedAd_x86_64_8_9_0 + 921", 
"3   Veek                                0x0000000102f67231 GAD_GADFullScreenAd_x86_64_8_9_0 + 1553", 
"4   libdispatch.dylib                   0x00000001178fe578 _dispatch_call_block_and_release + 12", 
"5   libdispatch.dylib                   0x00000001178ff74e _dispatch_client_callout + 8", 
"6   libdispatch.dylib                   0x000000011790db3f _dispatch_main_queue_callback_4CF + 1152", 
"7   CoreFoundation                      0x0000000114b168f8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ +9",
"8   CoreFoundation                      0x0000000114b11169 __CFRunLoopRun + 2781",
"9   CoreFoundation                      0x0000000114b101a7 CFRunLoopRunSpecific + 567",
"10  GraphicsServices                    0x000000011913fd85 GSEventRunModal + 139",
"11  UIKitCore                           0x000000012408a4df -[UIApplication _run] + 912",
"12  UIKitCore                           0x000000012408f39c UIApplicationMain + 101",
"13  Veek                                0x000000010201e920 main + 112",
"14  libdyld.dylib                       0x000000011798dbbd start + 1",
"15  ???                                 0x0000000000000003 0x0 + 3"
],
	"userInfo": {
		"NSLocalizedDescription": "Request Error: No ad to show.",
		"gad_response_info": null
	}
}

On the same screen I display the banner without any problems, but the RewardedAd gives an error.

Screen Shot 2021-08-20 at 17 11 13

Snippet of my code:

import React from 'react';
import {RewardedAd} from '@react-native-admob/admob';

import {AdBanner} from '@~/components/atoms/AdBanner';
import * as Layout from '@~/components/organisms/layout';
import {Minimal} from '@~/components/templates/minimal';

export const CheckIn = ({navigation}: CheckInProps) => {
  const rewardId = Platform.OS === 'android'
     ? 'ca-app-pub-XXXXXXXXXXXXXXX/XXXXXXXX'
     : 'ca-app-pub-XXXXXXXXXXXXXXX/XXXXXXXX';

  const AdReward = RewardedAd.createAd(rewardId, {requestNonPersonalizedAdsOnly: false});

  useEffect(() => {
    AdReward.load();

    AdReward.addEventListener('adLoaded', (value: any) =>
      console.info('AD LOADED:   ', value),
    );

    AdReward.addEventListener('adFailedToLoad', (value: any) =>
      console.error('ERROR ON AD LOAD:  ', value),
    );

  }, [AdReward]);

  return (
    <Minimal
      theme="dark">
      <View style={styles.banner}>
        <AdBanner
          iosId="ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxxxx"
          androidId="ca-app-pub-xxxxxxxxxxxxxx/xxxxxxxxxxx"
        />
        <Layout.Padding>
          <Button
            transparent
            dark
            full
            onPress={() => {
              console.info('SHOW ADREWARDED');
              AdReward.show();
            }}>
            <Text>Fazer checkin</Text>
          </Button>
        </Layout.Padding>
      </View>
    </Minimal>
  );
};

I'm creating hook initialize() and running within App.js

My hook initialize:

const config = {
  maxAdContentRating: 'G',
  tagForChildDirectedTreatment: false,
  tagForUnderAgeConsent: false,
};

export const initAdMob = async (callback?: () => void | undefined) => {
  await AdMob.initialize()
    .then(value => {
      AdMob.setRequestConfiguration(config);
      console.info(value);
    })
    .catch(e => console.error(e));

  if (callback) {
    return callback();
  }
};

My execution:

export const App = () => {
  const [loading, setLoading] = useState(true);

  useEffect(() => {
    initAdMob(() => setLoading(false));

  }, [loading]);

...

Issues when use with react-native-admob-native-ads

                     // unknow reason when install your package in my project cause function below not finish
                     
		 await AdManager.setRequestConfiguration({ // method from react-native-admob-native-ads
			trackingAuthorized,
			maxAdContentRating: 'G',
			tagForChildDirectedTreatment: false,
			tagForUnderAgeConsent: false,
		});

Cannot read property 'requestAd' of null

I want to show an interstitial add, but i'm always getting Cannot read property 'requestAd' of null.

The only thing I'm doing is this

const interstitialAd = useInterstitialAd(
    "ca-app-pub-3940256099942544/1033173712",
    {}
  );

I'm sorry if this is a dumb question. Can someone give me an example or something.

Project setting issue (camel case)

Hello,

I try to install your librairie but I found an error during the "pod install" part, I saw this line :
Installing RNAdMob (0.1.6)

But after when I launch "run-ios", I saw that,
error Could not find the following native modules: RNAdmob. Did you forget to run "pod install" ?

The difference between the two is just the "M" in upper or lower case

Error: Cannot find an ad network adapter with the name(s): com.google.DummyAdapter.

Description

I am getting this error on iOS 15 while trying the minimal setup for interstitial ad with hooks

Error: Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target.

Expected behavior

The ad should show up in the latest version of react native on iOS

Actual behavior & steps to reproduce

It is throwing error while trying to load the error

    if (adLoaded) {
      show();
    } else {
      load();
    }

Snack or minimal code example

  const {load, adLoaded, show} = useInterstitialAd(TestIds.INTERSTITIAL_VIDEO);

Package versions

  • React Native: 0.66.1
  • React Native AdMob: ^1.2.1
  • Google Mobile Ads SDK(if specified):
  • Xcode: 13.1
  • Java & Gradle: Gradle 4.2.2

Affected platforms

  • Android
  • iOS

useAppOpenAd still shows after disabling it

I have paid option to disable ads:

useAppOpenAd(initialized && !disableAds ? unitId : null, {
  showOnColdStart: false,
  showOnAppForeground: true,
});

but after an user purchases ads removal, app open ad still shows on app foreground

The provided view controller is not being presented

Description

The provided view controller is not being presented while trying to load the ad on iOS
Continuing from #48

Snack or minimal code example

Just the example from docs

Package versions

  • React Native: 0.66.1
  • React Native AdMob: ^1.2.1
  • Google Mobile Ads SDK(if specified):
  • Xcode: 13.1
  • Java & Gradle: Gradle 4.2.2

Affected platforms

  • Android
  • iOS

Metro Bundler failed

Hello
Thank you for wonderful AdMob plugin.
after updating to latest version 1.0.1 it causing bundler error.

Screenshot 2021-08-16 at 6 53 41 PM

app crashes on start

After installing this library my app crashes on start up. Please suggest some solution.

Also provide solution to use this library and react-native-admob-native-ads library together.

Build fails after updating to 1.3.0

Description

After updating to version 1.3.0 from 1.2.1 I can't run app. Build fails with error:

`Execution failed for task ':app:checkDebugAarMetadata'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not resolve androidx.work:work-runtime:{strictly 2.6.0}.
Required by:
project :app > project :react-native-admob_admob
> Cannot find a version of 'androidx.work:work-runtime' that satisfies the version constraints:
Dependency path 'mycustomappid:app:unspecified' --> 'mycustomappid:react-native-admob_admob:unspecified' --> 'androidx.work:work-runtime:{strictly 2.6.0}'
Dependency path 'mycustomappid:app:unspecified' --> 'mycustomappid:react-native-admob_admob:unspecified' --> 'com.google.android.gms:play-services-ads:20.5.0' --> 'com.google.android.gms:play-services-ads-lite:20.5.0' --> 'androidx.work:work-runtime:2.7.0'

Could not resolve androidx.work:work-runtime:2.7.0.
Required by:
project :app > project :react-native-admob_admob > com.google.android.gms:play-services-ads:20.5.0 > com.google.android.gms:play-services-ads-lite:20.5.0
> Cannot find a version of 'androidx.work:work-runtime' that satisfies the version constraints:
Dependency path 'mycustomappid:app:unspecified' --> 'mycustomappid:react-native-admob_admob:unspecified' --> 'androidx.work:work-runtime:{strictly 2.6.0}'
Dependency path 'mycustomappid:app:unspecified' --> 'mycustomappid:react-native-admob_admob:unspecified' --> 'com.google.android.gms:play-services-ads:20.5.0' --> 'com.google.android.gms:play-services-ads-lite:20.5.0' --> 'androidx.work:work-runtime:2.7.0'`

Expected behavior

App should build and open.

Actual behavior & steps to reproduce

Not building. Ends with error.

Snack or minimal code example

It's not about code.

Package versions

  • React Native: 0.66.3
  • React Native AdMob: 1.3.0
  • Google Mobile Ads SDK(if specified):
  • Xcode:
  • Java & Gradle:

Affected platforms

  • Android
  • iOS - Not checked

Android SDK 31 required?

The minCompileSdk (31) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-30).
Dependency: androidx.work:work-runtime:2.7.0.
AAR metadata file: C:\Users\corne.gradle\caches\transforms-2\files-2.1\7697b9cb5e1a55cf53fc61fd3c9a78ba\work-runtime-2.7.0\META-INF\com\android\build\gradle\aar-metadata.properties

Is there a reason androidx.work:work-runtime:2.7.0 needs to be used? Just wondering because it requires the app to move to 31 instead of 30.

AppOpenAd close warning

Sometimes I get warning when I close AppOpenAd:

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.

useAppOpenAd.ts (72:11)

>  const dismissHandler = () => {
         ^
      setAdDismissed(true);
      init();
   };

Feature request: Time interval between 2 open ads display

Can I request the feature that allow to have of requestInterval in openAd options? I don't want to show the openAd every time when the app enters foreground. The ad only presents after n seconds since its last present.

Thank you

Possibility of adding end to end tests for ads

Description

I was trying to add E2E tests with detox but it seems that it is not able to find the elements from admob (continue to app)

I am not sure if it is possible to test ads as well, I would be happy to contribute.

image

Here is the view hierarchy

Error: Test Failed: View โ€œ<UIButtonLabel: 0x7fce0556cbf0>โ€ is not visible: View is hidden or has hidden ancestor
View Hierarchy:
<UIWindowScene: 0x7fce0475adc0; scene = <FBSScene: 0x600002bccf80; identifier: sceneID:com.example.reactnativeadmobadmob-default>; persistentIdentifier = B60EA7CF-A535-4D6A-992A-F81EFBB4D608; activationState = UISceneActivationStateForegroundActive>
   + <UIWindow: 0x7fce0540b250; frame = (0 0; 390 844); layer = <UIWindowLayer: 0x600000b80270>>
   |    | <UITransitionView: 0x7fce047b7e20; frame = (0 0; 390 844); layer = <CALayer: 0x600000537280>>
   |    |    | <UIView: 0x7fce055673c0; frame = (0 0; 390 844); layer = <CALayer: 0x600000525d80>>
   |    |    |    | <GADCloseButton: 0x7fce05569dc0; frame = (320 47; 70 70); ax.label = "Close Advertisement"; layer = <CALayer: 0x6000005254a0>>
   |    |    |    |    | <UIButtonLabel: 0x7fce0556cbf0; frame = (0 0; 0 0); layer = <_UILabelLayer: 0x60000267a300>>
   |    |    |    |    | <UIImageView: 0x7fce055697d0; frame = (-15 -15; 100 100); layer = <CALayer: 0x600000525780>>
   |    |    |    | <GADWebAdView: 0x7fce05568510; frame = (0 0; 390 844); layer = <CALayer: 0x600000525e60>>
   |    |    |    |    | <WKWebView: 0x7fce04bc1c00; frame = (0 0; 390 844); layer = <CALayer: 0x6000004d9ea0>>
   |    |    |    |    |    | <GADTestLabel: 0x7fce0547a9e0; frame = (143.333 51; 103.667 34); text = "Test mode"; ax.label = "Test mode"; layer = <_UILabelLayer: 0x60000264c640>>
   |    |    |    |    |    | <WKScrollView: 0x7fce04baca00; frame = (0 0; 390 844); layer = <CALayer: 0x6000004dd740>>
   |    |    |    |    |    |    | <_UIScrollViewScrollIndicator: 0x7fce047b2880; frame = (44.3333 838; 301 3); ax.label = "Horizontal scroll bar, 1 page"; ax.value = "0%"; layer = <CALayer: 0x6000004de080>>
   |    |    |    |    |    |    |    | <UIView: 0x7fce047b2a20; frame = (0 0; 301 3); layer = <CALayer: 0x6000004de0a0>>
   |    |    |    |    |    |    | <_UIScrollViewScrollIndicator: 0x7fce047b2b90; frame = (384 44.3333; 3 754.667); ax.label = "Vertical scroll bar, 1 page"; ax.value = "0%"; layer = <CALayer: 0x6000004de0c0>>
   |    |    |    |    |    |    |    | <UIView: 0x7fce047b2d30; frame = (0 0; 3 754.667); layer = <CALayer: 0x6000004de0e0>>
   |    |    |    |    |    |    | <UIView: 0x7fce047ae690; frame = (0 0; 0 0); layer = <CALayer: 0x6000004dd480>>
   |    |    |    |    |    |    | <WKContentView: 0x7fce0663c400; frame = (0 0; 390 844); layer = <CALayer: 0x6000004d9ce0>>
   |    |    |    |    |    |    |    | <_UILayerHostView: 0x7fce05566700; frame = (0 0; 0 0); layer = <CALayerHost: 0x600000ad05a0>>
   |    |    |    |    |    |    |    | <UIView: 0x7fce047accd0; frame = (0 0; 390 844); layer = <CALayer: 0x6000004ddda0>>
   |    |    |    |    |    |    |    |    | <UIView: 0x7fce047acb60; frame = (0 0; 390 844); layer = <CALayer: 0x6000004dd980>>
   |    |    |    |    |    |    |    |    |    | <WKCompositingView: 0x7fce047b5530; frame = (0 0; 390 844); layer = <WKCompositingLayer: 0x6000004de120>>
   |    |    |    |    |    |    |    |    |    |    | <WKCompositingView: 0x7fce047add00; frame = (0 0; 390 844); layer = <WKCompositingLayer: 0x6000004dce80>>
   |    |    |    |    |    |    |    |    |    |    |    | <WKCompositingView: 0x7fce047adb90; frame = (0 0; 390 844); layer = <WKCompositingLayer: 0x6000004dcce0>>
   |    |    |    |    |    |    |    |    |    |    |    |    | <WKCompositingView: 0x7fce047b04e0; frame = (0 0; 0 0); layer = <WKCompositingLayer: 0x6000004ddea0>>
   |    |    |    |    |    |    |    |    |    |    |    |    |    | <WKCompositingView: 0x7fce047b56a0; frame = (354.588 89.6224; 18.9767 19.1202); layer = <WKCompositingLayer: 0x6000004de4e0>>
   |    |    |    |    |    |    |    |    |    |    |    |    |    | <WKCompositingView: 0x7fce0556e880; frame = (8 176.656; 374 619.328); layer = <WKCompositingLayer: 0x6000002b4fe0>>
   |    |    |    |    |    |    |    |    |    |    |    |    |    |    | <WKCompositingView: 0x7fce05480c20; frame = (0 0.140625; 374 619); layer = <WKCompositingLayer: 0x6000002a7960>>
   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    | <WKCompositingView: 0x7fce047b53c0; frame = (0 0; 0 0); layer = <WKCompositingLayer: 0x6000004dd420>>
   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    | <WKChildScrollView: 0x7fce04a5d000; frame = (0 0; 374 619); layer = <CALayer: 0x6000004ddf80>>
   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    | <_UIScrollViewScrollIndicator: 0x7fce0556f010; frame = (-39 -6; 36 3); ax.label = "Horizontal scroll bar, 1 page"; ax.value = "0%"; layer = <CALayer: 0x6000002b5280>>
   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    | <UIView: 0x7fce0556f1b0; frame = (0 0; 36 3); layer = <CALayer: 0x6000002b4f20>>
   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    | <_UIScrollViewScrollIndicator: 0x7fce0556f320; frame = (-6 -39; 3 36); ax.label = "Vertical scroll bar, 1 page"; ax.value = "0%"; layer = <CALayer: 0x6000002b52e0>>
   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    | <UIView: 0x7fce0556f8f0; frame = (0 0; 3 36); layer = <CALayer: 0x6000002b5260>>
   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    | <WKCompositingView: 0x7fce047b6790; frame = (0 0; 0 0); layer = <WKCompositingLayer: 0x6000004de4a0>>
   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    | <WKCompositingView: 0x7fce047aa220; frame = (0 0; 374 619); layer = <WKCompositingLayer: 0x6000004dcbe0>>
   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    | <WKCompositingView: 0x7fce0556e710; frame = (0 0; 374 619); layer = <WKCompositingLayer: 0x6000002b50a0>>
   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    | <WKCompositingView: 0x7fce0556b970; frame = (0 0; 0 0); layer = <WKCompositingLayer: 0x6000002b4e40>>
   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    | <WKCompositingView: 0x7fce0556b800; frame = (0 0; 0 0); layer = <WKCompositingLayer: 0x6000002b53e0>>
   |    |    |    |    |    |    |    |    |    |    |    |    | <WKCompositingView: 0x7fce047b4db0; frame = (0 0; 0 0); layer = <WKCompositingLayer: 0x6000004ddf00>>
   |    |    |    |    |    |    |    | <AXRemoteElement: 0x6000010c7300; ax.frame = (0 0; 390 844)>
   |    |    |    |    | <UIScrollView: 0x7fce0b91e400; frame = (0 0; 0 0); layer = <CALayer: 0x60000052af00>>
   |    |    |    |    |    | <_UIScrollViewScrollIndicator: 0x7fce053969e0; frame = (-6 -39; 3 36); ax.label = "Vertical scroll bar, 1 page"; ax.value = "0%"; layer = <CALayer: 0x600000517500>>
   |    |    |    |    |    |    | <UIView: 0x7fce05396b80; frame = (0 0; 3 36); layer = <CALayer: 0x600000516ec0>>
   |    |    |    |    |    | <_UIScrollViewScrollIndicator: 0x7fce05398ad0; frame = (-39 -6; 36 3); ax.label = "Horizontal scroll bar, 1 page"; ax.value = "0%"; layer = <CALayer: 0x600000516e40>>
   |    |    |    |    |    |    | <UIView: 0x7fce05396870; frame = (0 0; 36 3); layer = <CALayer: 0x6000005174e0>>
   |    | <UITransitionView: 0x7fce05519cb0; frame = (0 0; 390 844); layer = <CALayer: 0x600000593040>>
   |    |    | <UIView: 0x7fce055164f0; frame = (0 0; 390 844); layer = <CALayer: 0x6000005916a0>>
   |    |    |    | <_UILayoutGuide: 0x7fce05516dd0; frame = (0 810; 0 34); layer = <CALayer: 0x6000005915e0>>
   |    |    |    | <_UILayoutGuide: 0x7fce05516a40; frame = (0 0; 0 47); layer = <CALayer: 0x600000591720>>
   |    |    |    | <UIImageView: 0x7fce05516660; frame = (145 372; 100 100); ax.id = "BootSplashLogo"; layer = <CALayer: 0x600000591580>>
   |    | <UITransitionView: 0x7fce05411bd0; frame = (0 0; 390 844); layer = <CALayer: 0x600000599de0>>
   |    |    | <UIDropShadowView: 0x7fce04718100; frame = (0 0; 390 844); layer = <CALayer: 0x60000059d720>>
   |    |    |    | <RCTRootView: 0x7fce0550d910; frame = (0 0; 390 844); layer = <CALayer: 0x6000005eb580>>
   |    |    |    |    | <RCTRootContentView: 0x7fce05510620; frame = (0 0; 390 844); layer = <CALayer: 0x6000005eb620>>
   |    |    |    |    |    | <RCTView: 0x7fce05389420; frame = (0 0; 390 844); layer = <CALayer: 0x600000528d00>>
   |    |    |    |    |    |    | <RCTView: 0x7fce05386e50; frame = (0 0; 390 844); layer = <CALayer: 0x600000528b00>>
   |    |    |    |    |    |    |    | <RCTView: 0x7fce053847b0; frame = (0 0; 390 0); layer = <CALayer: 0x600000528a20>>
   |    | <GADMainWindowView: 0x7fce0530a340; frame = (-1 -1; 1 1); layer = <CALayer: 0x60000055a7e0>>
   |    |    | <WKWebView: 0x7fce0803e400; frame = (0 0; 100 100); layer = <CALayer: 0x6000005a5ea0>>
   |    |    |    | <WKScrollView: 0x7fce0781c600; frame = (0 0; 100 100); layer = <CALayer: 0x6000005a06e0>>
   |    |    |    |    | <_UIScrollViewScrollIndicator: 0x7fce05714df0; frame = (90 94; 7 3); ax.label = "Horizontal scroll bar, 1 page"; ax.value = "0%"; layer = <CALayer: 0x6000005a6aa0>>
   |    |    |    |    |    | <UIView: 0x7fce05713bc0; frame = (0 0; 7 3); layer = <CALayer: 0x6000005a6ae0>>
   |    |    |    |    | <_UIScrollViewScrollIndicator: 0x7fce057137b0; frame = (94 90; 3 7); ax.label = "Vertical scroll bar, 1 page"; ax.value = "0%"; layer = <CALayer: 0x6000005a6b00>>
   |    |    |    |    |    | <UIView: 0x7fce057133a0; frame = (0 0; 3 7); layer = <CALayer: 0x6000005a6b20>>
   |    |    |    |    | <UIView: 0x7fce04717890; frame = (0 0; 0 0); layer = <CALayer: 0x6000005508e0>>
   |    |    |    |    | <WKContentView: 0x7fce0803ea00; frame = (0 0; 100 100); layer = <CALayer: 0x6000005a5f00>>
   |    |    |    |    |    | <_UILayerHostView: 0x7fce04795750; frame = (0 0; 0 0); layer = <CALayerHost: 0x600000bf5260>>
   |    |    |    |    |    | <UIView: 0x7fce056113a0; frame = (0 0; 100 100); layer = <CALayer: 0x6000005a0cc0>>
   |    |    |    |    |    |    | <UIView: 0x7fce056110a0; frame = (0 0; 100 100); layer = <CALayer: 0x6000005a1c80>>
   |    |    |    |    |    |    |    | <WKCompositingView: 0x7fce047aa640; frame = (0 0; 100 100); layer = <WKCompositingLayer: 0x600000551ca0>>
   |    |    |    |    |    |    |    |    | <WKCompositingView: 0x7fce047aaa90; frame = (0 0; 100 100); layer = <WKCompositingLayer: 0x600000511420>>
   |    |    |    |    |    |    |    |    |    | <WKCompositingView: 0x7fce047aa7b0; frame = (0 0; 100 100); layer = <WKCompositingLayer: 0x600000551940>>
   |    |    |    |    |    |    |    |    |    |    | <WKCompositingView: 0x7fce047aa4d0; frame = (0 0; 0 0); layer = <WKCompositingLayer: 0x600000551b80>>
   |    |    |    |    |    |    |    |    |    |    | <WKCompositingView: 0x7fce047aad40; frame = (0 0; 0 0); layer = <WKCompositingLayer: 0x6000004dc020>>
   |    |    |    |    |    | <AXRemoteElement: 0x6000010bb440; ax.frame = (0 0; 100 100)>

Multiple sizes implementation in AdMobBanner can be improved

When you want multiple sizes in AdManager Banner you call <GAMBannerAd> and pass the sizes attribute as an array.
However, the element has a mandatory size attribute: this is incorrect according to the SDK docs, in fact you should bu able to pass either a single size or an array of sizes.

The native implementation also leads to mixed results: the module calls requestAd() after both setSize() and setSizes(), but the requestAd() method only checks for the single size attribute to be non-null, so there's a race condition, if setSize gets called before setSizes you end up with a double call, one with a single size and one with multisize.

I needed the multisize feature for an app so I quickly fixed it for my own need, but I think the whole element should be refactored a bit to let a caller set multiple or single size and only perform one requestAd() call.

@wjaykim if you didn't already plan to change this behavior let me know and I will create a more robust PR soon as I can.

App crashes on load after installing package.

Installed the package, updated the xml file, but when I launch the app with react native it crashes when it tries to launch on the phone, but doesnt give any error. The node window is running but theres no app. If I remove the package then everything works fine.

Crash when using rewarded ads on android

Description

I got a crash when using rewarded ads on android both using classes and hooks. The application exits without any error message. iOS works very well.

Expected behavior

Actual behavior & steps to reproduce

Snack or minimal code example

Package versions

  • React Native: 0.64.0
  • React Native AdMob: 1.2.1

Affected platforms

  • Android
  • iOS

[ios] onSizeChange called with incorrect arguments for banner ads

  const onSizeChange = (size) => {
    console.info(`${JSON.stringify(size)}`);
  };

  <BannerAd
    size={BannerAdSize.ADAPTIVE_BANNER}
    unitId={unitId}
    onSizeChange={onSizeChange} />

The above snippet prints

TypeError: JSON.stringify cannot serialize cyclic structures.

Both size.width & size.height are undefined.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.