-
Notifications
You must be signed in to change notification settings - Fork 1.7k
GULAppDelegateSwizzler - proxy APNS methods separately #2835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ead of internal `-proxyAppDelegate:`
…ificationMethods`
GoogleUtilities/Example/GoogleUtilities.xcodeproj/xcshareddata/xcschemes/Example_iOS.xcscheme
Show resolved
Hide resolved
… test FirebaseMessaging compatibility with extensions
|
Looks like the build failure is caused by #2851 and is not related to the PR |
| * | ||
| * @see proxyOriginalDelegate | ||
| */ | ||
| + (void)proxyOriginalDelegateRemoteNotificationMethods; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will have to make a change in Analytics as a result of this. Is this going to be a major version bump?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paulb777 Do you think we can update the analytics as a part of Copybara CL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this is blocking the release, I would vote to revert the renaming, and revisit it after the release is out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks fcm test app for extension, its better to fix this if its going out for breaking change release anyway. I am fine doing it in another pr but it has to be resolved if it is going into the i/o release.
tejasd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for more comments - I'm still getting used to GitHub's code review UI haha.
Implementation LGTM, just some comments for tests!
| - (void)skipped_testAppDelegateInstance { | ||
| id originalDelegate = [UIApplication sharedApplication].delegate; | ||
|
|
||
| GULTestAppDelegate *realAppDelegate = [[GULTestAppDelegate alloc] init]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is skipped_testAppDelegateInstance still disabled due to flakiness? If it is, can you make sure it passes locally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tejasd TBH, I didn't really pay attention to the skipped test, just kept it compilable... If you have a context why it has been marked as skipped? It looks like you were the last person changing it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was because it was flaky on Travis! (Works ok on the internal infrastructure, so should be caught when you copybara it)
| int _arbitraryNumber; | ||
| } | ||
|
|
||
| /** A URL property that is set by the app delegate methods, which is then used to verify if the app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might not be seeing it due to weird github diffs, but if it doesn't already exist, can you add a test that makes sure proxyOriginalDelegateIncludingAPNSMethods doesn't get swizzled when swizzling is disabled?
| handleEventsForBackgroundURLSession:completionHandler:)]); | ||
|
|
||
| // Remote notifications methods should be added only by | ||
| // -proxyOriginalDelegateIncludingAPNSMethods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might not be seeing it due to weird github diffs, but if it doesn't already exist, can you add a test that makes sure proxyOriginalDelegateIncludingAPNSMethods doesn't get swizzled when swizzling is disabled?
@tejasd It is tested here and in other places with such a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to test for situation where Swizzling is explicitly disabled, something like
firebase-ios-sdk/GoogleUtilities/Example/Tests/Swizzler/GULAppDelegateSwizzlerTest.m
Line 1157 in a4a94ce
| * flag is not present. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tejasd Ah, sorry, I misread the comment. I can add it. Do you think it is critical for this PR?
proxyOriginalDelegateIncludingAPNSMethods uses proxyOriginalDelegate under the hood, worked as expected is implied with the current implementation, so it could be a separate PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Followup PR should be ok! Thanks!
* Update versions for Release 6.0.0 * Update FirebaseSDKs.textproto with new fields. (#2818) (#2834) * Update FirebaseSDKs.textproto with new fields. * Update message about strip_32bits flag. * GULAppDelegateSwizzler - proxy APNS methods separately (#2835) (#2858) * Cherry-picks for M47 RC5 (#2882) * fix race condition checkin is deleted before writing during app start (#2860) * GoogleUtilities min ios version from 6 to 8 (#2876) * Put secret and oauth credentials into the private headers for now. (#2916) (#2919) * Add missing Messaging weak_framework dep (#2921) (#2930)
Fixes #2807
+ [GULAppDelegateSwizzler proxyOriginalDelegateRemoteNotificationMethods])