aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Example/SwiftBuildTest/main.swift
diff options
context:
space:
mode:
authorGravatar Riz <rsattar@gmail.com>2017-10-04 18:39:30 -0700
committerGravatar GitHub <noreply@github.com>2017-10-04 18:39:30 -0700
commit5496eff88f3d1c386f10a3765afa0373cff12e17 (patch)
treec58460582911563881b777773021aa3a99d92c6e /Firestore/Example/SwiftBuildTest/main.swift
parent641b7c3a06fae6277a0430f2d4d2cb081a214969 (diff)
Don't swizzle missing and optional delegate methods
FCM's swizzling of the user notification center currently swizzles only one of the two optional delegate methods (userNotificationCenter:willPresentNotification:withCompletionHandler:), but not the other (userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:). The didReceiveNotificationResponse, if implemented by the delegate, is the sole receiver of all user action on a notification, including simply tapping on the notification itself. Prior to this change, if the developer had implemented didReceiveNotificationResponse, then FCM would not be able to collect this event for analytics. Additionally, I changed the logic in FIRMessagingRemoteNotificationsProxy to check whether these methods are actually implemented before swizzling them. It was always swizzling, which meant it was adding an implementation if the method didn't exist. This would confuse iOS into thinking the developer did implement these methods and NOT fall back to delivering the notifications to the application delegate. With this change, if the developer did not implement these methods, then FCM will not swizzle those methods. That keeps the behavior true to what the developer intended.
Diffstat (limited to 'Firestore/Example/SwiftBuildTest/main.swift')
0 files changed, 0 insertions, 0 deletions