react-native-push-notification / ios

React Native Push Notification API for iOS.
MIT License
734 stars 282 forks source link

Can i display image notification in foreground ??? #307

Closed trungtin2222 closed 2 years ago

trungtin2222 commented 2 years ago

Hi all, i tried to find another issues related to image notification in this library (#255), and i fixed but not work for me, so i create this issue for seek help from people.

This is my code:

const notifyiOS = () => {
        PushNotificationIOS.addNotificationRequest({
            id: '123123',
            title: 'Hello react native',
            body: 'Example with image',
            userInfo: {
                image:
                    'https://cdn.pixabay.com/photo/2018/01/21/01/46/architecture-3095716_960_720.jpg',
            },
        });
    };

Screen Shot 2021-07-18 at 03 44 15

and

const options = {
                title: 'Notification Title',
                message: 'Notification Body',
                userInfo: {
                    image: 'https://www.online-tech-tips.com/wp-content/uploads/2016/03/widescreen-iphone-photo.jpg',
                },
            };
PushNotification.localNotification(options);

Screen Shot 2021-07-18 at 03 44 32 i'm using

"@react-native-community/push-notification-ios": "^1.8.0", "react-native-push-notification": "^7.4.0",

Many thank

Naturalclar commented 2 years ago

Rich notification with Image Support has been added in v1.9.0 :tada: