firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.71k stars 3.97k forks source link

interstitial ads does not play the video and counter does not work - Intermediately #2149

Closed kavehmb closed 3 years ago

kavehmb commented 4 years ago

I have interstitial ads and sometimes the timer does not decrease and nothing except the OPEN button works on the screen! User is stuck until the app is killed or switched to background. I don't see any error in the logs and I'm using the latest version. firebase_admob: 0.9.1+3

lvlrSajjad commented 4 years ago

I have this problem too

This is how I show interstitial ads in my app

    String interstitialAdUnitIdsString =
        await _repository.getPMXInterstitialAdUnitId();
    Map<String, dynamic> interstitialAdUnitIdObject =
        jsonDecode(interstitialAdUnitIdsString);

    String interstitialAdUnitId;

    if (Platform.isAndroid) {
      interstitialAdUnitId = interstitialAdUnitIdObject['android'];
    } else if (Platform.isIOS) {
      interstitialAdUnitId = interstitialAdUnitIdObject['ios'];
    }
    String device_id = await DeviceId.getID;

    String md5DeviceId = generateMd5(device_id);

    MobileAdTargetingInfo targetingInfo;

    if (kReleaseMode) {
      // is Release Mode ??
      targetingInfo = new MobileAdTargetingInfo();
    } else {
      targetingInfo = new MobileAdTargetingInfo(testDevices: [md5DeviceId]);
    }

    myInterstitial = InterstitialAd(
      adUnitId: interstitialAdUnitId,
      targetingInfo: targetingInfo,
      listener: (MobileAdEvent mobileAdEvent) {
        if(mobileAdEvent == MobileAdEvent.closed) {
          SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
          myInterstitial.dispose();
        }
        if(mobileAdEvent == MobileAdEvent.loaded) {
          SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]);
        }
      }
    );
iapicca commented 4 years ago

Hi @kavehmb can you please provide your flutter doctor -v , your flutter run --verbose and your pubspec.yaml Thank you

possibly related to https://github.com/FirebaseExtended/flutterfire/issues/63

kavehmb commented 4 years ago

flutter doctor -v [✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.3 19D76, locale en-US) • Flutter version 1.12.13+hotfix.8 at /usr/local/Caskroom/flutter/1.7.8+hotfix.3/flutter • Framework revision 0b8abb4724 (4 weeks ago), 2020-02-11 11:44:36 -0800 • Engine revision e1e6ced81d • Dart version 2.7.0

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at /Users/kavehmb/Library/Android/sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 29.0.2 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.3.1, Build version 11C504 • CocoaPods version 1.8.4

[✓] Android Studio (version 3.6) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 44.0.2 • Dart plugin version 192.7761 • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

kavehmb commented 4 years ago
dependencies:
  flutter:
    sdk: flutter
  inject:
    path: ./injection/inject.dart/package/inject
  apple_sign_in: 0.1.0
  audioplayers: 0.14.0
  cached_network_image: 2.0.0
  carousel_slider: 1.4.1
  cloud_firestore: 0.13.4
  cloud_functions: 0.4.1+8
  connectivity: 0.4.6+2
  country_pickers: 1.1.0
  cupertino_icons: 0.1.2
  device_id: 0.2.0
  device_info: 0.4.1+4
  firebase_ml_vision: 0.9.3+8
  firebase_admob: 0.9.1
  firebase_analytics: 5.0.11
  firebase_auth: 0.15.4
  firebase_core: 0.4.4
  firebase_crashlytics: 0.1.3
  firebase_messaging: 6.0.9
  firebase_performance: 0.3.1+5
  firebase_remote_config: 0.3.0+1
  firebase_storage: 3.1.1
  flare_flutter: 2.0.1
  flash: 1.2.0
  flutter_cache_manager: 1.1.3
  flutter_facebook_login: 3.0.0
#  flutter_ip: 0.2.0
  flutter_native_splash: 0.1.9
  flutter_range_slider: 1.4.0
  flutter_secure_storage: 3.3.1+1
  flutter_slidable: 0.5.4
  flutter_svg: 0.15.0
  font_awesome_flutter: 8.7.0
  geocoder: 0.2.1
  geohash: 0.2.1
  geolocator: 5.2.0
  google_sign_in: 4.1.0
  googleapis: 0.54.0
  http: 0.12.0+4
  image_cropper: 1.2.1
  image_downloader: 0.19.1
  image_picker: 0.6.3+4
  intl: 0.16.0
  json_serializable: 3.1.0
  local_auth: 0.6.1
  location: 2.3.5
  location_permissions: 2.0.4+1
  material_design_icons_flutter: 3.4.4995
  package_info: 0.4.0+14
  path: 1.6.4
  path_provider: 1.5.1
  permission_handler: 4.2.0+hotfix.3
  photo_view: 0.9.1
  reorderables: 0.2.12
  rxdart: 0.23.1
  sembast: 2.2.0
  share: 0.6.3+6
  shared_preferences: 0.5.6
  store_redirect: 1.0.2
  transparent_image: 1.0.0
  url_launcher: 5.2.7
  vibration: 1.2.2
  smooth_page_indicator: 0.1.4
  flutter_app_badger: 1.1.2
#  algolia: 0.1.7
#  clipboard_manager: ^0.0.4
#  flutter_google_places: 0.2.3
#  flutter_twitter_login: 1.1.0
#  geoflutterfire: 2.0.3+8
#  toast: 0.1.5
#  video_player: 0.10.5

dev_dependencies:
  flutter_test:
    sdk: flutter
  build_runner: 1.7.4
  inject_generator:
    path: ./injection/inject.dart/package/inject_generator
kavehmb commented 4 years ago

admoblog.txt

kavehmb commented 4 years ago

Simulator Screen Shot - iPhone 11 Pro Max - 2020-03-09 at 11 08 59

duge86 commented 4 years ago

I have this problem too. Also sometimes the close button doesn't close the ads.

dasebasto commented 4 years ago

Does this happen with test ads AND real ads ?

This is extremely worrying. (as is the #669 bug impacting banners).

The apparent lack of attention from Google on these AdMob issues reinforces the impression that the Flutter + AdMob combination is still a risky bet for apps mostly relying on ads for monetization.

russellwheatley commented 3 years ago

The firebase_admob plugin will be deprecated in April 2021 in favor of Google Mobile Ads SDK for Flutter. Google Mobile Ads SDK for Flutter is a new Flutter plugin that supports more Ads formats than firebase_admob does. Google Mobile Ads SDK for Flutter currently supports loading and displaying banner, interstitial (full-screen), native ads, and rewarded video ads across AdMob and AdManager. It also supports displaying banner and native ads as Widgets as opposed to being overlayed over all app content. We're now recommending projects currently using firebase_admob migrate to Google Mobile Ads SDK for Flutter following the instructions outlined here. Issues with migrating or with using the new package should now be raised over on the Google Mobile Ads SDK for Flutter repository.