Skip to content

Commit

Permalink
avoid using initWithSuiteName which does not support iOS 7 (#765)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlotteliang authored Feb 7, 2018
1 parent 4b0dc13 commit 976635f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
5 changes: 2 additions & 3 deletions Example/Messaging/Tests/FIRMessagingTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ - (void)setUp {
_mockMessaging = OCMPartialMock(self.messaging);
_mockInstanceIDProxy = OCMPartialMock(self.messaging.instanceIDProxy);
self.messaging.instanceIDProxy = _mockInstanceIDProxy;
[self.messaging.messagingUserDefaults removePersistentDomainForName:kFIRMessagingSuiteName];
self.messaging.messagingUserDefaults =
[[NSUserDefaults alloc] initWithSuiteName:kFIRMessagingSuiteName];
[[NSUserDefaults standardUserDefaults]
removePersistentDomainForName:[NSBundle mainBundle].bundleIdentifier];
}

- (void)tearDown {
Expand Down
4 changes: 1 addition & 3 deletions Firebase/Messaging/FIRMessaging.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@

NSString *const kFIRMessagingUserDefaultsKeyAutoInitEnabled =
@"com.firebase.messaging.auto-init.enabled"; // Auto Init Enabled key stored in NSUserDefaults
NSString *const kFIRMessagingSuiteName =
@"com.firebase.messaging.user_defaults"; // Suite name for NSUserDefaults

static NSString *const kFIRMessagingPlistAutoInitEnabled =
@"FirebaseMessagingAutoInitEnabled"; // Auto Init Enabled key stored in Info.plist
Expand Down Expand Up @@ -175,7 +173,7 @@ - (instancetype)initPrivately {
if (self) {
_loggedMessageIDs = [NSMutableSet set];
_instanceIDProxy = [[FIRMessagingInstanceIDProxy alloc] init];
_messagingUserDefaults = [[NSUserDefaults alloc] initWithSuiteName:kFIRMessagingSuiteName];
_messagingUserDefaults = [NSUserDefaults standardUserDefaults];
}
return self;
}
Expand Down
1 change: 0 additions & 1 deletion Firebase/Messaging/FIRMessaging_Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ typedef NS_ENUM(int8_t, FIRMessagingNetworkStatus) {
};

FOUNDATION_EXPORT NSString *const kFIRMessagingUserDefaultsKeyAutoInitEnabled;
FOUNDATION_EXPORT NSString *const kFIRMessagingSuiteName;

@interface FIRMessagingRemoteMessage ()

Expand Down

0 comments on commit 976635f

Please sign in to comment.