Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does FirebaseAppDelegateProxyEnabled do?

My issue (background notifications):

I am using React Native Firebase. Everything is fine until recently I updated to version 6.7.1 of the library. After the update background notification(while app is closed) stopped working. Foreground is working.

I found a suggestion here, to turn FirebaseAppDelegateProxyEnabled to YES in info.plist.

And it did work! I can receive notifications fine now.

But what is swizzling?

I don't really understand what is this method of swizzling do, and what is the difference between setting it YES or NO do? I read about it in firebase documentation: Method swizzling in Firebase Cloud Messaging. I couldn't get it really. Can someone explain in a clearer way, and what difference does it make?

like image 817
Kash Avatar asked May 12 '20 13:05

Kash


2 Answers

By enabling FirebaseAppDelegateProxyEnabled (method swizzling) you allow Firebase frameworks to get all necessary work done without your code. They now can use their own method implementations for registering to receive remote notifications and probably handling them.

Method swizzling: to make story short, it is about exchanging method's implementations. For example, if you have a UIViewController and it has method viewDidLoad(), it does some work under the hood (at least when you call super.viewDidLoad()). So you can swizzle it with your custom implementation and do whatever you want there

like image 77
pash3r Avatar answered Nov 14 '22 23:11

pash3r


Important: With the Firebase Unity SDK on iOS, do not disable method swizzling. Swizzling is required by the SDK, and without it key Firebase features such as FCM token handling do not function properly.

like image 34
vatana chhorn Avatar answered Nov 14 '22 23:11

vatana chhorn