Skip to content

Conversation

@maksymmalyhin
Copy link
Contributor

Changes required for #2591.

  • GULAppDelegateSwizzler - remote notifications methods support
  • GULAppDelegateSwizzler tvOS support

This is a part of PR #2683. I have to merge the changes first to make sure macOS support is available for FirebaseMessaging

…public interface with no assumptions on the implementation details
Conflicts:
	Example/Messaging/Tests/FIRMessagingRemoteNotificationsProxyTest.m
…s applied to all targets. Move the hook to the top level to avoid confusion.
…etProxyOriginalDelegateOnceToken] at the beginning of each test.
@paulb777
Copy link
Member

paulb777 commented Apr 2, 2019

Consider targeting the PR to mm/messaging-swizzling instead of master to make it easier to review.

@maksymmalyhin
Copy link
Contributor Author

@paulb777 This PR is just a part of mm/messaging-swizzling that has to be merged earlier to allow Cocoapods lint to pass. From that prospective, the diff between this branch and mm/messaging-swizzling does not make sense.

@maksymmalyhin maksymmalyhin self-assigned this Apr 2, 2019
static char const *const kGULHandleBackgroundSessionIMPKey = "GUL_handleBackgroundSessionIMP";
static char const *const kGULOpenURLOptionsIMPKey = "GUL_openURLOptionsIMP";

#if TARGET_OS_IOS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Move this to the end of this list and add a comment mentioning this method is only available on iOS and not on tvOS.

fromClass:realClass];
NSValue *continueUserActivityIMPPointer = [NSValue valueWithPointer:continueUserActivityIMP];

#if TARGET_OS_IOS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Move this to the end of the method.

SEL didReceiveRemoteNotificationWithCompletionSEL =
@selector(application:didReceiveRemoteNotification:fetchCompletionHandler:);
if ([anObject respondsToSelector:didReceiveRemoteNotificationWithCompletionSEL]) {
// Only add the application:didReceiveRemoteNotification:fetchCompletionHandler: method if
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

#if TARGET_OS_IOS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: move to end of the list.

*
* @return the current UIApplication if in an app, or nil if in extension or if it doesn't exist.
*/
+ (nullable UIApplication *)sharedApplication;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have you moved this to the public header? Do consumers of the AppDelegateSwizzler need this?

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 I think, I needed it in one of the versions of Messaging, but forgot to remove.

@maksymmalyhin maksymmalyhin merged commit 8cc5d65 into master Apr 3, 2019
charlotteliang added a commit that referenced this pull request Apr 3, 2019
maksymmalyhin added a commit that referenced this pull request Apr 4, 2019
maksymmalyhin added a commit that referenced this pull request Apr 4, 2019
Corrob pushed a commit that referenced this pull request Apr 25, 2019
@maksymmalyhin maksymmalyhin deleted the mm/app-swizzler-apns branch May 14, 2019 15:53
@firebase firebase locked and limited conversation to collaborators Oct 18, 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.

4 participants