react-native-firebase icon indicating copy to clipboard operation
react-native-firebase copied to clipboard

AdMob Rewarded Video(Even Test Video) not loaded on iOS

Open tusharmutreja opened this issue 7 years ago • 9 comments

Hey Everyone,

I am trying to Show rewarded video in IOS, But Every time I load the video I got the error Code: '"admob/error-code-no-fill"'. Even not able to Load test Video.

` import firebase from 'react-native-firebase'; import { EventRegister } from 'react-native-event-listeners'; import * as Constant from './../Common/Constant';

const advert = firebase.admob().rewarded(Constant.AddMob_UnitID); const AdRequest = firebase.admob.AdRequest; const request = new AdRequest(); export default class Admob {

static inititalizeAdd(){
    firebase.admob().initialize(Constant.AddMob_AppID);
}

static loadAdd() {
    advert.loadAd(request.build());
}

static loadListeners() {
    advert.on('onRewarded', (event) => {
        EventRegister.emit(Constant.EventTypes.Rewarded, Constant.EventTypes.Rewarded);
        advert.loadAd(request.build());
    });
    advert.on('onAdClosed', () => {
        advert.loadAd(request.build());
    });
    advert.on('onAdLoaded', (event) => {
        // advert.show();
    });
    advert.on('onAdFailedToLoad', (error) => {
     console.log(error);
      });
}

static showAdd() {
    if(advert.isLoaded()){
     advert.show();
    }else{
        console.log('not loaded')
    } 
}

}`

and AppDelegate File Looks Like:

`- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [FIRApp configure]; [RNFirebaseNotifications configure]; [GADMobileAds configureWithApplicationID:@"ca-app-pub-9508394659859044~6040384343"];

[[RCTI18nUtil sharedInstance] allowRTL:YES]; NSURL *jsCodeLocation; [Fabric with:@[[Crashlytics class]]];

jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];

RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation moduleName:@"Playsive" initialProperties:nil launchOptions:launchOptions]; //[RCTSplashScreen open:rootView]; [RCTSplashScreen open:rootView withImageNamed:@"splash"]; // activate splashscreen, imagename from LaunchScreen.xib

rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; UIViewController *rootViewController = [UIViewController new]; rootViewController.view = rootView; self.window.rootViewController = rootViewController; [self.window makeKeyAndVisible];

[[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];

return YES; }`

Any suggestion Y i am not able to load Video...?

tusharmutreja avatar Dec 10 '18 14:12 tusharmutreja

error-code-no-fill shows when the ad request was successful, but no ad was returned due to lack of ad inventory. Check out this, https://rnfirebase.io/docs/v5.x.x/admob/error-handling

hazeeb avatar Dec 12 '18 06:12 hazeeb

@hazeeb thanks, I already saw that, so It means my admob integration is fine ? there is issue with test ID?

tusharmutreja avatar Dec 14 '18 10:12 tusharmutreja

I tried using Interstitial instead of Rewarded and got the same error ... admob running out of ads doesn't seem convincing to me

sonlexqt avatar Dec 14 '18 11:12 sonlexqt

@sonlexqt any update?

tusharmutreja avatar Dec 18 '18 11:12 tusharmutreja

@tusharmutreja no luck so far ...

sonlexqt avatar Dec 19 '18 11:12 sonlexqt

Have you try addTestDevice(<your device id>) ?

Chenjh1992 avatar Jan 02 '19 23:01 Chenjh1992

@Chenjh1992 yes I tried with test Id and for simulator it automatically takes it

tusharmutreja avatar Jan 03 '19 06:01 tusharmutreja

Hello 👋, this issue has been automatically marked as stale because it has not had activity for quite some time. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 31 '19 07:01 stale[bot]

Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.

stale[bot] avatar Feb 14 '19 07:02 stale[bot]