My app is coded to draw under the StatusBar at the top of the device :
<StatusBar translucent backgroundColor='rgba(0,0,0,0)' barStyle='light-content' />
It works perfectly when I open the app. But however, when the app is opened from a notification sent from Firebase Cloud Functions, the StatusBar is not translucent, and my app does not draw under the StatusBar anymore, even if it renders a screen with :
<StatusBar translucent backgroundColor='rgba(0,0,0,0)' barStyle='light-content' /> set in it.
I tried also to not set translucent, but a color to the StatusBar , and exactly the same, the StatusBar code is ignored when opened from a notification
I'm rendering <StatusBar translucent backgroundColor='rgba(0,0,0,0)' barStyle='light-content' /> in App.js , with my StackNavigation, so at the very begining of the app launching.
I have tried to put it in a component which mounts later, and it doesn't do anything, exactly the same problem.
It looks like your issue may be missing some necessary information. Can you run react-native info and edit your issue to include these results under the Environment section?
Try using the statusbar API directly outside the components or on constructor/componentWillMount:
https://facebook.github.io/react-native/docs/statusbar.html#methods
import {StatusBar} from 'react-native';
StatusBar.setBackgroundColor("rgba(0,0,0,0)")
StatusBar.setBarStyle("light-content")
StatusBar.setTranslucent(true)
Thank you ! It worked !
Most helpful comment
Try using the statusbar API directly outside the components or on constructor/componentWillMount:
https://facebook.github.io/react-native/docs/statusbar.html#methods