Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Exception: NSInvalidArgumentException on iOS #48

Open
Carlosps opened this issue Dec 30, 2024 · 5 comments
Open

Fatal Exception: NSInvalidArgumentException on iOS #48

Carlosps opened this issue Dec 30, 2024 · 5 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Carlosps
Copy link

Carlosps commented Dec 30, 2024

Is anyone else facing this issue on crashlytics?

Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x827cc __exceptionPreprocess
1 libobjc.A.dylib 0x172e4 objc_exception_throw
2 CoreFoundation 0x1569c -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]
3 CoreFoundation 0x152b8 +[NSDictionary dictionaryWithObjects:forKeys:count:]
4 App
0x39758 __32-[emiAdmobPlugin loadAppOpenAd:]_block_invoke_3 + 811 (emiAdmobPlugin.m:811)
5 App
0x2566ec __copy_helper_block_e8_32s40s48s56s64b

I am using version "emi-indo-cordova-plugin-admob": "1.6.6",

@EMI-INDO EMI-INDO self-assigned this Dec 30, 2024
@EMI-INDO
Copy link
Owner

EMI-INDO commented Dec 30, 2024

Sorry my previous reply was wrong.

Can you provide more logs or a few pieces of your problematic code?

@EMI-INDO EMI-INDO added the help wanted Extra attention is needed label Dec 30, 2024
@EMI-INDO
Copy link
Owner

EMI-INDO commented Dec 30, 2024

@Carlosps

Fatal Exception first issue: NSInvalidArgumentException

  • adUnitId: "xxxxxxxxxx", // make sure this is a string not ""/null/nil
  • autoShow: true // make sure this is a boolean not "true"/null/nil
cordova.plugins.emiAdmobPlugin.loadAppOpenAd({ 
adUnitId: "xxxxxxxxxx", // make sure this is a string not ""/null/nil
autoShow: true // make sure this is a boolean not "true"/null/nil
});

second problem emiAdmobPlugin.m:811
on.appOpenAd.revenue // the cause of the first problem

/*
https://support.google.com/admob/answer/11322405

Turn on the setting for impression-level ad revenue in your AdMob account:
Sign in to your AdMob account at https://apps.admob.com.
Click Settings in the sidebar.
Click the Account tab.
In the Account controls section, click the Impression-level ad revenue toggle to turn on this setting.
*/

document.addEventListener('on.appOpenAd.revenue', (data) => {

    console.log(data.value)
    console.log(data.currencyCode)
    console.log(data.precision)
    console.log(data.adUnitId)

});
  • This is just an assumption, as I don't have enough logs or examples of how your code actually works.

@Carlosps
Copy link
Author

Carlosps commented Dec 30, 2024

@EMI-INDO

Thank you for your help.

This is the current code I use on the app to load app open:

async loadAppOpenAds() {
    this.listenAppOpenOnLoadFailEvent();
    if (this.platform.is('cordova') && this.showAds) {
      switch (this.adNetwork) {
        case AdNetwork.ADMOB:
          let appOpenConfig = {
            id: ''
          };
          if (this.platform.is('android')) {
            appOpenConfig.id = this.isTesting
              ? 'ca-app-pub-3940256099942544/9257395921'
              : this.ADMOB.ANDROID.APP_OPEN;
          } else {
            appOpenConfig.id = this.isTesting
              ? 'ca-app-pub-3940256099942544/5575463023'
              : this.ADMOB.IOS.APP_OPEN;
          }
          cordova.plugins.emiAdmobPlugin.loadAppOpenAd({
            adUnitId: appOpenConfig.id,
            autoShow: false
          });

          break;

        default:
          break;
      }
    }
  }

The impression-level ad revenue in the AdMob account was already turned on. I am also using mediation (Applovin, Liftoff and Pangle). Does this might have anything to do with that issue?

Just to add some info. The app does load and show the app open ads, the problem is that is also popping those issues on crashlytics.

@EMI-INDO EMI-INDO added the bug Something isn't working label Dec 30, 2024
EMI-INDO added a commit that referenced this issue Dec 30, 2024
Issue on split screen view, popup view and landscape view
#47

Fatal Exception: NSInvalidArgumentException on iOS
#48
@EMI-INDO
Copy link
Owner

https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/releases/tag/v2.0.0

I'm off for the next 5 to 7 days.
No updates.

Have a good day.

@Carlosps
Copy link
Author

Thank you for your great work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants