customerio / customerio-flutter

Flutter plugin for Customer.io
https://www.customer.io/docs/sdk/flutter/getting-started/
MIT License
12 stars 10 forks source link

Will there be any issue if the firebase is configured on both iOS and dart side. #62

Closed Imgkl closed 1 year ago

Imgkl commented 1 year ago

Hello,

I'm trying to setup rich notifications on iOS. Because I need metrics on delivered and opened. According to docs, I need to make native side changes. but I'm confused on one thing, we already have firebase messaging as our push provider and we initiate the firebase on dart side + requesting notification permissions on dart side. but the docs mentioned, to add these code

 // Configure Firebase
     FirebaseApp.configure()

     // in case, you haven't asked for permissions  
     let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound] // Options: .alert, .badge, .sound
     UNUserNotificationCenter.current().requestAuthorization(options: authOptions, completionHandler: {

         (granted, error) in

         if granted {
             // Register after we get the permissions.
             UNUserNotificationCenter.current().delegate = self
         }
     })        

     // Set FCM messaging delegate
     Messaging.messaging().delegate = self

     // You should register for remote push when the app starts.
     UIApplication.shared.registerForRemoteNotifications()

I'm confused on why this is needed, since I already do this on dart side,

levibostian commented 1 year ago

Great question! Thanks for asking.

When using our Flutter SDK today, there is some native code that is required. However, because you mentioned that you already have Firebase setup using dart, you may not need all of the native code.

While following the push setup instructions for our Flutter SDK, be sure to follow all of the instructions, including all of the native code setup. This includes the AppDelegate instructions and creating a new target in Xcode and adding the NotificationService class.

The only part that you could modify is FCM device token registration.

You can try to remove this native code from your app:

 func application(
     _ application: UIApplication,
     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
 ) -> Bool {
     FirebaseApp.configure() // <-- remove this 

     Messaging.messaging().delegate = self // <-- remove this 
   }

// Remove this entire `extension AppDelegate: MessagingDelegate` block 
 extension AppDelegate: MessagingDelegate {
   func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {
     MessagingPush.shared.messaging(messaging, didReceiveRegistrationToken: fcmToken)
   }
 }
// 

Then, in your dart code, when the Firebase SDK provides a device token to your app, send that device token to the CustomerIO Flutter SDK:

CustomerIO.registerDeviceToken(deviceToken: '<device token provided by Firebase SDK>')

All of the other native code is required to enable features such as opened and delivered push metrics.

This native code should not interfere with the dart Firebase SDK. Yes, the native code is the only way today to enable push metrics in a Flutter app.

Imgkl commented 1 year ago

@levibostian thanks I did tried what you mentioned with few modification to the code from the docs.

Now I get this error. I guess flavors are messing with the rich notifications setup.

Error (Xcode): Cycle inside Runner; building could produce unreliable results.
Cycle details:
→ Target 'Runner': CodeSign /Users/Gokul/Downloads/Work Stuff/magnifi-mobile-app/build/ios/Debug-staging-iphonesimulator/Runner.app
○ That command depends on command in Target 'Runner': script phase “[CP] Embed Pods Frameworks”
○ That command depends on command in Target 'Runner': script phase “Copy GoogleServices.Plist depending on flavor”
○ That command depends on command in Target 'Runner': script phase “Thin Binary”
○ Target 'Runner' has process command with output '/Users/Gokul/Downloads/Work Stuff/magnifi-mobile-app/build/ios/Debug-staging-iphonesimulator/Runner.app/Info.plist'
○ Target 'Runner' has copy command from '/Users/Gokul/Downloads/Work Stuff/magnifi-mobile-app/build/ios/Debug-staging-iphonesimulator/NotificationServiceExtention.appex' to '/Users/Gokul/Downloads/Work Stuff/magnifi-mobile-app/build/ios/Debug-staging-iphonesimulator/Runner.app/PlugIns/NotificationServiceExtention.appex'

Raw dependency cycle trace:

target:  ->

node: <all> ->

command: <all> ->

node: /Users/Gokul/Downloads/Work Stuff/magnifi-mobile-app/build/ios/Debug-staging-iphonesimulator/Runner.app/_CodeSignature ->

command: P0:target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49-:Debug-staging:CodeSign /Users/Gokul/Downloads/Work Stuff/magnifi-mobile-app/build/ios/Debug-staging-iphonesimulator/Runner.app ->

node: /Users/Gokul/Downloads/Work Stuff/magnifi-mobile-app/build/ios/Debug-staging-iphonesimulator/Runner.app/Frameworks/Alamofire.framework/ ->

directoryTreeSignature: � ->

directoryContents: /Users/Gokul/Downloads/Work Stuff/magnifi-mobile-app/build/ios/Debug-staging-iphonesimulator/Runner.app/Frameworks/Alamofire.framework ->

node: /Users/Gokul/Downloads/Work Stuff/magnifi-mobile-app/build/ios/Debug-staging-iphonesimulator/Runner.app/Frameworks/Alamofire.framework ->

command: P2:target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49-:Debug-staging:PhaseScriptExecution [CP] Embed Pods Frameworks /Users/Gokul/Library/Developer/Xcode/DerivedData/Runner-awnrwydsjbkumjewxzhtrvyqttwm/Build/Intermediates.noindex/Runner.build/Debug-staging-iphonesimulator/Runner.build/Script-DF6C8D67CA4379C61BADF79D.sh ->

node: /Users/Gokul/Library/Developer/Xcode/DerivedData/Runner-awnrwydsjbkumjewxzhtrvyqttwm/Build/Intermediates.noindex/Runner.build/Debug-staging-iphonesimulator/Runner.build/InputFileList-DF6C8D67CA4379C61BADF79D-Pods-Runner-frameworks-Debug-staging-input-files-b1fff4ece98ae9a5785cb17be7e36d0f-resolved.xcfilelist ->

command: P2:target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49-:Debug-staging:WriteAuxiliaryFile /Users/Gokul/Library/Developer/Xcode/DerivedData/Runner-awnrwydsjbkumjewxzhtrvyqttwm/Build/Intermediates.noindex/Runner.build/Debug-staging-iphonesimulator/Runner.build/InputFileList-DF6C8D67CA4379C61BADF79D-Pods-Runner-frameworks-Debug-staging-input-files-b1fff4ece98ae9a5785cb17be7e36d0f-resolved.xcfilelist ->

CYCLE POINT ->

node: <target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49--fused-phase5-copy-googleservices-plist-depending-on-flavor> ->

command: P0:::Gate target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49--fused-phase5-copy-googleservices-plist-depending-on-flavor ->

node: <execute-shell-script-18c1723432283e0cc55f10a6dcfd9e02e959943d87f407fd09b34c83311eb3e6-target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49-> ->

command: P2:target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49-:Debug-staging:PhaseScriptExecution Copy GoogleServices.Plist depending on flavor /Users/Gokul/Library/Developer/Xcode/DerivedData/Runner-awnrwydsjbkumjewxzhtrvyqttwm/Build/Intermediates.noindex/Runner.build/Debug-staging-iphonesimulator/Runner.build/Script-5593BB0F26D17CDA00A0020C.sh ->

node: /Users/Gokul/Library/Developer/Xcode/DerivedData/Runner-awnrwydsjbkumjewxzhtrvyqttwm/Build/Intermediates.noindex/Runner.build/Debug-staging-iphonesimulator/Runner.build/Script-5593BB0F26D17CDA00A0020C.sh ->

command: P2:target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49-:Debug-staging:WriteAuxiliaryFile /Users/Gokul/Library/Developer/Xcode/DerivedData/Runner-awnrwydsjbkumjewxzhtrvyqttwm/Build/Intermediates.noindex/Runner.build/Debug-staging-iphonesimulator/Runner.build/Script-5593BB0F26D17CDA00A0020C.sh ->

node: <target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49--fused-phase4-thin-binary> ->

command: P0:::Gate target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49--fused-phase4-thin-binary ->

node: <execute-shell-script-18c1723432283e0cc55f10a6dcfd9e02f1eee2015e8ff5ebcd27678f788c2826-target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49-> ->

command: P2:target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49-:Debug-staging:PhaseScriptExecution Thin Binary /Users/Gokul/Library/Developer/Xcode/DerivedData/Runner-awnrwydsjbkumjewxzhtrvyqttwm/Build/Intermediates.noindex/Runner.build/Debug-staging-iphonesimulator/Runner.build/Script-3B06AD1E1E4923F5004D2608.sh ->

node: /Users/Gokul/Downloads/Work Stuff/magnifi-mobile-app/build/ios/Debug-staging-iphonesimulator/Runner.app/Info.plist/ ->

directoryTreeSignature: r ->

directoryContents: /Users/Gokul/Downloads/Work Stuff/magnifi-mobile-app/build/ios/Debug-staging-iphonesimulator/Runner.app/Info.plist ->

node: /Users/Gokul/Downloads/Work Stuff/magnifi-mobile-app/build/ios/Debug-staging-iphonesimulator/Runner.app/Info.plist ->

command: P0:target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49-:Debug-staging:ProcessInfoPlistFile /Users/Gokul/Downloads/Work Stuff/magnifi-mobile-app/build/ios/Debug-staging-iphonesimulator/Runner.app/Info.plist /Users/Gokul/Downloads/Work Stuff/magnifi-mobile-app/ios/Runner/Info.plist ->

node: /Users/Gokul/Downloads/Work Stuff/magnifi-mobile-app/build/ios/Debug-staging-iphonesimulator/Runner.app/PlugIns/NotificationServiceExtention.appex ->

command: P0:target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49-:Debug-staging:Copy /Users/Gokul/Downloads/Work Stuff/magnifi-mobile-app/build/ios/Debug-staging-iphonesimulator/Runner.app/PlugIns/NotificationServiceExtention.appex /Users/Gokul/Downloads/Work Stuff/magnifi-mobile-app/build/ios/Debug-staging-iphonesimulator/NotificationServiceExtention.appex ->

node: <target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49--fused-phase6--cp--embed-pods-frameworks> ->

command: P0:::Gate target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49--fused-phase6--cp--embed-pods-frameworks ->

node: <target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49--fused-phase5-copy-googleservices-plist-depending-on-flavor>
levibostian commented 1 year ago

Updated my iOS minimum deployment target to 14 as the pod's minimum deployment target was 14

The Customer.io SDK has a minimum target of 13. What SDK has a minimum target of 14?

had to add use_frameworks! in

This is quite common to add.

Now I get this error.

If I had to guess, coccoapods did not succeed in generating the Xcode workspace.

Could you run the command pod install --repo-update --project-directory=ios in your project and send me the output of running that? It would also be helpful to see the contents of your Podfile.

Imgkl commented 1 year ago

changed the minimum deployment target to 13.

image

Logs

pod install --repo-update --project-directory=ios ``` ❯ pod install --repo-update --project-directory=ios Updating local specs repositories CocoaPods 1.12.1 is available. To update use: `sudo gem install cocoapods` For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.12.1 Analyzing dependencies cloud_firestore: Using Firebase SDK version '10.9.0' defined in 'firebase_core' firebase_analytics: Using Firebase SDK version '10.9.0' defined in 'firebase_core' firebase_core: Using Firebase SDK version '10.9.0' defined in 'firebase_core' firebase_dynamic_links: Using Firebase SDK version '10.9.0' defined in 'firebase_core' firebase_messaging: Using Firebase SDK version '10.9.0' defined in 'firebase_core' firebase_performance: Using Firebase SDK version '10.9.0' defined in 'firebase_core' Downloading dependencies Installing Alamofire (4.9.1) Installing Amplitude (8.17.1) Installing Analytics (4.1.6) Installing AnalyticsConnector (1.0.1) Installing AppAuth (1.6.2) Installing AppsFlyerFramework (6.9.1) Installing BoringSSL-GRPC (0.0.24) Installing CryptoSwift (1.7.1) Installing CustomerIO (2.7.7) Installing CustomerIOCommon (2.7.7) Installing CustomerIOMessagingInApp (2.7.7) Installing CustomerIOMessagingPush (2.7.7) Installing CustomerIOMessagingPushFCM (2.7.7) Installing CustomerIOTracking (2.7.7) Installing FBAEMKit (15.1.0) Installing FBAudienceNetwork (6.14.0) Installing FBSDKCoreKit (15.1.0) Installing FBSDKCoreKit_Basics (15.1.0) Installing FMDB (2.7.5) Installing Firebase (10.9.0) Installing FirebaseABTesting (10.13.0) Installing FirebaseAnalytics (10.9.0) Installing FirebaseCore (10.9.0) Installing FirebaseCoreExtension (10.13.0) Installing FirebaseCoreInternal (10.13.0) Installing FirebaseDynamicLinks (10.9.0) Installing FirebaseFirestore (10.9.0) Installing FirebaseInstallations (10.13.0) Installing FirebaseMessaging (10.9.0) Installing FirebasePerformance (10.9.0) Installing FirebaseRemoteConfig (10.13.0) Installing FirebaseSessions (10.13.0) Installing Flutter (1.0.0) Installing GTMAppAuth (1.3.1) Installing GTMSessionFetcher (2.3.0) Installing GoogleAppMeasurement (10.9.0) Installing GoogleDataTransport (9.2.5) Installing GoogleSignIn (6.2.4) Installing GoogleUtilities (7.11.5) Installing IOSSecuritySuite (1.9.9) Installing Libuv-gRPC (0.0.10) Installing OktaAuthFoundation (1.4.2) Installing OktaAuthSdk (2.4.3) Installing OktaIdx (3.0.9) Installing Plaid (4.2.0) Installing PromisesObjC (2.3.1) Installing PromisesSwift (2.3.1) Installing PurchasesHybridCommon (5.2.3) Installing ReachabilitySwift (5.0.0) Installing RevenueCat (4.23.1) Installing Segment-Amplitude (3.3.2) Installing Sentry (8.7.2) Installing SentryPrivate (8.7.2) Installing Try (2.1.1) Installing abseil (1.20211102.0) Installing app_links (0.0.1) Installing app_tracking_transparency (0.0.1) Installing appsflyer_sdk (6.8.0) Installing cloud_firestore (4.7.1) Installing connectivity_plus (0.0.1) Installing customer_io (1.2.3) Installing device_info_plus (0.0.1) Installing facebook_app_events (0.0.1) Installing firebase_analytics (10.4.1) Installing firebase_core (2.13.0) Installing firebase_dynamic_links (5.0.17) Installing firebase_messaging (14.3.0) Installing firebase_performance (0.9.0-16) Installing flutter_jailbreak_detection (1.0.0) Installing flutter_keyboard_visibility (0.0.1) Installing flutter_secure_storage (6.0.0) Installing flutter_segment (3.12.1) Installing gRPC-C++ (1.44.0) Installing gRPC-Core (1.44.0) Installing gallery_saver (0.0.1) Installing google_sign_in_ios (0.0.1) Installing http_certificate_pinning (1.0.3) Installing image_picker_ios (0.0.1) Installing launch_review (0.0.1) Installing leveldb-library (1.22.2) Installing local_auth_ios (0.0.1) Installing nanopb (2.30909.0) Installing okta_idx_flutter (0.0.1) Installing open_filex (0.0.2) Installing package_info_plus (0.4.5) Installing path_provider_foundation (0.0.1) Installing permission_handler_apple (9.0.4) Installing plaid_flutter (0.0.1) Installing purchases_flutter (5.2.2) Installing quick_actions_ios (0.0.1) Installing segment-appsflyer-ios (6.9.1) Installing sentry_flutter (0.0.1) Installing shared_preferences_foundation (0.0.1) Installing sign_in_with_apple (0.0.1) Installing speech_to_text (0.0.1) Installing sqflite (0.0.2) Installing syncfusion_flutter_pdfviewer (0.0.1) Installing uni_links (0.0.1) Installing url_launcher_ios (0.0.1) Installing webview_flutter_wkwebview (0.0.1) Generating Pods project Integrating client project Pod installation complete! There are 42 dependencies from the Podfile and 100 total pods installed. [!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.debug-prod.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.debug-prod.xcconfig` in your build configuration (`Flutter/Debug.xcconfig`). [!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.debug-staging.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.debug-staging.xcconfig` in your build configuration (`Flutter/Debug.xcconfig`). [!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.release-prod.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.release-prod.xcconfig` in your build configuration (`Flutter/Release.xcconfig`). [!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.release-staging.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.release-staging.xcconfig` in your build configuration (`Flutter/Release.xcconfig`). [!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile-prod.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.profile-prod.xcconfig` in your build configuration (`Flutter/Release.xcconfig`). [!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile-staging.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.profile-staging.xcconfig` in your build configuration (`Flutter/Release.xcconfig`). [!] The `Runner [Debug-prod]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-Runner/Pods-Runner.debug-prod.xcconfig'. This can lead to problems with the CocoaPods installation - Use the `$(inherited)` flag, or - Remove the build settings from the target. [!] The `Runner [Debug-staging]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-Runner/Pods-Runner.debug-staging.xcconfig'. This can lead to problems with the CocoaPods installation - Use the `$(inherited)` flag, or - Remove the build settings from the target. [!] The `Runner [Release-prod]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-Runner/Pods-Runner.release-prod.xcconfig'. This can lead to problems with the CocoaPods installation - Use the `$(inherited)` flag, or - Remove the build settings from the target. [!] The `Runner [Release-staging]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-Runner/Pods-Runner.release-staging.xcconfig'. This can lead to problems with the CocoaPods installation - Use the `$(inherited)` flag, or - Remove the build settings from the target. [!] The `Runner [Profile-prod]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-Runner/Pods-Runner.profile-prod.xcconfig'. This can lead to problems with the CocoaPods installation - Use the `$(inherited)` flag, or - Remove the build settings from the target. [!] The `Runner [Profile-staging]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-Runner/Pods-Runner.profile-staging.xcconfig'. This can lead to problems with the CocoaPods installation - Use the `$(inherited)` flag, or - Remove the build settings from the target. [!] The `NotificationServiceExtention [Debug-prod]` target overrides the `CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER` build setting defined in `Pods/Target Support Files/Pods-NotificationServiceExtention/Pods-NotificationServiceExtention.debug-prod.xcconfig'. This can lead to problems with the CocoaPods installation - Use the `$(inherited)` flag, or - Remove the build settings from the target. [!] The `NotificationServiceExtention [Debug-staging]` target overrides the `CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER` build setting defined in `Pods/Target Support Files/Pods-NotificationServiceExtention/Pods-NotificationServiceExtention.debug-staging.xcconfig'. This can lead to problems with the CocoaPods installation - Use the `$(inherited)` flag, or - Remove the build settings from the target. [!] The `NotificationServiceExtention [Release-prod]` target overrides the `CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER` build setting defined in `Pods/Target Support Files/Pods-NotificationServiceExtention/Pods-NotificationServiceExtention.release-prod.xcconfig'. This can lead to problems with the CocoaPods installation - Use the `$(inherited)` flag, or - Remove the build settings from the target. [!] The `NotificationServiceExtention [Release-staging]` target overrides the `CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER` build setting defined in `Pods/Target Support Files/Pods-NotificationServiceExtention/Pods-NotificationServiceExtention.release-staging.xcconfig'. This can lead to problems with the CocoaPods installation - Use the `$(inherited)` flag, or - Remove the build settings from the target. [!] The `NotificationServiceExtention [Profile-prod]` target overrides the `CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER` build setting defined in `Pods/Target Support Files/Pods-NotificationServiceExtention/Pods-NotificationServiceExtention.profile-prod.xcconfig'. This can lead to problems with the CocoaPods installation - Use the `$(inherited)` flag, or - Remove the build settings from the target. [!] The `NotificationServiceExtention [Profile-staging]` target overrides the `CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER` build setting defined in `Pods/Target Support Files/Pods-NotificationServiceExtention/Pods-NotificationServiceExtention.profile-staging.xcconfig'. This can lead to problems with the CocoaPods installation - Use the `$(inherited)` flag, or - Remove the build settings from the target. ```
PodFile ``` # Uncomment this line to define a global platform for your project platform :ios, '13.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' project 'Runner', { 'Debug' => :debug, 'Profile' => :release, 'Release' => :release, } def flutter_root generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) unless File.exist?(generated_xcode_build_settings_path) raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" end File.foreach(generated_xcode_build_settings_path) do |line| matches = line.match(/FLUTTER_ROOT\=(.*)/) return matches[1].strip if matches end raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" end require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) flutter_ios_podfile_setup target 'Runner' do use_frameworks! use_modular_headers! pod 'CustomerIO/MessagingPushFCM', '~> 2.7.4' flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end target 'NotificationServiceExtention' do use_frameworks! pod 'CustomerIO/MessagingPushFCM', '~> 2.7.4' end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) target.build_configurations.each do |config| if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle" target.build_configurations.each do |config| config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO' end end config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0' config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ '$(inherited)', 'PERMISSION_CAMERA=1', ] end end end ```
levibostian commented 1 year ago

Thanks for that information. That's very helpful.

Looking at the Podfile you sent, this file seems similar to the Podfile of our sample Flutter app. Therefore, I do not believe that Podfile is causing this issue for you.

Could you provide more details what steps that you're taking to reproduce this issue? What steps are you taking or commands you're running to get to the error Error (Xcode):?

Imgkl commented 1 year ago

No actually, after making all the changes outlined above and the docs. When I try to run the app, the build get failed with the above xcode error.

levibostian commented 1 year ago

I suggest searching online for Flutter build flavors with a Notification Service Extension. Or, help with the error message that you received.

If that does not help, you could send us (win@customer.io) a small demo Flutter application that reproduces this error. We can take a closer took from there.

Imgkl commented 1 year ago

Sure @levibostian.

Imgkl commented 1 year ago

the error looks like conflict between flavors and the native implementation of customer.io. Nothing wrong with the package, Closing this issue for now, Wil reopen If needed.