You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was able to set up and receive notifications using WalletConnect cloud, FCM and react-native-firebase + Notifee.
Notification is displaying when app is not started (killed);
However, It's not possible to display data-only background notification in Android 12+ according known issue with background notifications handling on Android (Well described here: invertase/notifee#830 (comment), see whole thread)
It's because WalletConnect notifications are data-only (using data instead of notification property), and the system just ignores them in background state.
Is there any way to force display this kind of notifications? Notification received in background shows only when I open app (move it to foreground)
Here is my code for displaying notifications. I believe this is not an issue with web3wallet itself, but, seems like there is no possibility to properly handle data-only messages to notify user when app is in background but not killed.
awaitweb3wallet.registerDeviceToken({token: awaitmessaging().getToken(),clientId: awaitweb3wallet.core.crypto.getClientId(),notificationType: "fcm",enableEncrypted: true});
...
// Create a channel (required for Android)constchannelId=awaitnotifee.createChannel({id: "wallet-connect",name: "WalletConnect Notifications",importance: AndroidImportance.HIGH});try{// Display a notificationawaitnotifee.displayNotification({title: "Wallet Action Required",body: "Tap notification to open app and perform action on WalletConnect request",android: {importance: AndroidImportance.HIGH,
channelId,smallIcon: "ic_small_icon",color: "#22C55E",// pressAction is needed if you want the notification to open the app when pressedpressAction: {id: "default"}}});}catch(e){// eslint-disable-next-line no-consoleconsole.log(e);}
vaniyokk
changed the title
Not able to display FCM push notifications from background mode on Android
Not able to display WalletConnect FCM push notifications from background mode on Android
Jul 12, 2024
I was able to set up and receive notifications using WalletConnect cloud, FCM and react-native-firebase + Notifee.
Notification is displaying when app is not started (killed);
However, It's not possible to display data-only background notification in Android 12+ according known issue with background notifications handling on Android (Well described here: invertase/notifee#830 (comment), see whole thread)
It's because WalletConnect notifications are data-only (using data instead of notification property), and the system just ignores them in background state.
Is there any way to force display this kind of notifications? Notification received in background shows only when I open app (move it to foreground)
Here is my code for displaying notifications. I believe this is not an issue with web3wallet itself, but, seems like there is no possibility to properly handle data-only messages to notify user when app is in background but not killed.
Also, here is my message I receive in background and which I can't display to user. Shouldn't it contain
"priority": "high", "contentAvailable": true
fields as per https://rnfirebase.io/messaging/usage#data-only-messages?SDK Version (if relevant)
Expected behavior
There should be a way to receive and notify user about WalletConnect request if wallet app is hidden (in background)
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: