Skip to content

Conversation

@maksymmalyhin
Copy link
Contributor

@maksymmalyhin maksymmalyhin commented Apr 15, 2019

Fixes #2807

  • separate proxying of the APNs related methods (see method + [GULAppDelegateSwizzler proxyOriginalDelegateRemoteNotificationMethods])
  • don't swizzle APNs related methods until explicitly requested
  • use NSSelectorFromString and NSInvocation to avoid the Apple review warning
  • Messaging updated
  • Auth updated
  • Documentation comments and README updated

@maksymmalyhin maksymmalyhin requested a review from tejasd April 15, 2019 21:53
@maksymmalyhin maksymmalyhin self-assigned this Apr 15, 2019
@maksymmalyhin maksymmalyhin changed the title Mm/swizzle notifications GULAppDelegateSwizzler - proxy APNS methods separately Apr 16, 2019
@maksymmalyhin maksymmalyhin marked this pull request as ready for review April 16, 2019 14:49
@maksymmalyhin maksymmalyhin requested a review from tejasd April 17, 2019 15:15
@maksymmalyhin
Copy link
Contributor Author

Looks like the build failure is caused by #2851 and is not related to the PR

*
* @see proxyOriginalDelegate
*/
+ (void)proxyOriginalDelegateRemoteNotificationMethods;
Copy link
Contributor

@tejasd tejasd Apr 17, 2019

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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

Copy link
Member

@charlotteliang charlotteliang Apr 17, 2019

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.

@maksymmalyhin maksymmalyhin requested a review from tejasd April 17, 2019 19:47
Copy link
Contributor

@tejasd tejasd left a 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];
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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)

cb73b2f

int _arbitraryNumber;
}

/** A URL property that is set by the app delegate methods, which is then used to verify if the app
Copy link
Contributor

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
Copy link
Contributor Author

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

Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

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!

@maksymmalyhin maksymmalyhin merged commit 76aa880 into master Apr 17, 2019
@maksymmalyhin maksymmalyhin deleted the mm/swizzle-notifications branch April 18, 2019 14:45
paulb777 added a commit that referenced this pull request May 7, 2019
* 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)
@firebase firebase locked and limited conversation to collaborators Oct 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GoogleUtilities Swizzler, Missing Push Notification Entitlement

6 participants