capacitor-community / fcm

Enable Firebase Cloud Messaging for Capacitor apps
https://capacitor.ionicframework.com/docs/
MIT License
237 stars 83 forks source link

FirebaseCore was removed and is still needed by the code the plugin injects #69

Closed cgadam closed 3 years ago

cgadam commented 3 years ago

Describe the bug The removal of FirebaseCore here: https://github.com/capacitor-community/fcm/commit/38f186b09525ee681360b4437ed38c1cc57cb981#r51330784 is causing compilation issues as the code the plugin injects actually uses it.

To Reproduce Steps to reproduce the behavior:

  1. Install version fcm v1.1.1 into existing project
  2. Try to compile using XCode
  3. You still get compilation issues.

Expected behavior No compilation issues

stewones commented 3 years ago

Your existing project might have some plugin which requires it, but fcm itself doesn't. Did you try adding FirebaseCore in your app pod?

cgadam commented 3 years ago

@stewones , yep, once I added to my project's pod, it did work.

Turns out Firebase Core is still being used by the code injected by the plugin here: https://github.com/capacitor-community/fcm/blob/master/ios/Plugin/Plugin/Plugin.swift#L6

And if you remove Firebase Core you won’t be able to do: https://github.com/capacitor-community/fcm/blob/master/ios/Plugin/Plugin/Plugin.swift#L21

stewones commented 3 years ago

yes you right good catch. we should get rid of that import too

cgadam commented 3 years ago

@stewones FirebaseCore should probably be also removed from.. https://github.com/capacitor-community/fcm/blob/master/CapacitorCommunityFcm.podspec#L13 ? I guess.

stewones commented 3 years ago

@stewones FirebaseCore should probably be also removed from.. https://github.com/capacitor-community/fcm/blob/master/CapacitorCommunityFcm.podspec#L13 ? I guess.

Yeah, I will patch asap

stewones commented 3 years ago

@cgadam can you please try a fresh install from 1.1.2 ?

I did test with the example inside this project and it worked just fine. the reason I removed FirebaseCore from the plugin podspec is because it's already being installed as a peer dependency by FirebaseMessaging as you can see in here

https://cocoapods.org/pods/FirebaseMessaging

I'm closing for now but feel free to reopen

Thank you