zoho / SalesIQ-Mobilisten-ReactNative

Your mobile app's ideal live chat partner. Power up your mobile App with the SalesIQ Mobilisten SDK for React-Native.
https://mobilisten.io/
9 stars 11 forks source link

`NullPointerException` in `setPageTitle` method #72

Closed AngadSethi closed 6 months ago

AngadSethi commented 9 months ago

Hello,

Sometimes, when I call setPageTitle method on my screens, my Sentry integration logs a NullPointerException error:

Attempt to invoke virtual method 'android.app.Activity com.zoho.livechat.android.operation.SalesIQApplicationManager.getCurrentActivity()' on a null object reference

Here is the stack trace for this error:

java.lang.NullPointerException: Attempt to invoke virtual method 'android.app.Activity com.zoho.livechat.android.operation.SalesIQApplicationManager.getCurrentActivity()' on a null object reference
    at com.zoho.salesiqembed.ZohoSalesIQ$Tracking.setPageTitle(ZohoSalesIQ.java:187)
    at com.zohosalesiq.reactlibrary.RNZohoSalesIQ.lambda$setPageTitle$34(RNZohoSalesIQ.java:653)
    at com.zohosalesiq.reactlibrary.RNZohoSalesIQ$$ExternalSyntheticLambda52.run
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:237)
    at android.app.ActivityThread.main(ActivityThread.java:8019)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)

This is an intermittent error, and I haven't found a way to reliably replicate this. Can someone please help?

bhahirathan-mb-11956 commented 9 months ago

Hi @AngadSethi,

We apologize for the inconvenience caused. We'll look into this crash and update you once it's fixed. To avoid the crash and API to work, please use the setPageTitle API after successful initialization.

Thanks, Bhahirathan M Zoho SalesIQ.

AngadSethi commented 9 months ago

Will do. Thanks @DavidBhahirathan!

MelanieJourne commented 6 months ago

Hello.

I have the same problem on version 6.1.1.

Is it fixed by a newer version ?

bhahirathan-mb-11956 commented 6 months ago

Hi @AngadSethi and @MelanieJourne ,

Thank you for your patience. We have fixed this issue. We recommend you update to the latest version 8.0.1, and verify. Please feel free to write back to us at (support@zohosalesiq.com) if the issue persists.

Regards, Bhahirathan M Zoho SalesIQ.