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
Is there a way to implement the multiline title?
Without the official support with the notification field, I've tried using notifee to use the data field instead.
The flow that it worked in the foreground notification:
send the subtitle string inside the data payload
use notifee to display subtitle
Yay! The multiline title works
This method works from in the foreground notification, but in the background, I've tried implementing notifee in index.js, but setBackgroundMessageHandler is not firing.
Any help please?
index.js
`import 'react-native-get-random-values';
import React from 'react'
import {AppRegistry} from 'react-native';
import messaging from '@react-native-firebase/messaging';
import App from './App';
import {name as appName} from './app.json';
function HeadlessCheck({ isHeadless }) {
console.log('headless check')
if (isHeadless) {
console.log("Headless");
// App has been launched in the background by iOS, ignore
return null;
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, according to the firebase docs of REST api,
ios subtitle is no longer supported.
However, in the legacy HTTP Server Protocol
ios subtitle is supported.
Is there a way to implement the multiline title?
Without the official support with the notification field, I've tried using notifee to use the data field instead.
The flow that it worked in the foreground notification:
This method works from in the foreground notification, but in the background, I've tried implementing notifee in index.js, but setBackgroundMessageHandler is not firing.
Any help please?
index.js
`import 'react-native-get-random-values';
import React from 'react'
import {AppRegistry} from 'react-native';
import messaging from '@react-native-firebase/messaging';
import App from './App';
import {name as appName} from './app.json';
messaging().setBackgroundMessageHandler(async remoteMessage => {
console.log('Message handled in the background!', remoteMessage);
await notifee.displayNotification({
title: remoteMessage.notification.title,
subtitle: remoteMessage.data.subtitle,
body: remoteMessage.notification.title,
data: remoteMessage.data,
ios: {
foregroundPresentationOptions: {
sound: true,
banner: true,
list: true,
},
}
})
});
function HeadlessCheck({ isHeadless }) {
console.log('headless check')
if (isHeadless) {
console.log("Headless");
// App has been launched in the background by iOS, ignore
return null;
}
}
AppRegistry.registerComponent(appName, () => HeadlessCheck);
`
Payload
`const payload = {
token: 'aaa',
Beta Was this translation helpful? Give feedback.
All reactions