-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to add an attachment to ios notification #939
Comments
Thanks for the report, we'll investigate. |
@chrisbianca Same issue on android, unable to get big picture to work
The docs say that the The data i get from |
Managed to get image working in android, the doc currently does not give alot of information about the type of data that needs to be given for the picture parameter. For those looking it needs an http or https link or a filename that points to a mipmap resource in the android I have created a PR to add the necessary info to the docs. |
@judemanutd RE: Android. I've just pushed up a change which should support file:// urls. This will be released as part of v4.0.1 shortly. Would you be able to verify if this is the case? RE: iOS. I will investigate as part of v4.0.2 |
@chrisbianca Yes I can verify the change once its live. Looking forward to the issue being sorted with iOS too, are there any hardware requirements for the iOS notification with an image to show? 3D touch ? Higher screen resolution ? |
@judemanutd v4.0.1 is available now. I'm not sure on the iOS notification to be honest, I'll have some time to look into it later this week. |
@chrisbianca would it be possible to provide an example usage for adding an attachment in iOS for a notification, maybe an example y'all used during development which i could test. |
@chrisbianca Using 4.0.1 but unable to get image in notification using
This produces a file url Testing on Android 7.1.1 API 25 P.S. I think we need to shift this to a separate thread rather than hijacking the ios issue. |
This is now fixed, pending release of v4.0.3 |
Is there an example how to get this to work on iOS? There seems to be a lack of examples for these advanced topics. What exactly does the URL have to look like that I pass to addAttachement? My current setup is something like this: const res = await RNFetchBlob
.config({ fileCache: true, appendExt: 'jpg' })
.fetch('GET', 'https://static.cinuru.com/public/backdropSmall/1524495663496.jpg');
notification.ios.addAttachment('1', `file://${res.path()}`); The created path looks like this: |
@MrLoh just |
awesoe, that did the trick. I thought I had tried all combinations, clearly I didn't. |
Just let me know guys @MrLoh @judemanutd . Attached file must be local file or it is work with external url as well? |
@Akillis must be downloaded locally first with something like RNFetchBlob. |
How does it works when the app is in the background or close? |
@MrLoh Great thanks |
Issue
Environment
I have used the react native fetch blob library to download an image using the url. I am then supplying the image to the attachment but nothing shows up in the attachment.
The notification shows up fine with the title and body but there is no attachment.
const notification = new firebase.notifications.Notification()
.setNotificationId('notificationId')
.setTitle('My notification title')
.setBody('My notification body')
.ios.addAttachment('1',res.path());
res.path()
gives me the path of the image locally downloaded.The text was updated successfully, but these errors were encountered: