GithubHelp home page GithubHelp logo

Comments (37)

genox-wang avatar genox-wang commented on August 15, 2024 3

try debugged onUserEarnedReward event

 case 'onUserEarnedReward':
      try {
        onEventController.add({
          RewardedAdEvent.earnedReward: RewardItem.fromJson(call.arguments)
        });
      } catch(e) {
        print(e);
      }

I found amount field is double, but try to parse it with int

WX20210603-120109
WX20210603-120729

I don't know wether amount always is double, so I try fix it like this.
because I only care whether user skip video or not

try {
  onEventController.add({
    RewardedAdEvent.earnedReward: RewardItem.fromJson(call.arguments)
  });
} catch (e) {
  onEventController.add({RewardedAdEvent.earnedReward: null});
}

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on August 15, 2024 2

Published v1.2.1 with the fix for it.

from native_admob_flutter.

zenkog avatar zenkog commented on August 15, 2024 2

Can you guys try the latest master and see if it works?

dependencies:
  native_admob_flutter:
    git:
      url: https://github.com/bdlukaa/native_admob_flutter.git

I tried just now but it is still doesn't work.

I still go from loaded, then I watch, then it fire showed then once I close it only fire closed.

flutter: *** Ad Loaded!
flutter: *** Ad showed
flutter: *** Ad closed

I also get this message, not sure if this relevant or not:

Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service

from native_admob_flutter.

Billy-80 avatar Billy-80 commented on August 15, 2024 1

@bdlukaa i am facing this issue on IOS with the test reward ad (version ^1.2.4), same exact code works ok on Android. RewardedAdEvent.closed is called without issues but case RewardedAdEvent.earnedReward is not called.

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on August 15, 2024 1

ooh wow. I'll investigate

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on August 15, 2024 1

Can you guys try the latest master and see if it works?

dependencies:
  native_admob_flutter:
    git:
      url: https://github.com/bdlukaa/native_admob_flutter.git

from native_admob_flutter.

niypoo avatar niypoo commented on August 15, 2024 1

And if I understand the behavior correctly. In Android, when I finished watching a video Ad and then I close it, it fires rewarded first before firing close. Is it supposed to be the same behavior in iOS ?

Yes its a correct behavior, rewarded trigger before close event .

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on August 15, 2024 1

Sorry but I won't be able to work on this today, only tomorrow!

from native_admob_flutter.

shofizone avatar shofizone commented on August 15, 2024 1

Any update on this issue? I got a bad review for this.

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on August 15, 2024

Hey, thanks for reporting this issue! Does this happen on Android too? Are you using Rewarded Ads or Rewarded Interstitial Ads?

from native_admob_flutter.

fly-qp avatar fly-qp commented on August 15, 2024

Reward Ads - no not on android.
I no just did something like this because I dont want my users to be mad on me:

case RewardedAdEvent.closed: loadNext(); if (Platform.isIOS) onRewarded(); onEvent(); break;

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on August 15, 2024

Hey! I could not reproduce this issue. What version of the plugin are you using?

from native_admob_flutter.

fly-qp avatar fly-qp commented on August 15, 2024

native_admob_flutter: ^1.2.0

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on August 15, 2024

I can confirm this is also happening on Android with the latest version!

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on August 15, 2024

Okay I managed to fix it. Nothing wrong on the platform side. It was just a casting error on the dart side. I'll release a new version with the fix for it soon

from native_admob_flutter.

fly-qp avatar fly-qp commented on August 15, 2024

Thanks man I appreciate it very much 😍💕
Please let me know when new version is out

from native_admob_flutter.

niypoo avatar niypoo commented on August 15, 2024

Published v1.2.1 with the fix for it.

I'm facing same issue now , I'm using last version native_admob_flutter: ^1.2.4

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on August 15, 2024

I don't know what's wrong on the iOS side. It seems to be everything good.

Swift code:

            rewardedAd.present(fromRootViewController: (UIApplication.shared.keyWindow?.rootViewController)!) { () in
                self.channel.invokeMethod("onUserEarnedReward", arguments: [
                    "amount": self.rewardedAd.adReward.amount,
                    "type": self.rewardedAd.adReward.type,
                ])
            }

https://developers.google.com/admob/ios/rewarded-ads#display_the_ad_and_handle_the_reward_event

Kotlin code:

                rewardedAd!!.show(activity) { reward ->
                    channel.invokeMethod("onUserEarnedReward", hashMapOf<String, Any>(
                            "amount" to reward.amount,
                            "type" to reward.type
                    ))
                }

Dart code:

      case 'onUserEarnedReward':
        onEventController.add({
          RewardedAdEvent.earnedReward: RewardItem.fromJson(call.arguments)
        });
        break;

Anyone with experience knows what's wrong?

from native_admob_flutter.

niypoo avatar niypoo commented on August 15, 2024

What was the wrong at first time you have known about this issue?
I think at version 1.2.1

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on August 15, 2024

What was the wrong at first time you have known about this issue?

The data parsing from RewardItem.fromJson(call.arguments). It was not working on Android too, but I fixed it an it's now working on Android. Idk why it doesn't work on iOS since the implementation is basically the same.

I can't test it on iOS since all the iOS implementation is made from the community. It'd be very helpful someone to help me out.

from native_admob_flutter.

niypoo avatar niypoo commented on August 15, 2024

So , can you disabled any data return like data of award , just trigger a event and see if the event trigger or not

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on August 15, 2024

The fix for it may be vishwajit76@96189d8, can you try his fork? Still, I can't test it because I don't have an Apple env.

from native_admob_flutter.

niypoo avatar niypoo commented on August 15, 2024

The fix for it may be vishwajit76@96189d8, can you try his fork? Still, I can't test it because I don't have an Apple env.

okay , give me a full fork repo url.

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on August 15, 2024

https://github.com/vishwajit76/native_admob_flutter

from native_admob_flutter.

niypoo avatar niypoo commented on August 15, 2024

https://github.com/vishwajit76/native_admob_flutter

I can't test this fork,
it's gives to me when try initialize MobileAds.initialize

Unhandled Exception: 'package:native_admob_flutter/src/utils.dart': Failed assertion: line 23 pos 10: 'Platform.isAndroid': Android is the only supported platform for now

and also the initialize function refuse this argument rewardedInterstitialAdUnitId

The named parameter 'rewardedInterstitialAdUnitId' isn't defined.
Try correcting the name to an existing named parameter's name, or defining a named parameter with the name 'rewardedInterstitialAdUnitId'.

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on August 15, 2024

I think I know where this error is coming from. GADAdReward#amount is NSDecimalNumber. It's probably just a parsing issue. I'll keep investigating

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on August 15, 2024

https://stackoverflow.com/a/28268951/11622876 should be the fix for it.

https://flutter.dev/docs/development/platform-integration/platform-channels#codec

from native_admob_flutter.

niypoo avatar niypoo commented on August 15, 2024

Can you guys try the latest master and see if it works?

dependencies:

  native_admob_flutter:

    git:

      url: https://github.com/bdlukaa/native_admob_flutter.git

Okay I will try it today, thanks

from native_admob_flutter.

zenkog avatar zenkog commented on August 15, 2024

Hi. Sorry don't mean to push, but any update? I'm behind on a deadline.

from native_admob_flutter.

zenkog avatar zenkog commented on August 15, 2024

And if I understand the behavior correctly. In Android, when I finished watching a video Ad and then I close it, it fires rewarded first before firing close. Is it supposed to be the same behavior in iOS ?

from native_admob_flutter.

zenkog avatar zenkog commented on August 15, 2024

No Problem. Thanks for the reply.

Sorry but I won't be able to work on this today, only tomorrow!

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on August 15, 2024

Please see #58

from native_admob_flutter.

niypoo avatar niypoo commented on August 15, 2024

Any update !! In this issue?

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on August 15, 2024

@genox-wang thanks for your info. It'll be very helpful

from native_admob_flutter.

flutter2k20 avatar flutter2k20 commented on August 15, 2024

@genox-wang thanks for your info. It'll be very helpful

Any plans on including the fix from @genox-wang in the next release?

from native_admob_flutter.

flutter2k20 avatar flutter2k20 commented on August 15, 2024

@bdlukaa

Is there any update to this issue? Any idea when this fix will be released?

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on August 15, 2024

Published version 1.4.1 that is supposed to fix this issue. Thanks @zhengbomo for the fix for it #85

from native_admob_flutter.

Related Issues (20)

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.