vegidio / flutter-appodeal

A Flutter plugin to display ads from Appodeal; it supports consent dialog to track users.
https://pub.dev/packages/appodeal_flutter
MIT License
31 stars 19 forks source link

Android Banner in Production disappears after 3-5 seconds #2

Open AndyVavrynets opened 4 years ago

AndyVavrynets commented 4 years ago

Hello @vegidio , thank you for you work. It's really great. But I have small issue - on Android when using not test mode (in released app) Android don't want display a banner ad. It seems that BannerAd loads successfully (callback onBannerLoaded is triggered), then shows in view but after 3-5 sec it disappears.

I contacted Appodeal SDK team - they said it can be problem that some view overlaps it. But in my app BannerAd is at the bottom of the screen and doesn't overlap with any widget.

I tested with Example provider in your repository - same behaviour.

vegidio commented 4 years ago

Thanks for the report.

I didn't manage to recreate this bug exactly in the same scenario that you described, but I found a similar bug that might be related to the problem that you are facing now. When I have an app with 2 screens showing banner ads, the banner on the first screen disappears as soon as I present the banner on the second screen. 😟

I will spend some time investigating this further and I will also contact the Appodeal team to see if they can help us with this.

vegidio commented 4 years ago

@AndyVavrynets I finally recreated the issue that you reported, so thanks again for finding it.

However I must be honest with you: I have no idea how to fix this yet πŸ™ - According to the response that I got from Appodeal's support team, everything should just work if I call the function Appodeal.show(Appodeal.BANNER) on Android, but this didn't seem to fix the bug.

I will look at this bug again over the weekend, but I just want to set the expectations that it might take a while to fix this. So any further help from you or anybody else reading this issue is appreciated πŸ™‚

AndyVavrynets commented 4 years ago

Thank you for you feedback.

I'll try to look on it over coming weekend too.

mafila commented 4 years ago

Hello. This fix in banner.dart helped me with this problem on Android:

import 'dart:io';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';

class AppodealBanner extends StatelessWidget {
  static const MethodChannel _channel = const MethodChannel('appodeal_flutter');
  Widget build(BuildContext context) {
    return AndroidView(
      viewType: 'plugins.io.vinicius.appodeal/banner',
      creationParams: {},
      creationParamsCodec: const StandardMessageCodec(),
      onPlatformViewCreated: (id) {
        print('AppodealBanner.onPlatformViewCreated id=$id');
        _channel.invokeMethod('show', { 'adType': 1 });
      }
    );
  }
}
vegidio commented 4 years ago

ΠŸΡ€ΠΈΠ²Π΅Ρ‚, @mafila :)

Thanks, I will test your code today and hopefully that will fix this bug. If you prefer to open a PR instead, you could appear in the list of contributors of this package after that's merged.

mafila commented 4 years ago

@vegidio thanks for the great job on this package! I've done more tests - my fix is not really works. But in some incomprehensible way it makes the banner in release work better. I'll continue to research this issue.

merthankavak commented 4 years ago

@mafila Did you find anything

oliverbytes commented 3 years ago

same issue for me here! hope someone can fix it soon

ashkryab-fl commented 3 years ago

same issue for me((