aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firebase/Messaging
diff options
context:
space:
mode:
Diffstat (limited to 'Firebase/Messaging')
-rw-r--r--Firebase/Messaging/CHANGELOG.md3
-rw-r--r--Firebase/Messaging/FIRMessaging+FIRApp.m1
-rw-r--r--Firebase/Messaging/FIRMessaging.m20
-rw-r--r--Firebase/Messaging/FIRMessagingContextManagerService.m3
-rw-r--r--Firebase/Messaging/FIRMessagingReceiver.m4
-rw-r--r--Firebase/Messaging/FIRMessagingRmq2PersistentStore.m5
-rw-r--r--Firebase/Messaging/FIRMessagingRmqManager.m4
-rw-r--r--Firebase/Messaging/FIRMessaging_Private.h4
8 files changed, 34 insertions, 10 deletions
diff --git a/Firebase/Messaging/CHANGELOG.md b/Firebase/Messaging/CHANGELOG.md
index 78dc8d9..22b5031 100644
--- a/Firebase/Messaging/CHANGELOG.md
+++ b/Firebase/Messaging/CHANGELOG.md
@@ -1,3 +1,6 @@
+# 2018-05-29 -- v3.0.1
+- Clean up a few deprecation warnings.
+
# 2018-05-08 -- v3.0.0
- Remove deprecated delegate property `remoteMessageDelegate`, please use `delegate` instead.
- Remove deprecated method `messaging:didRefreshRegistrationToken:` defined in FIRMessagingDelegate protocol, please use `messaging:didReceiveRegistrationToken:` instead.
diff --git a/Firebase/Messaging/FIRMessaging+FIRApp.m b/Firebase/Messaging/FIRMessaging+FIRApp.m
index 58ae3af..d48a3b4 100644
--- a/Firebase/Messaging/FIRMessaging+FIRApp.m
+++ b/Firebase/Messaging/FIRMessaging+FIRApp.m
@@ -72,6 +72,7 @@
}
self.fcmSenderID = [options.GCMSenderID copy];
+ self.globalAutomaticDataCollectionEnabled = [app isAutomaticDataCollectionEnabled];
// Swizzle remote-notification-related methods (app delegate and UNUserNotificationCenter)
if ([FIRMessagingRemoteNotificationsProxy canSwizzleMethods]) {
diff --git a/Firebase/Messaging/FIRMessaging.m b/Firebase/Messaging/FIRMessaging.m
index 73a8a76..ec73474 100644
--- a/Firebase/Messaging/FIRMessaging.m
+++ b/Firebase/Messaging/FIRMessaging.m
@@ -75,7 +75,7 @@ NSString *const kFIRMessagingUserDefaultsKeyAutoInitEnabled =
NSString *const kFIRMessagingAPNSTokenType = @"APNSTokenType"; // APNS Token type key stored in user info.
-static NSString *const kFIRMessagingPlistAutoInitEnabled =
+NSString *const kFIRMessagingPlistAutoInitEnabled =
@"FirebaseMessagingAutoInitEnabled"; // Auto Init Enabled key stored in Info.plist
@interface FIRMessagingMessageInfo ()
@@ -411,13 +411,15 @@ static NSString *const kFIRMessagingPlistAutoInitEnabled =
// Similarly, |application:openURL:sourceApplication:annotation:| will also always be called, due
// to the default swizzling done by FIRAAppDelegateProxy in Firebase Analytics
} else if ([appDelegate respondsToSelector:openURLWithSourceApplicationSelector]) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[appDelegate application:application
openURL:url
sourceApplication:FIRMessagingAppIdentifier()
annotation:@{}];
-
} else if ([appDelegate respondsToSelector:handleOpenURLSelector]) {
[appDelegate application:application handleOpenURL:url];
+#pragma clang diagnostic pop
}
}
@@ -471,8 +473,9 @@ static NSString *const kFIRMessagingPlistAutoInitEnabled =
if (isAutoInitEnabledObject) {
return [isAutoInitEnabledObject boolValue];
}
- // If none of above exists, we default assume FCM auto init is enabled.
- return YES;
+
+ // If none of above exists, we default to the global switch that comes from FIRApp.
+ return self.isGlobalAutomaticDataCollectionEnabled;
}
- (void)setAutoInitEnabled:(BOOL)autoInitEnabled {
@@ -480,7 +483,10 @@ static NSString *const kFIRMessagingPlistAutoInitEnabled =
[_messagingUserDefaults setBool:autoInitEnabled
forKey:kFIRMessagingUserDefaultsKeyAutoInitEnabled];
if (!isFCMAutoInitEnabled && autoInitEnabled) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
self.defaultFcmToken = self.instanceID.token;
+#pragma clang diagnostic pop
}
}
@@ -488,7 +494,10 @@ static NSString *const kFIRMessagingPlistAutoInitEnabled =
NSString *token = self.defaultFcmToken;
if (!token) {
// We may not have received it from Instance ID yet (via NSNotification), so extract it directly
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
token = self.instanceID.token;
+#pragma clang diagnostic pop
}
return token;
}
@@ -846,7 +855,10 @@ static NSString *const kFIRMessagingPlistAutoInitEnabled =
- (void)defaultInstanceIDTokenWasRefreshed:(NSNotification *)notification {
// Retrieve the Instance ID default token, and if it is non-nil, post it
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
NSString *token = self.instanceID.token;
+#pragma clang diagnostic pop
// Sometimes Instance ID doesn't yet have a token, so wait until the default
// token is fetched, and then notify. This ensures that this token should not
// be nil when the developer accesses it.
diff --git a/Firebase/Messaging/FIRMessagingContextManagerService.m b/Firebase/Messaging/FIRMessagingContextManagerService.m
index 65f64ad..c7be606 100644
--- a/Firebase/Messaging/FIRMessagingContextManagerService.m
+++ b/Firebase/Messaging/FIRMessagingContextManagerService.m
@@ -129,7 +129,10 @@ typedef NS_ENUM(NSUInteger, FIRMessagingContextManagerMessageType) {
+ (void)scheduleLocalNotificationForMessage:(NSDictionary *)message
atDate:(NSDate *)date {
NSDictionary *apsDictionary = message;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
UILocalNotification *notification = [[UILocalNotification alloc] init];
+#pragma clang diagnostic pop
// A great way to understand timezones and UILocalNotifications
// http://stackoverflow.com/questions/18424569/understanding-uilocalnotification-timezone
diff --git a/Firebase/Messaging/FIRMessagingReceiver.m b/Firebase/Messaging/FIRMessagingReceiver.m
index 7a99c92..981dfb1 100644
--- a/Firebase/Messaging/FIRMessagingReceiver.m
+++ b/Firebase/Messaging/FIRMessagingReceiver.m
@@ -120,9 +120,11 @@ static int downstreamMessageID = 0;
} else if ([appDelegate respondsToSelector:oldNotificationSelector]) {
// Try the old remote notification callback
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[appDelegate application:
[UIApplication sharedApplication] didReceiveRemoteNotification:message];
-
+#pragma clang diagnostic pop
} else {
FIRMessagingLoggerError(kFIRMessagingMessageCodeReceiver005,
@"None of the remote notification callbacks implemented by "
diff --git a/Firebase/Messaging/FIRMessagingRmq2PersistentStore.m b/Firebase/Messaging/FIRMessagingRmq2PersistentStore.m
index 1232329..76716e6 100644
--- a/Firebase/Messaging/FIRMessagingRmq2PersistentStore.m
+++ b/Firebase/Messaging/FIRMessagingRmq2PersistentStore.m
@@ -16,9 +16,7 @@
#import "FIRMessagingRmq2PersistentStore.h"
-#import "sqlite3.h"
-
-#import "Protos/GtalkCore.pbobjc.h"
+#import <sqlite3.h>
#import "FIRMessagingConstants.h"
#import "FIRMessagingDefines.h"
@@ -26,6 +24,7 @@
#import "FIRMessagingPersistentSyncMessage.h"
#import "FIRMessagingUtilities.h"
#import "NSError+FIRMessaging.h"
+#import "Protos/GtalkCore.pbobjc.h"
#ifndef _FIRMessagingRmqLogAndExit
#define _FIRMessagingRmqLogAndExit(stmt, return_value) \
diff --git a/Firebase/Messaging/FIRMessagingRmqManager.m b/Firebase/Messaging/FIRMessagingRmqManager.m
index de63a73..449e3d6 100644
--- a/Firebase/Messaging/FIRMessagingRmqManager.m
+++ b/Firebase/Messaging/FIRMessagingRmqManager.m
@@ -16,13 +16,13 @@
#import "FIRMessagingRmqManager.h"
-#import "Protos/GtalkCore.pbobjc.h"
-#import "sqlite3.h"
+#import <sqlite3.h>
#import "FIRMessagingDefines.h"
#import "FIRMessagingLogger.h"
#import "FIRMessagingRmq2PersistentStore.h"
#import "FIRMessagingUtilities.h"
+#import "Protos/GtalkCore.pbobjc.h"
#ifndef _FIRMessagingRmqLogAndExit
#define _FIRMessagingRmqLogAndExit(stmt, return_value) \
diff --git a/Firebase/Messaging/FIRMessaging_Private.h b/Firebase/Messaging/FIRMessaging_Private.h
index 46daee0..6bac99d 100644
--- a/Firebase/Messaging/FIRMessaging_Private.h
+++ b/Firebase/Messaging/FIRMessaging_Private.h
@@ -25,6 +25,7 @@ typedef NS_ENUM(int8_t, FIRMessagingNetworkStatus) {
kFIRMessagingReachabilityReachableViaWWAN,
};
+FOUNDATION_EXPORT NSString *const kFIRMessagingPlistAutoInitEnabled;
FOUNDATION_EXPORT NSString *const kFIRMessagingUserDefaultsKeyAutoInitEnabled;
@interface FIRMessagingRemoteMessage ()
@@ -37,6 +38,9 @@ FOUNDATION_EXPORT NSString *const kFIRMessagingUserDefaultsKeyAutoInitEnabled;
#pragma mark - Private API
+// The data collection flag from Core.
+@property(nonatomic, readwrite, getter=isGlobalAutomaticDataCollectionEnabled) BOOL globalAutomaticDataCollectionEnabled;
+
- (NSString *)defaultFcmToken;
- (FIRMessagingClient *)client;
- (FIRMessagingPubSub *)pubsub;