-
Notifications
You must be signed in to change notification settings - Fork 4k
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
🐛 [firebase_messaging] Notification Images setup problem iOS #4133
Comments
That guide is meant for the dev version of the plugin but I can confirm that I see the same with Xcode flutter doctor -v
|
@DFelten compiling works when |
Doing this will get everything to build, but it doesn't seem to actually run the notification service extension. Looking through the console, there's an unhelpful error that just says "Couldn't load extension" and another that then notes "Notification request was marked as mutable but no service extension is available". I haven't figured it out yet, but looking elsewhere it seems like it may be related to limits on size/memory that could cause the extension to fail to load. |
Had the same problem. Updated all libraries (at this moment versions are |
I was able to follow the steps of the guide with the latest versions of the plugins ( However the documentation does not mention adding To those of you who got the app to compile but did not receive an image I would remind you of https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#notification where it is specified that
|
Setting the deployment to the same version solved this for me as well. My main Runner was ios 10.0, but the extension was automatically set to ios 14.4 |
Pushing the thread since is still missing from the documentation which cost me some time till I found this thread. Thank you guys! |
unable to build with lates libraries. ` .........../ios/build/Debug-iphoneos/PromisesObjC/FBLPromises.framework/FBLPromises' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '..../ios/build/Debug-iphoneos/PromisesObjC/FBLPromises.framework/FBLPromises' for architecture arm64 tryed with bitcode on and off on xcode 12.4 no bitcode option for target ImageExtension |
Hey people, for those who managed to configure it, how do you send the image in the payload? Do you have some example of the notification that you send?. |
Hi. This example for send message firebase with endpoint { |
hi @lqmminh thanks for the answer, I'm trying using CURL for sending the push but it doesn't work for me . I tried different ways but none of those worked :(. I receive the push notification but I don't see the image.
I'm using |
This message send success? |
Yes |
@diegoveloper The image can just be in the notification object and it should work on both Android and iOS. Since you are sending the curl request to the deprecated API it should look something like this: {
"to": token,
"notification": {
"title": "Title",
"body": "Body",
"image": "https://i.ibb.co/SPYWphH/37d.jpg"
}
} However I recommend you take a look at #4611 (comment) for an example of how to use the recommended FCM v1 HTTP API |
@markusaksli-nc I tried with the json you posted but I got the same results, I get the notification without image :/. |
If you are using firebase-node-sdk import * as admin from "firebase-admin";
const message: admin.messaging.Message = {
token,
notification: {
title: "Title",
body: "Body"
imageUrl: "https://picsum.photos/200",
},
apns: {
payload: {
aps: {
mutableContent: true,
},
},
},
};
admin.messaging().send(message); |
it worked for Android, but not for iOS , do you know if the deprecated API is compatible with rich notifications in iOS? |
@diegoveloper |
@diegoveloper The image I linked worked on both Android and iOS for me on both the deprecated API and v1. When you use the
|
It was already selected.
I didn't have luck with that :/ These are my configs following this page https://firebase.flutter.dev/docs/messaging/apple-integration/#advanced-optional-allowing-notification-images: And I had to add this on my Any help? The push is sent but without image. |
I tried all suggestions but didn’t work for me, I'm using xcode 12.4 with m1 chip. below error log Undefined symbols for architecture arm64: |
Still, open this bug? we are waiting since 2020-Nov |
Is |
any progress ? |
Please solve this problem and add the support for swift. Notifications are supper important, and without images they are.... sad :_( |
This stack-overflow https://stackoverflow.com/questions/64901180/running-cocoapods-on-apple-silicon-m1, it solves the problem for now on mac M1. Install ffi |
Pod install is fine, but flutter run failed after did these steps. |
Setting the Configuration to "none" in Runner->Info fixed it for me. |
Does anyone got it to work? I tried to follow all steps from here a couple of times and no luck. EDIT 2: If you use that tutorial, remember to check that the iOS target version of the extension matches the app target version. EDIT 1: I tried a non-flutter tutorial from medium and I got it to work. The only problem im having is with firebaseMessaging.getInitialMessage but I think is not linked to this. This is the example code for it to work, it doesn't even need "apns" or "mutable-content" tags, just to link the image twice one as "image" in notification and other as "image_url" on root, dont ask me why, I just know that it works for me: |
Step 1:Add “use_framework!” In ImageNotifcation target 'ImageNotification' do pod 'Firebase/Messaging' Step 2:Add pod 'GoogleUtilities' in both target like below: platform :ios, '11.0' ENV['COCOAPODS_DISABLE_STATS'] = 'true' project 'Runner', { def flutter_root File.foreach(generated_xcode_build_settings_path) do |line| require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) flutter_ios_podfile_setup target 'Runner' do flutter_install_all_ios_pods File.dirname(File.realpath(FILE)) pod 'GoogleUtilities'end post_install do |installer| target 'ImageNotification' do pod 'GoogleUtilities'end |
As mentioned above, there should be a |
I fixed the issue by using use_frameworks! but I have another problem. Now I have multiple targets with differents identifier I'm unable to sign the application with my ad-hoc provisioning profile since it target only a single identifier. Does anyone know how to solve this problem ? |
If anyone still facing same issue then check below after adding a NotificationServiceExtension please Check your deployment target on Service Extension. by default the Extension deployment target is set to iOS 13.1 ( depending on your sdk version ), so you need a device with same iOS version OR you have to choose a lower value to match your device iOS |
Bug report
Describe the bug
In iOS, When trying to setup FCM(with image support) the app does not compile. The documentation steps result in errors.
Steps to reproduce
Steps to reproduce the behavior:
use_framewroks!
in the docs, we get this error:use_frameworks!
, then it compiles, but I get this error:Expected behavior
FCM has Image capabilities as expected and the project compiles without error
Additional context
I tried both creating the Image Notification Service Extension as an Objective C file and a Swift file. Nothing changed
Also I tried enabling the bitcode setting but still no luck.
Flutter doctor
Run
flutter doctor
and paste the output below:Click To Expand
Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below:Click To Expand
The text was updated successfully, but these errors were encountered: