File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -268,19 +268,23 @@ you can configure your `AppDelegate.m` file (see instructions below) to inject a
268
268
import { AppRegistry } from ' react-native' ;
269
269
import messaging from ' @react-native-firebase/messaging' ;
270
270
271
+ // Handle background messages using setBackgroundMessageHandler
271
272
messaging ().setBackgroundMessageHandler (async remoteMessage => {
272
273
console .log (' Message handled in the background!' , remoteMessage);
273
274
});
274
275
276
+ // Check if app was launched in the background and conditionally render null if so
275
277
function HeadlessCheck ({ isHeadless }) {
276
278
if (isHeadless) {
277
279
// App has been launched in the background by iOS, ignore
278
280
return null ;
279
281
}
280
282
283
+ // Render the app component on foreground launch
281
284
return < App / > ;
282
285
}
283
286
287
+ // Your main application component defined here
284
288
function App () {
285
289
// Your application
286
290
}
You can’t perform that action at this time.
0 commit comments