-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.js
More file actions
27 lines (22 loc) Β· 807 Bytes
/
Copy pathindex.js
File metadata and controls
27 lines (22 loc) Β· 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
* @format
*/
import { AppRegistry } from 'react-native';
import messaging from '@react-native-firebase/messaging';
import App from './App';
import { name as appName } from './app.json';
import 'locales';
messaging().setBackgroundMessageHandler(async (remoteMessage) => {
// λ°±κ·ΈλΌμ΄λ λ©μμ§λ₯Ό μμ ν λ νΈμΆλλ μ½λ°± ν¨μ
console.log('Message handled in the background!', remoteMessage);
});
// μ±μ΄ λ°±κ·ΈλΌμ΄λμμ μ€νλμλμ§ νμΈ
function HeadlessCheck({ isHeadless }) {
if (isHeadless) {
// iOSμμ λ°±κ·ΈλΌμ΄λμμ μ±μ΄ μ€νλμμΌλ―λ‘ λ¬΄μν©λλ€.
return null;
}
// ν¬κ·ΈλΌμ΄λ μ€ν μ μ± μ»΄ν¬λνΈλ₯Ό λ λλ§ν©λλ€.
return <App />;
}
AppRegistry.registerComponent(appName, () => HeadlessCheck);