I created a new flutter project in IntelliJ, followed the instructions in the firebase_messaging readme for both android and iOS integration.
I copied the main.dart from the example
at this point everything works as intended, and I can build the project in IntelliJ, it runs, and receives notifications.
I am now trying to use the iOS Notification Service Extension in order to change notification content before displaying it as described here
I opened ios/Runner.xcworkspace in Xcode and followed the instructions at the previous link to set up the Notification Service. As soon as this is done the project no longer compiles in IntelliJ. (It does compile and run as intended through Xcode)
The part of the logs that stand out to me is this bit:
````
Ld /Users/baraka/Source/firebase_msg_test_2/build/ios/Debug-iphoneos/notification-service.appex/notification-service normal arm64
cd /Users/baraka/Source/firebase_msg_test_2/ios
export IPHONEOS_DEPLOYMENT_TARGET=11.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/baraka/flutter/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk -L/Users/baraka/Source/firebase_msg_test_2/build/ios/Debug-iphoneos -L/Users/baraka/Source/firebase_msg_test_2/build/ios/Debug-iphoneos/GoogleToolboxForMac -L/Users/baraka/Source/firebase_msg_test_2/build/ios/Debug-iphoneos/Protobuf -L/Users/baraka/Source/firebase_msg_test_2/build/ios/Debug-iphoneos/firebase_messaging -L/Users/baraka/Source/firebase_msg_test_2/build/ios/Debug-iphoneos/nanopb -L/Users/baraka/Source/firebase_msg_test_2/build/ios/Debug-iphoneos/path_provider -F/Users/baraka/Source/firebase_msg_test_2/build/ios/Debug-iphoneos -F/Users/baraka/Source/firebase_msg_test_2/ios/Pods/FirebaseAnalytics/Frameworks -F/Users/baraka/Source/firebase_msg_test_2/ios/Pods/FirebaseCore/Frameworks -F/Users/baraka/Source/firebase_msg_test_2/ios/Pods/FirebaseInstanceID/Frameworks -F/Users/baraka/Source/firebase_msg_test_2/ios/Pods/FirebaseMessaging/Frameworks -F/Users/baraka/Source/firebase_msg_test_2/ios/Pods/../../../../flutter/bin/cache/artifacts/engine/ios -filelist /Users/baraka/Library/Developer/Xcode/DerivedData/Runner-fguijgcpftvfzkdeuczcdxyozfgv/Build/Intermediates.noindex/Runner.build/Debug-iphoneos/notification-service.build/Objects-normal/arm64/notification-service.LinkFileList -miphoneos-version-min=11.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/baraka/Library/Developer/Xcode/DerivedData/Runner-fguijgcpftvfzkdeuczcdxyozfgv/Build/Intermediates.noindex/Runner.build/Debug-iphoneos/notification-service.build/Objects-normal/arm64/notification-service_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fapplication-extension -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Xlinker -add_ast_path -Xlinker /Users/baraka/Library/Developer/Xcode/DerivedData/Runner-fguijgcpftvfzkdeuczcdxyozfgv/Build/Intermediates.noindex/Runner.build/Debug-iphoneos/notification-service.build/Objects-normal/arm64/notification_service.swiftmodule -ObjC -lGoogleToolboxForMac -lProtobuf -lc++ -lfirebase_messaging -lnanopb -lpath_provider -lsqlite3 -lz -framework AddressBook -framework FirebaseAnalytics -framework FirebaseCore -framework FirebaseCoreDiagnostics -framework FirebaseInstanceID -framework FirebaseMessaging -framework FirebaseNanoPB -framework Flutter -framework StoreKit -framework SystemConfiguration -e _NSExtensionMain -Xlinker -dependency_info -Xlinker /Users/baraka/Library/Developer/Xcode/DerivedData/Runner-fguijgcpftvfzkdeuczcdxyozfgv/Build/Intermediates.noindex/Runner.build/Debug-iphoneos/notification-service.build/Objects-normal/arm64/notification-service_dependency_info.dat -o /Users/baraka/Source/firebase_msg_test_2/build/ios/Debug-iphoneos/notification-service.appex/notification-service
ld: library not found for -lfirebase_messaging
clang: error: linker command failed with exit code 1 (use -v to see invocation)
````
The rest of the log is here but I don't think that the notification service needs to be linking all of these libraries and frameworks. I checked the build settings in Xcode, and the notification service isn't set to link anything.
flutter analyze shows no issues found.
````
[✓] Flutter (on Mac OS X 10.12.6 16G29, locale en-GB, channel master)
• Flutter at /Users/baraka/flutter
• Framework revision 80e159d469 (4 hours ago), 2017-11-01 10:29:37 -0700
• Engine revision ddd51597d0
• Tools Dart version 1.25.0-dev.11.0
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.0)
• Android SDK at /Users/baraka/Library/Android/sdk
• Platform android-27, build-tools 27.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.0.1, Build version 9A1004
• ios-deploy 1.9.2
• CocoaPods version 1.1.1
[✓] Android Studio (version 2.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)
[✓] IntelliJ IDEA Community Edition (version 2017.2.5)
• Flutter plugin version 18.3
• Dart plugin version 172.4343.25
[✓] Connected devices
• Nexus 4 • 07ad4650db91e966 • android-arm • Android 4.4 (API 19)
• Richard’s iPhone • 17a4fc503dedd88b69f26902292adbec900c6056 • ios • iOS 11.0.3
````
@num46664
The issue at https://github.com/flutter/flutter/issues/12828 has been closed and moved here. Future collaboration on this issue will be done here.
Any progress on this issue?
@sandeepcmsm did you found any solution? @saitbnzl solution worked for you?
@sandeepcmsm did you found any solution? @saitbnzl solution worked for you?
no.
@LOG-TAG This worked for me.
Hey all 👋
As part of our roadmap (#2582) we've just shipped a complete rework of the firebase_messaging plugin that aims to solve this and many other issues. We now have a documentation section specifically for setting up the notification extension to handle images. If you spot any issues please propose a change to the docs via a PR (there's an Edit button on the bottom of every page).
If you can, please try out the dev release (see the migration guide for upgrading and for changes) and if you have any feedback then join in the discussion here.
Given the scope of the rework I'm going to go ahead and close this issue in favor of trying out the latest plugin.
Thanks everyone.
Most helpful comment
Any progress on this issue?