Answered

java.lang.NullPointerException on pause/resume app after receiving a Push Notification with SDK Version 15.+

  • 24 November 2023
  • 3 replies
  • 76 views

Badge

Hello dear Support Team,

after updating the Intercom SDK to version 15.2.0 our app crashing with the next Stacktrace:
 


This happens when our own push notification will be consumed and the application will be send in background. After resuming the app from “recent apps” the crash happens. 
This behavior is noticed on different android versions from 11 to 14, and with Intercom SDK Versions 15.+, the same happens with 15.5.0.

Thanks in advance for support!

icon

Best answer by Artiom C 27 November 2023, 15:41

View original

3 replies

Userlevel 4
Badge +5

Hi @Artiom C !

This type of question is best sent directly to the Support team via email or your workspace Messenger. That way we can work with you to dig into the specific details a bit more. I’m going to send your message to the team. They will reach out to you via the Email address that you signed up with in order to get more details from you!

Badge


I have found the reason of crashing the Intercom SDK in our app - 
After a bit of research, I found that the problem was that the SDK, depending on the state of the application lifecycle, was trying to access the intent fields in the method onResume() responsible for the continuation of the activity, while on our side we were emptying the entire activity's intent after processing and consuming our own notifications, after each consumption we were nullifying the intent completely with the assurance that this would not break anything, to prevent showing the notifications multiple times.
At the same time Intercom SDK tries to access the nullable intent - which in my own opinion should not crash the whole application and that intent should be marked as nullable in SDK.
So we have just adjusted the function that was responsible for emptying the intent and it worked.
 

Userlevel 4
Badge +5

Thanks so much for sharing your findings @Artiom C ! Hopefully that will help other customers that run into the same issue!

Reply