|
|
@@ -142,8 +142,10 @@ BOOL FIRMessagingIsContextManagerMessage(NSDictionary *message) {
|
|
|
// FIRApp properties
|
|
|
@property(nonatomic, readwrite, strong) NSData *apnsTokenData;
|
|
|
@property(nonatomic, readwrite, strong) NSString *defaultFcmToken;
|
|
|
-
|
|
|
+#pragma clang diagnostic push
|
|
|
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
|
@property(nonatomic, readwrite, strong) FIRInstanceID *instanceID;
|
|
|
+#pragma clang diagnostic pop
|
|
|
|
|
|
@property(nonatomic, readwrite, strong) FIRMessagingClient *client;
|
|
|
@property(nonatomic, readwrite, strong) GULReachabilityChecker *reachability;
|
|
|
@@ -183,10 +185,12 @@ BOOL FIRMessagingIsContextManagerMessage(NSDictionary *message) {
|
|
|
});
|
|
|
return extensionHelper;
|
|
|
}
|
|
|
-
|
|
|
+#pragma clang diagnostic push
|
|
|
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
|
- (instancetype)initWithAnalytics:(nullable id<FIRAnalyticsInterop>)analytics
|
|
|
withInstanceID:(FIRInstanceID *)instanceID
|
|
|
withUserDefaults:(GULUserDefaults *)defaults {
|
|
|
+#pragma clang diagnostic pop
|
|
|
self = [super init];
|
|
|
if (self != nil) {
|
|
|
_loggedMessageIDs = [NSMutableSet set];
|
|
|
@@ -226,10 +230,13 @@ BOOL FIRMessagingIsContextManagerMessage(NSDictionary *message) {
|
|
|
// Ensure it's cached so it returns the same instance every time messaging is called.
|
|
|
*isCacheable = YES;
|
|
|
id<FIRAnalyticsInterop> analytics = FIR_COMPONENT(FIRAnalyticsInterop, container);
|
|
|
+#pragma clang diagnostic push
|
|
|
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
|
FIRMessaging *messaging =
|
|
|
[[FIRMessaging alloc] initWithAnalytics:analytics
|
|
|
withInstanceID:[FIRInstanceID instanceID]
|
|
|
withUserDefaults:[GULUserDefaults standardUserDefaults]];
|
|
|
+#pragma clang diagnostic pop
|
|
|
[messaging start];
|
|
|
[messaging configureNotificationSwizzlingIfEnabled];
|
|
|
return messaging;
|
|
|
@@ -595,10 +602,13 @@ BOOL FIRMessagingIsContextManagerMessage(NSDictionary *message) {
|
|
|
@"set.",
|
|
|
senderID);
|
|
|
}
|
|
|
+#pragma clang diagnostic push
|
|
|
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
|
[self.instanceID tokenWithAuthorizedEntity:senderID
|
|
|
scope:kFIRMessagingDefaultTokenScope
|
|
|
options:options
|
|
|
handler:completion];
|
|
|
+#pragma clang diagnostic pop
|
|
|
}
|
|
|
|
|
|
- (void)deleteFCMTokenForSenderID:(nonnull NSString *)senderID
|
|
|
@@ -615,12 +625,17 @@ BOOL FIRMessagingIsContextManagerMessage(NSDictionary *message) {
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
+#pragma clang diagnostic push
|
|
|
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
|
[self.instanceID deleteTokenWithAuthorizedEntity:senderID
|
|
|
scope:kFIRMessagingDefaultTokenScope
|
|
|
handler:completion];
|
|
|
+#pragma clang diagnostic pop
|
|
|
}
|
|
|
|
|
|
- (void)deleteDataWithCompletion:(void (^)(NSError *_Nullable))completion {
|
|
|
+#pragma clang diagnostic push
|
|
|
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
|
FIRMessaging_WEAKIFY(self);
|
|
|
[self.instanceID
|
|
|
deleteTokenWithAuthorizedEntity:@"*"
|
|
|
@@ -650,6 +665,7 @@ BOOL FIRMessagingIsContextManagerMessage(NSDictionary *message) {
|
|
|
completion(nil);
|
|
|
}];
|
|
|
}];
|
|
|
+#pragma clang diagnostic pop
|
|
|
}
|
|
|
|
|
|
#pragma mark - FIRMessagingDelegate helper methods
|
|
|
@@ -795,6 +811,8 @@ BOOL FIRMessagingIsContextManagerMessage(NSDictionary *message) {
|
|
|
topic, [FIRMessagingPubSub removePrefixFromTopic:topic]);
|
|
|
}
|
|
|
__weak FIRMessaging *weakSelf = self;
|
|
|
+#pragma clang diagnostic push
|
|
|
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
|
[self.instanceID instanceIDWithHandler:^(FIRInstanceIDResult *_Nullable result,
|
|
|
NSError *_Nullable error) {
|
|
|
if (error) {
|
|
|
@@ -820,6 +838,7 @@ BOOL FIRMessagingIsContextManagerMessage(NSDictionary *message) {
|
|
|
failureReason:failureReason]);
|
|
|
}
|
|
|
}];
|
|
|
+#pragma clang diagnostic pop
|
|
|
}
|
|
|
|
|
|
- (void)unsubscribeFromTopic:(NSString *)topic {
|
|
|
@@ -835,6 +854,8 @@ BOOL FIRMessagingIsContextManagerMessage(NSDictionary *message) {
|
|
|
topic, [FIRMessagingPubSub removePrefixFromTopic:topic]);
|
|
|
}
|
|
|
__weak FIRMessaging *weakSelf = self;
|
|
|
+#pragma clang diagnostic push
|
|
|
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
|
[self.instanceID instanceIDWithHandler:^(FIRInstanceIDResult *_Nullable result,
|
|
|
NSError *_Nullable error) {
|
|
|
if (error) {
|
|
|
@@ -860,6 +881,7 @@ BOOL FIRMessagingIsContextManagerMessage(NSDictionary *message) {
|
|
|
failureReason:failureReason]);
|
|
|
}
|
|
|
}];
|
|
|
+#pragma clang diagnostic pop
|
|
|
}
|
|
|
|
|
|
#pragma mark - Send
|