getPermissionSubscriptionState callback not being called if there is not state
https://github.com/geektimecoil/react-native-onesignal/blob/d8061133cf14b8813badd6b612cb78b58fe44010/android/src/main/java/com/geektime/rnonesignalandroid/RNOneSignal.java#L220
As i see is it's better to return a null in the callback or implement failure state instead not calling it at all. I didn't try it on my phone only on the simulator I'm running RN 52 with lates OneSignal RN sdk
@frenkelor A null OSPermissionSubscriptionState should be very rare and would only happen under 2 circumstances:
- You enabled the new GDPR privacy consent methods and the user hasn't given consent
- You haven't called
init()yet.
Either way, this would be an error in the way the SDK is being used, and whether we return null or don't call the callback at all, it doesn't really matter
Either way, this would be an error in the way the SDK is being used, and whether we return null or don't call the callback at all, it doesn't really matter
@Nightsd01 IMHO it matters. I promisified that method and ended up with a memory leak. :sweat_smile: