More than 1 bubble shows up and it looks like randomly happens. I'm showing bubble on background notification. Tried to look at the java codes I couldnt do anything
setBackgroundMessageHandler(props){
console.log('setBackgroundMessageHandler listener');
// To display the bubble over other apps you need to get 'Draw Over Other Apps' permission from androind.
// If you initialize without having the permission App could crash
if(Platform.OS === 'android'){
requestPermission().then(() => console.log("Permission Granted")).catch(() => console.log("Permission is not granted"))
// Initialize bubble manage
initialize().then(() => console.log("Initialized the bubble mange"))
}
return firebase.messaging().setBackgroundMessageHandler(async remoteMessage => {
if(Platform.OS === 'android'){
// Show Floating Bubble: x=10, y=10 position of the bubble
hideFloatingBubble().then(() => console.log("Floating Bubble Removed"));
showFloatingBubble(10, 10).then(() => props.handleAddAlarm(remoteMessage.notification));
DeviceEventEmitter.addListener("floating-bubble-press", (e) => {
Linking.openURL('appName://').then((data) => {
//fetch new orders
})
.catch((e) => {
console.log('Error opening app',e);
});
hideFloatingBubble().then(() => console.log("Floating Bubble Removed"));
props.handleStopAlarm();
});
DeviceEventEmitter.addListener("floating-bubble-remove", (e) => {
console.log("Remove Bubble")
props.handleStopAlarm();
});
}
});
}
More than 1 bubble shows up and it looks like randomly happens. I'm showing bubble on background notification. Tried to look at the java codes I couldnt do anything