-
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
Notification iOS with image not showing with FCM #2432
Comments
This should be something handled automatically by the device. I guess, it would be an SDK version update? |
I can see this was implemented back in April for Android but I can't find something similar on iOS |
Apparently we need to create an extension -> docs here. Would be great if |
@LuisRodriguezLD Were you able to get that notification service extension set up properly? If so, could you provide some steps? |
Yes! I made it work :)
(Don't forget to pod install)
Import RNFirebaseMessaging at the top
And replace
with
This video can get you started in step 1. If you get stuck let me know. |
I am running into some problems.
Ugh I'm stuck on |
Yeah. I highly recommend you upgrade |
Hello 👋, to help manage issues we automatically close stale issues.
|
@LuisRodriguezLD thanks for your solution but I still get some glitch here. When app in background or foreground, my notification display perfectly with image. But when app is open image dose not show. Do you have any solution for that? |
@ThanhQuang1410 Sorry, I do not have a current solution for when the app is open. I am pretty sure it's a very similar approach. I'll try to get an example running today but no promises. Feel free to DM me. |
@LuisRodriguezLD Awesome. Did you get a chance to try? I am facing a similar issue on Android as well. When the App is open expandable Notifications don't come, even if it's text. The Notification is received but it's not expandable. |
In android handle it by doing notification.android.setLargeIcon(IMAGE_URL); |
Сan you show an example of your code? I use Firebase/Messaging', '~> 6.3.0' |
@NikitaPFE there is not actual code besides that, it's just configuration. file not found could be because you did not install the pods. did you follow step 2? Don't forget you need to |
@LuisRodriguezLD You do not know whether to remove these methods from the AppDelegate.m? |
@NikitaPFE There is no need to remove that code from Appdelegate.m To resolve file not found error, follow these steps: Go to
Refer #632 (comment) for the same. |
Hello 👋, to help manage issues we automatically close stale issues.
|
Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information. |
@LuisRodriguezLD thanks for your help. Your solution worked like a charm and now I can send push with images from the console. Can you please share your push notification code, the payload you send from your server. |
I implemented these steps in my code. However when I send => { I am still not able to see the image in the notification. |
did anyone solved this issue I'm struggling with the same one but cannot receive notification after successfully sending following FCM POST please note that this message is received when the application is in the foreground. |
If you have this iOS app build error:
you have to add this at the end of your post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
end
end
end |
I have tried this, and am getting some error like the provisioning profile is not matching. Here my question is after adding the Notification service extension do we need to create another provisioning profile for this bundle id? |
For people using RNF 5 or greater change the import to |
This did not work for me. |
I've one everything that was written above, but got an error
react-native v0.63.3 Here is a part of my NotificationService.m
Also I have in my podFile
Any ideas? |
@Daha62 as near as I can tell this is a "welcome to Xcode 12 and Apple SIlicon support in Xcode" bug. It's not related specifically to our module. You'll find all sorts of conflicting advice on stack overflow about it and you can see the PR here for a workaround (not a great solution) to a similar issue. It's going to be project-specific in the end I think #4401 |
Another tip for those trying to cruise through this thing that should be handled automatically... The NotificationService.m is created with boilerplate code already in it. You probably want to remove or edit this line, which modifies the notification title:
|
For anyone with |
Hi there, I'm facing the same problem here. Already done all the steps and build successfully. Did you find a solution? Thanks a lot |
After 5 hours or struggle finally, did it follow this link it has step by step guide after then check the development target of your extension |
I am following this link for the notification with the image in iPhone, but the image is not getting with notification. I am sharing the details of current versions which are used in my project. Getting build fail issue when inserting the below line in NotificationService file. Please help to solve this issue. |
Any solution for #import "RNFirebaseMessaging.h" not found?, thanks |
@congduong97 it is not polite to post unrelated comments to other people's issues |
@mikehardy Sorry, |
After a bit of struggling, Xcode set my extension iOS version to the latest while the main app's version was set to 12.4. Changing the extension to 12.4, the image comes through. |
there is official doc for this |
I had to do it a bit different as suggested here
|
Notification image only shows when in the app is in the background not when the app is in the Foreground how do I solve this ? |
hey @DaveTolulope22 , are you able to make image notifications work ?? |
working in forground but not in background how to solve this? class LocalNotificationService {
}; showNotification = (id, title, message, data = {}, options = {}) => {
}; buildIOSNotification = (id, title, message, data = {}, options = {}) => { createNotificationChannel = () => { export const localNotificationService = new LocalNotificationService(); and fcm-service class FCMService { registerAppWithFCM = async () => { checkPermission = onRegister => { getToken = onRegister => {
}; requestPermission = onRegister => { deleteToken = () => { createNotificationsListeners = (
}; unRegister = () => { export const fcmService = new FCMService(); |
Issue
I want to receive notification with an image from FCM but the image is not display in the notification banner on iOS but work on Android.
Project Files
iOS
Click To Expand
ios/Podfile
:AppDelegate.m
:Android
Click To Expand
Have you converted to AndroidX?
android/gradle.settings
jetifier=true
for Android compatibility?jetifier
for react-native compatibility?android/build.gradle
:// N/A
android/app/build.gradle
:// N/A
android/settings.gradle
:// N/A
MainApplication.java
:// N/A
AndroidManifest.xml
:<!-- N/A -->
Environment
Click To Expand
react-native info
output:Think
react-native-firebase
is great? Please consider supporting all of the project maintainers and contributors by donating via our Open Collective where all contributors can submit expenses. [Learn More]React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: