Skip to content

Commit

Permalink
[Messaging] Prep FIRMessagingExtensionHelper usage for refactored 1…
Browse files Browse the repository at this point in the history
…P target (#13691)
  • Loading branch information
ncooke3 authored Sep 23, 2024
1 parent 59c5703 commit 846a41f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions FirebaseMessaging/Sources/FIRMessaging.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@
#import "FirebaseMessaging/Sources/FIRMessagingUtilities.h"
#import "FirebaseMessaging/Sources/FIRMessaging_Private.h"
#import "FirebaseMessaging/Sources/NSError+FIRMessaging.h"
#if __has_include( \
"FirebaseMessaging/Sources/Public/FirebaseMessaging/FIRMessagingExtensionHelper.h")
#import "FirebaseMessaging/Sources/Public/FirebaseMessaging/FIRMessagingExtensionHelper.h"
#endif // __has_include("FirebaseMessaging/Sources/Public/FirebaseMessaging/FIRMessagingExtensionHelper.h")
#import "FirebaseMessaging/Sources/Token/FIRMessagingAuthService.h"
#import "FirebaseMessaging/Sources/Token/FIRMessagingTokenInfo.h"
#import "FirebaseMessaging/Sources/Token/FIRMessagingTokenManager.h"
Expand Down Expand Up @@ -131,6 +134,8 @@ + (FIRMessaging *)messaging {
return (FIRMessaging *)instance;
}

#if __has_include( \
"FirebaseMessaging/Sources/Public/FirebaseMessaging/FIRMessagingExtensionHelper.h")
+ (FIRMessagingExtensionHelper *)extensionHelper {
static dispatch_once_t once;
static FIRMessagingExtensionHelper *extensionHelper;
Expand All @@ -139,6 +144,8 @@ + (FIRMessagingExtensionHelper *)extensionHelper {
});
return extensionHelper;
}
#endif // __has_include("FirebaseMessaging/Sources/Public/FirebaseMessaging/FIRMessagingExtensionHelper.h")

- (instancetype)initWithAnalytics:(nullable id<FIRAnalyticsInterop>)analytics
userDefaults:(GULUserDefaults *)defaults
heartbeatLogger:(FIRHeartbeatLogger *)heartbeatLogger {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ NS_SWIFT_NAME(MessagingMessageInfo)
@end

@class FIRMessaging;
#if __has_include("FIRMessagingExtensionHelper.h")
@class FIRMessagingExtensionHelper;
#endif // __has_include("FIRMessagingExtensionHelper.h")

/**
* A protocol to handle token update or data message delivery from FCM.
Expand Down Expand Up @@ -184,6 +186,7 @@ NS_SWIFT_NAME(Messaging)
*/
+ (instancetype)messaging NS_SWIFT_NAME(messaging());

#if __has_include("FIRMessagingExtensionHelper.h")
/**
* Use the MessagingExtensionHelper to populate rich UI content for your notifications.
* For example, if an image URL is set in your notification payload or on the console,
Expand All @@ -194,6 +197,7 @@ NS_SWIFT_NAME(Messaging)
*/
+ (FIRMessagingExtensionHelper *)extensionHelper NS_SWIFT_NAME(serviceExtension())
NS_AVAILABLE(10.14, 10.0);
#endif // __has_include("FIRMessagingExtensionHelper.h")

/**
* Unavailable. Use +messaging instead.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@
*/

#import "FIRMessaging.h"
#if __has_include("FIRMessagingExtensionHelper.h")
#import "FIRMessagingExtensionHelper.h"
#endif // __has_include("FIRMessagingExtensionHelper.h")

0 comments on commit 846a41f

Please sign in to comment.