Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

App open Ad error #20

Closed
andkom opened this issue Aug 30, 2021 · 5 comments
Closed

App open Ad error #20

andkom opened this issue Aug 30, 2021 · 5 comments

Comments

@andkom
Copy link

andkom commented Aug 30, 2021

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 (
     ....
  );
};

@wjaykim
Copy link
Collaborator

wjaykim commented Aug 31, 2021

Can you try find solution here? I think this issue is not related to this library.

@andkom
Copy link
Author

andkom commented Aug 31, 2021

@wjaykim ok, thanks

@andkom andkom closed this as completed Aug 31, 2021
@bilarslan
Copy link

Hello @andkom, found any solution?

@andkom
Copy link
Author

andkom commented Oct 18, 2021

@bilarslan not yet

@bilarslan
Copy link

Hello @andkom
It looks like I solved the problem. I saved my devices as test devices under admob dashboard from Settings > Test Devices. And I used my own admob unit ids, not the test ids so it solved 🎉🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants