don't display notification in ios device when use react-native-fcm

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



don't display notification in ios device when use react-native-fcm



i'm using from react-native-fcm for recieve pushNotification and do all config in this document(https://github.com/evollu/react-native-fcm)
in ios device only recieve notification and call notificationListener that checked by console.log but dont display notification message and alert even test FCM.presentLocalNotification for show local notification still dont show notification


async componentDidMount() {
if (Platform.OS === 'ios')
try
const result = await FCM.requestPermissions( badge: false, sound: true, alert: true );
catch (e)
console.error(e);


FCM.getFCMToken().then(token =>
if (token !== undefined)
// this.props.onChangeToken(token);
else
console.log('TOKEN (getFCMToken)', 'null');

);

// FCM.getAPNSToken().then(token =>
// this.props.onAPNToken(token);
// );

FCM.getInitialNotification().then(notif =>
console.log('INITIAL NOTIFICATION', notif);
);

this.notificationListener = FCM.on(FCMEvent.Notification, async (notif) =>

console.log(" >> notificationListener: ", notif)

if (notif.local_notification) return;
FCM.presentLocalNotification(
body: 'tdtydt',
priority: "high",
title: 'notif.fcm.title',
sound: "default",
show_in_foreground: true,
local_notification: true,
icon: "ic_launcher",
status: "400"
);

);
this.refreshTokenListener = FCM.on(FCMEvent.RefreshToken, token =>
console.log('TOKEN (refreshUnsubscribe)', token);
this.props.onChangeToken(token);
);

FCM.enableDirectChannel();
this.channelConnectionListener = FCM.on(FCMEvent.DirectChannelConnectionChanged, (data) =>
console.log(`direct channel connected$data`);
);
setTimeout(() =>
FCM.isDirectChannelEstablished().then(d => console.log('isDirectChannelEstablished', d));
, 500);





Does log appear in console ?
– Pravin
Aug 8 at 12:44





yes, but doesn't show notification Alert and Sound to notify that message received @Pravin
– N_M
Aug 11 at 3:58






Maybe your FCM.presentNotification is not working
– Pravin
Aug 13 at 10:01










By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard