Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b2eabf2
FIRAuthAppDelegateProxy: implementation updated to use GULAppDelegate…
maksymmalyhin Mar 26, 2019
4ab86de
GULAppDelegateSwizzler - make sure subclass name is unique.
maksymmalyhin Mar 27, 2019
1f1560a
GoogleUtilities: enable code coverage
maksymmalyhin Mar 27, 2019
f4a4638
Merge branch 'master'
maksymmalyhin Mar 27, 2019
9fcedce
GULAppDelegateSwizzler: Add support of remote notification methods
maksymmalyhin Mar 27, 2019
27c8b5b
GULAppDelegateSwizzler - tests for remote notification methods
maksymmalyhin Mar 27, 2019
dee28d3
Revert "FIRAuthAppDelegateProxy: implementation updated to use GULApp…
maksymmalyhin Mar 27, 2019
5821591
FIRMessaging: prepare to use GULAppDelegateSwizzler [WIP]
maksymmalyhin Mar 27, 2019
908b6ea
FIRMessagingRemoteNotificationsProxy - use GULAppDelegateSwizzler [WIP]
maksymmalyhin Mar 28, 2019
9e377d2
FIRMessagingRemoteNotificationsProxy - AppDelegate proxy - test only …
maksymmalyhin Mar 28, 2019
7861cde
FIRMessagingRemoteNotificationsProxy test only public API with no imp…
maksymmalyhin Mar 28, 2019
b7703ac
Cleanup
maksymmalyhin Mar 28, 2019
ad1da54
Cleanup
maksymmalyhin Mar 28, 2019
2bdf353
Merge branch 'master'
maksymmalyhin Mar 28, 2019
8eafece
Merge branch 'mm/messaging-tests'
maksymmalyhin Mar 28, 2019
e5d2ce8
Merge branch 'master'
maksymmalyhin Mar 29, 2019
86ff257
Cocoapods 1.6.1: Podfile supports only single post_install hook. It i…
maksymmalyhin Mar 29, 2019
79b7613
FIRMessagingRemoteNotificationsProxyTest: [GULAppDelegateSwizzler res…
maksymmalyhin Mar 29, 2019
98ffccb
FIRMessagingRemoteNotificationsProxy: app delegate missing methods te…
maksymmalyhin Mar 29, 2019
cd44395
GULAppDelegateSwizzler: don't swizzle invalid application delegate
maksymmalyhin Mar 29, 2019
3df4140
Cleanup
maksymmalyhin Mar 29, 2019
dcd0e10
Run ./scripts/check.sh
maksymmalyhin Mar 29, 2019
18381dd
Merge branch 'master'
maksymmalyhin Apr 1, 2019
dae75d9
GoogleUtilities/GULAppDelegateSwizzler - tvOS support
maksymmalyhin Apr 1, 2019
6dee8d3
style.sh generated changes
maksymmalyhin Apr 1, 2019
2726e7c
FirebaseMessaging - missing dependencies added
maksymmalyhin Apr 1, 2019
63fd1f5
FCM data channel messages - pass data to [FIRMessaging appDidReceiveM…
maksymmalyhin Apr 1, 2019
4a3fbb1
FIRMessagingRemoteNotificationsProxyTest - remove GULLoggerForceDebug()
maksymmalyhin Apr 2, 2019
b390f4f
GULAppDelegateSwizzler - add deprecated `application:didReceiveRemote…
maksymmalyhin Apr 2, 2019
236877d
Merge branch 'master'
maksymmalyhin Apr 3, 2019
3641d35
Merge branch 'master'
maksymmalyhin Apr 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
style.sh generated changes
  • Loading branch information
maksymmalyhin committed Apr 1, 2019
commit 6dee8d3beb1b674338b7ca72e1a08ba6d4961b7b
20 changes: 10 additions & 10 deletions GoogleUtilities/AppDelegateSwizzler/GULAppDelegateSwizzler.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ typedef void (*GULRealDidReceiveRemoteNotificationWithCompletionIMP)(
"GUL_openURLSourceApplicationAnnotationIMP";
static char const *const kGULRealDidReceiveRemoteNotificationIMPKey =
"GUL_didReceiveRemoteNotificationIMP";
#endif // TARGET_OS_IOS
#endif // TARGET_OS_IOS

static char const *const kGULRealDidRegisterForRemoteNotificationsIMPKey =
"GUL_didRegisterForRemoteNotificationsIMP";
Expand Down Expand Up @@ -379,12 +379,12 @@ + (void)createSubclassWithObject:(id<UIApplicationDelegate>)anObject {
fromClass:[GULAppDelegateSwizzler class]
toClass:appDelegateSubClass];
GULRealDidReceiveRemoteNotificationIMP didReceiveRemoteNotificationIMP =
(GULRealDidReceiveRemoteNotificationIMP)
[GULAppDelegateSwizzler implementationOfMethodSelector:didReceiveRemoteNotificationSEL
fromClass:realClass];
(GULRealDidReceiveRemoteNotificationIMP)
[GULAppDelegateSwizzler implementationOfMethodSelector:didReceiveRemoteNotificationSEL
fromClass:realClass];
NSValue *didReceiveRemoteNotificationIMPPointer =
[NSValue valueWithPointer:didReceiveRemoteNotificationIMP];
#endif // TARGET_OS_IOS
[NSValue valueWithPointer:didReceiveRemoteNotificationIMP];
#endif // TARGET_OS_IOS

// For application:handleEventsForBackgroundURLSession:completionHandler:
SEL handleEventsForBackgroundURLSessionSEL = @selector(application:
Expand Down Expand Up @@ -472,8 +472,8 @@ + (void)createSubclassWithObject:(id<UIApplicationDelegate>)anObject {
objc_setAssociatedObject(anObject, &kGULRealDidReceiveRemoteNotificationIMPKey,
didReceiveRemoteNotificationIMPPointer,
OBJC_ASSOCIATION_RETAIN_NONATOMIC);
#endif // TARGET_OS_IOS
#endif // TARGET_OS_IOS

objc_setAssociatedObject(anObject, &kGULRealDidRegisterForRemoteNotificationsIMPKey,
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 used the same way of storing the original implementations as for the old methods. But it looks like it can be optimized to avoid boilerplate (e.g. store the implementations in a dictionary).

Also, I think, some repeated code may be moved to separate methods.

@tejasd What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yup, that's definitely an option! Feel free to refactor that in a separate PR :)

didRegisterForRemoteNotificationsIMPPointer,
OBJC_ASSOCIATION_RETAIN_NONATOMIC);
Expand Down Expand Up @@ -697,7 +697,7 @@ - (BOOL)application:(UIApplication *)application
return returnedValue;
}

#endif // TARGET_OS_IOS
#endif // TARGET_OS_IOS

#pragma mark - [Donor Methods] Network overridden handler methods

Expand Down Expand Up @@ -852,7 +852,7 @@ - (void)application:(UIApplication *)application
}
}

#endif // TARGET_OS_IOS
#endif // TARGET_OS_IOS

+ (void)proxyAppDelegate:(id<UIApplicationDelegate>)appDelegate {
if (![appDelegate conformsToProtocol:@protocol(UIApplicationDelegate)]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ - (void)application:(UIApplication *)application
self.application = application;
self.remoteNotification = userInfo;
}
#endif // TARGET_OS_IOS
#endif // TARGET_OS_IOS

- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo
Expand Down Expand Up @@ -217,7 +217,7 @@ - (BOOL)application:(UIApplication *)application
_URLForIOS8 = [url copy];
return YES;
}
#endif // TARGET_OS_IOS
#endif // TARGET_OS_IOS

#if SDK_HAS_USERACTIVITY

Expand Down Expand Up @@ -288,8 +288,8 @@ - (void)testProxyAppDelegate {
respondsToSelector:@selector(application:openURL:sourceApplication:annotation:)]);

XCTAssertTrue([realAppDelegate respondsToSelector:@selector(application:
didReceiveRemoteNotification:)]);
#endif // TARGET_OS_IOS
didReceiveRemoteNotification:)]);
#endif // TARGET_OS_IOS

XCTAssertTrue([realAppDelegate respondsToSelector:@selector(application:
continueUserActivity:restorationHandler:)]);
Expand Down Expand Up @@ -603,7 +603,7 @@ - (void)testApplicationOpenURLSourceApplicationAnnotationResultIsORed {
// The result is YES if one of the interceptors returns YES.
XCTAssertTrue(shouldOpen);
}
#endif // TARGET_OS_IOS
#endif // TARGET_OS_IOS

/** Tests that application:handleEventsForBackgroundURLSession:completionHandler: is invoked on the
* interceptors if it exists.
Expand Down Expand Up @@ -785,7 +785,7 @@ - (void)testApplicationDidReceiveRemoteNotificationIsInvokedOnInterceptors {

XCTAssertEqual(testAppDelegate.application, application);
XCTAssertEqual(testAppDelegate.remoteNotification, notification);
#endif // TARGET_OS_IOS
#endif // TARGET_OS_IOS
}

- (void)testApplicationDidReceiveRemoteNotificationWithCompletionIsInvokedOnInterceptors {
Expand Down