mapp-digital / Mapp-Engage-ReactNative-Plugin

0 stars 1 forks source link

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]' *** First throw call stack: #2

Closed Maharshi01 closed 3 years ago

Maharshi01 commented 3 years ago

Hi @acamarinkovic,

App is getting crashed in iOS when I invoke Mapp.triggerInApp() for almost all the inApp events that i had integrated in the project. Firstly, I invoked it in componentDidMount() method and then when I navigate to the page, app is getting immediately crashed and there are no js logs, so i have attached the native logs from xcode in the link below. I have also attached the screen recording of the crash and the functional usage in the code. Please help to solve the issue.

Native logs : https://dpaste.org/DUiH

Thanks

P.S: Using the latest version("react-native-mapp-plugin": "^1.0.3-beta7")

Screenshot 2021-06-08 at 6 49 10 PM

https://user-images.githubusercontent.com/48430425/121193044-2283bb80-c88b-11eb-8536-232229c521e9.mov

acamarinkovic commented 3 years ago

@Maharshi01 do you enable deep linking listener before that? Or any other listener?

Maharshi01 commented 3 years ago

No, I didn't call any listener before invoking...I directly invoked the method in componentDidMount.

acamarinkovic commented 3 years ago

OK thank you, I will try to reproduce. If you enable deep linking listener before trigger in-app(application crash). It’s a known bug and we’ll solve it soon. Inapp without it should work ok.

Maharshi01 commented 3 years ago

Uh-oh, I have one question then we implemented and called the firebase deep-link listener function in the homepage. So, do you think the crash might be because of that ? And also the issue is not occurring in android, is this expected?

acamarinkovic commented 3 years ago

No, it should be just our function, and yes it is only on iOS.

Maharshi01 commented 3 years ago

Hi Aleksander,

Any update on this?

acamarinkovic commented 3 years ago

Hi @Maharshi01

Not yet, I hope we will have some update soon

Maharshi01 commented 3 years ago

Hi @acamarinkovic Hope you are doing well, Can you please let me know if there is any progress regarding the issue? so that we can plan accordingly..

acamarinkovic commented 3 years ago

@Maharshi01 Still, we can't reproduce those issues. It is not related to the deep linking. Is this issue reproducible with our test application or your test application?

Maharshi01 commented 3 years ago

Hi @acamarinkovic This issue occurred while triggering in-app in the UMobile code, i was unable to replicate the issue in your test application or mine because there are no javascript stack trace which is pointing to the issue.

acamarinkovic commented 3 years ago

@Maharshi01 Can you pls explain to us what is no javascript stack trace in your application? And how we can create the same setup?

Maharshi01 commented 3 years ago

I captured the crash in firebase, hope this can help

screencapture-console-firebase-google-u-1-project-myumobile-1006-crashlytics-app-ios-com-umobile-selfcare-issues-8ed3cb693f564d872a801d8783a7e605-2021-06-18-15_42_51

Maharshi01 commented 3 years ago

Javascript stack trace is just the error logs in chrome console......What I was trying to say is that after triggering the function crash is happening right, after which there are no logs in chrome console

acamarinkovic commented 3 years ago

Thank you. Yes, this will help us a lot

Maharshi01 commented 3 years ago

If something is unclear, please ping we can connect if you want to debug in my system. Thanks :)

Maharshi01 commented 3 years ago

Hi @acamarinkovic

I have found the issue, can able to replicate both in your sample project and mine

acamarinkovic commented 3 years ago

@Maharshi01 can you share details? How we can reproduce in a test application?

Maharshi01 commented 3 years ago

It's happening because of invoking addPushListener before triggerInApp function. You can replicate in your test application by clicking on add push button at the buttom and later click on any of the in app button, the application will crash.

acamarinkovic commented 3 years ago

Ok, thank you can you use and test the application without addPushListener? In the meantime, we will do our best to solve this issue

Maharshi01 commented 3 years ago

Okay, Without calling it the application is working fine.bt the question is if I don't invoke this method will I able to receive notifications? 'cause iam just calling Mapp.setPushEnabled(true)

acamarinkovic commented 3 years ago

Mapp.setPushEnable(true) Is enough

Maharshi01 commented 3 years ago

Okay.