diff --git a/FirebaseMessaging/Sources/FIRMessaging+ExtensionHelper.m b/FirebaseMessaging/Sources/FIRMessaging+ExtensionHelper.m index 1902d067062..0ff8d3dea04 100644 --- a/FirebaseMessaging/Sources/FIRMessaging+ExtensionHelper.m +++ b/FirebaseMessaging/Sources/FIRMessaging+ExtensionHelper.m @@ -30,8 +30,10 @@ + (FIRMessagingExtensionHelper *)extensionHelper { return extensionHelper; } +#if SWIFT_PACKAGE || COCOAPODS || FIREBASE_BUILD_CARTHAGE || FIREBASE_BUILD_ZIP_FILE /// Stub used to force the linker to include the categories in this file. void FIRInclude_FIRMessaging_ExtensionHelper_Category(void) { } +#endif // SWIFT_PACKAGE || COCOAPODS || FIREBASE_BUILD_CARTHAGE || FIREBASE_BUILD_ZIP_FILE @end diff --git a/FirebaseMessaging/Sources/FIRMessaging.m b/FirebaseMessaging/Sources/FIRMessaging.m index 590fabd042c..e2bb09b098c 100644 --- a/FirebaseMessaging/Sources/FIRMessaging.m +++ b/FirebaseMessaging/Sources/FIRMessaging.m @@ -1020,8 +1020,9 @@ + (NSString *)FIRMessagingSDKCurrentLocale { } #pragma mark - Force Category Linking - +#if SWIFT_PACKAGE || COCOAPODS || FIREBASE_BUILD_CARTHAGE || FIREBASE_BUILD_ZIP_FILE extern void FIRInclude_FIRMessaging_ExtensionHelper_Category(void); +#endif // SWIFT_PACKAGE || COCOAPODS || FIREBASE_BUILD_CARTHAGE || FIREBASE_BUILD_ZIP_FILE extern void FIRInclude_NSDictionary_FIRMessaging_Category(void); extern void FIRInclude_NSError_FIRMessaging_Category(void); @@ -1030,7 +1031,9 @@ + (NSString *)FIRMessagingSDKCurrentLocale { /// This method forces the linker to include categories even if /// users do not include the '-ObjC' linker flag in their project. + (void)noop { +#if SWIFT_PACKAGE || COCOAPODS || FIREBASE_BUILD_CARTHAGE || FIREBASE_BUILD_ZIP_FILE FIRInclude_FIRMessaging_ExtensionHelper_Category(); +#endif // SWIFT_PACKAGE || COCOAPODS || FIREBASE_BUILD_CARTHAGE || FIREBASE_BUILD_ZIP_FILE FIRInclude_NSDictionary_FIRMessaging_Category(); FIRInclude_NSError_FIRMessaging_Category(); }