By default, FirebaseMessaging uses method swizzling to handle push notifications. You’ll handle all the code yourself, so turn this off using the plist entry you just added.
FirebaseAppDelegateProxyEnabled: NO
I was wondering why should someone disable swizzling? I know it’s an override selector that helps firebase SDK do internal some overrides which helps developers to have less code implementation.
I believe someone with default behaviour with swizzling enabled, should not have any issues. right?
Except if in an app has already swizzling with similar selector methods and is causing issues (edge case I think).
Someone who reads this article might get confused that it is required / necessary to disable swizzling. Sounds misleading a bit I think. I read in the firebase documentation that it is a preference to disable swizzling.
Any thoughts about this? I think it’s not clear about this neither in the firebase documentation or in the article I read about it.
I wouldn’t say it’s bad to use swizzling. But, when you consider that it overrides something in a way you don’t necessarily understand, you may want to disable this for large/company projects. It is entirely up to you. I’ve had experiences that were difficult to track down when a library swizzled something, and never encountered issues with other libraries doing it. To say you should just allow it to happen because a library wants to do it isn’t the right answer, IMO. I’m a bit more skeptical, which led to this tutorial decision. Plus, if you handle things in a way that’s “default,” you could swap out the library without having to worry too much about the rest of your code not working. Again, all a preference, and no answer is “right.”