delete firebase
This commit is contained in:
59
index.js
59
index.js
@@ -1,41 +1,40 @@
|
||||
/**
|
||||
* @format
|
||||
*/
|
||||
import notifee, { AndroidImportance } from '@notifee/react-native';
|
||||
import messaging from '@react-native-firebase/messaging';
|
||||
// import notifee, { AndroidImportance } from '@notifee/react-native';
|
||||
// import messaging from '@react-native-firebase/messaging';
|
||||
import { AppRegistry } from 'react-native';
|
||||
import App from './App';
|
||||
import { name as appName } from './app.json';
|
||||
|
||||
// 📌 Background/Killed xabarlarni ushlash
|
||||
messaging().setBackgroundMessageHandler(async remoteMessage => {
|
||||
console.log('Background message:', remoteMessage);
|
||||
// messaging().setBackgroundMessageHandler(async remoteMessage => {
|
||||
// console.log('Background message:', remoteMessage);
|
||||
|
||||
const channelId = await notifee.createChannel({
|
||||
id: 'default',
|
||||
name: 'Umumiy bildirishnomalar',
|
||||
sound: 'default',
|
||||
importance: AndroidImportance.HIGH,
|
||||
});
|
||||
// const channelId = await notifee.createChannel({
|
||||
// id: 'default',
|
||||
// name: 'Umumiy bildirishnomalar',
|
||||
// sound: 'default',
|
||||
// importance: AndroidImportance.HIGH,
|
||||
// });
|
||||
|
||||
await notifee.displayNotification({
|
||||
title:
|
||||
remoteMessage.notification?.title ||
|
||||
remoteMessage.data?.title ||
|
||||
'Yangi xabar',
|
||||
body:
|
||||
remoteMessage.notification?.body ||
|
||||
remoteMessage.data?.body ||
|
||||
'Matn yo‘q',
|
||||
android: {
|
||||
channelId,
|
||||
largeIcon: 'ic_launcher_foreground',
|
||||
sound: 'default',
|
||||
pressAction: {
|
||||
id: 'default',
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
// await notifee.displayNotification({
|
||||
// title:
|
||||
// remoteMessage.notification?.title ||
|
||||
// remoteMessage.data?.title ||
|
||||
// 'Yangi xabar',
|
||||
// body:
|
||||
// remoteMessage.notification?.body ||
|
||||
// remoteMessage.data?.body ||
|
||||
// 'Matn yo‘q',
|
||||
// android: {
|
||||
// channelId,
|
||||
// largeIcon: 'ic_launcher_foreground',
|
||||
// sound: 'default',
|
||||
// pressAction: {
|
||||
// id: 'default',
|
||||
// },
|
||||
// },
|
||||
// });
|
||||
// });
|
||||
|
||||
AppRegistry.registerComponent(appName, () => App);
|
||||
|
||||
Reference in New Issue
Block a user