-
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
/
index.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);