fix: NullPointerException getTargetSdkVersion#1848
Conversation
There was a problem hiding this comment.
@kyunkakata thanks for the PR! I left some feedback that needs to be addressed before we can accept this PR.
jkasten2
left a comment
There was a problem hiding this comment.
@kyunkakata Thanks for addressing the feedback. Could you clean up your commit history to be a single commit? You can use git rebase on your fork to do so or make a new fork if that is easier.
fix: change to lazy variable lint lint fix: wrong lazy implement fix: add check sdk back
|
Done! |
jkasten2
left a comment
There was a problem hiding this comment.
Thanks for the fixups! Approved and merging it into main.
|
@jkasten2 can we get a release on this please? we are having this issue on production and need a fix asap please |
I have removed the annotation in this pull request #1866. Please check if this resolves the problem. |


Description
Sometime, the application starts but the context was not initialized in OneSignal module soon enough and it will be null. This happens sometime with React Native application. And the block of above code will be executed when NotificationPermissionController is initialized --> Context is null. So it should be moved to block of code of the function prompt below. So when we call from JS promptForPushNotificationsWithUserResponse later, the context should be initialized.
Details
Motivation
Fix the crash OneSignal/react-native-onesignal#1516
Checklist
Overview
Testing
Final pass
This change is