upd: push notification on background
Deskripsi: - on klik pada background notification - hide and show notificationn foreground No Issues
This commit is contained in:
@@ -26,19 +26,14 @@ const initializeFirebase = async () => {
|
||||
// Set auto initialization and background message handler
|
||||
mess.setAutoInitEnabled(true);
|
||||
// mess.setBackgroundMessageHandler(async remoteMessage => {
|
||||
// // console.log('Message handled in the background!', remoteMessage);
|
||||
// // pushToPage(String(remoteMessage?.data?.category), String(remoteMessage?.data?.content))
|
||||
// const screen = remoteMessage?.data?.category;
|
||||
// const content = remoteMessage?.data?.content;
|
||||
|
||||
// if (screen && content) {
|
||||
// await AsyncStorage.setItem('navigateOnOpen', JSON.stringify({ screen, content }));
|
||||
// }
|
||||
// });
|
||||
|
||||
mess.setBackgroundMessageHandler(async remoteMessage => {
|
||||
const screen = remoteMessage?.data?.category;
|
||||
const content = remoteMessage?.data?.content;
|
||||
|
||||
if (screen && content) {
|
||||
await AsyncStorage.setItem('navigateOnOpen', JSON.stringify({ screen, content }));
|
||||
}
|
||||
});
|
||||
|
||||
return mess
|
||||
} catch (error) {
|
||||
console.error('Failed to initialize Firebase:', error);
|
||||
|
||||
Reference in New Issue
Block a user