File tree Expand file tree Collapse file tree 4 files changed +8
-9
lines changed Expand file tree Collapse file tree 4 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 24
24
@property (nonatomic , copy , readwrite ) NSString *deviceType;
25
25
@property (nonatomic , copy , readwrite ) NSString *installationId;
26
26
@property (nonatomic , copy , readwrite ) NSString *timeZone;
27
- @property (nonatomic , copy , readwrite ) NSString *localeIdentifier;
28
27
29
28
@end
Original file line number Diff line number Diff line change @@ -79,11 +79,6 @@ PF_ASSUME_NONNULL_BEGIN
79
79
*/
80
80
@property (PF_NULLABLE_PROPERTY nonatomic , copy , readonly ) NSString *timeZone;
81
81
82
- /* !
83
- @abstract The localeIdentifier for the `PFInstallation` ([language code]-[COUNTRY CODE]).
84
- */
85
- @property (PF_NULLABLE_PROPERTY nonatomic , copy , readonly ) NSString *localeIdentifier;
86
-
87
82
/* !
88
83
@abstract The channels for the `PFInstallation`.
89
84
*/
Original file line number Diff line number Diff line change @@ -108,7 +108,6 @@ @implementation PFInstallation
108
108
@dynamic installationId;
109
109
@dynamic deviceToken;
110
110
@dynamic timeZone;
111
- @dynamic localeIdentifier;
112
111
@dynamic channels;
113
112
@dynamic badge;
114
113
@@ -336,8 +335,10 @@ - (void)_updateLocaleIdentifierFromDevice {
336
335
localeIdentifier = language;
337
336
}
338
337
339
- if (localeIdentifier.length > 0 && ![localeIdentifier isEqualToString: self .localeIdentifier]) {
340
- self.localeIdentifier = localeIdentifier;
338
+ NSString *currentLocaleIdentifier = self[PFInstallationKeyLocaleIdentifier];
339
+ if (localeIdentifier.length > 0 && ![localeIdentifier isEqualToString: currentLocaleIdentifier]) {
340
+ // Call into super to avoid checking on protected keys.
341
+ [super setObject: localeIdentifier forKey: PFInstallationKeyLocaleIdentifier];
341
342
}
342
343
}
343
344
Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ - (void)testInstallationImmutableFieldsCannotBeChanged {
31
31
@" Should throw an exception for trying to change deviceType." );
32
32
PFAssertThrowsInvalidArgumentException (installation[@" installationId" ] = @" a"
33
33
@" Should throw an exception for trying to change installationId." );
34
+ PFAssertThrowsInvalidArgumentException (installation[@" localeIdentifier" ] = @" a"
35
+ @" Should throw an exception for trying to change installationId." );
34
36
}
35
37
36
38
- (void )testInstallationImmutableFieldsCannotBeDeleted {
@@ -41,6 +43,8 @@ - (void)testInstallationImmutableFieldsCannotBeDeleted {
41
43
@" Should throw an exception for trying to delete deviceType." );
42
44
PFAssertThrowsInvalidArgumentException ([installation removeObjectForKey: @" installationId" ],
43
45
@" Should throw an exception for trying to delete installationId." );
46
+ PFAssertThrowsInvalidArgumentException ([installation removeObjectForKey: @" localeIdentifier" ],
47
+ @" Should throw an exception for trying to delete installationId." );
44
48
}
45
49
46
50
@end
You can’t perform that action at this time.
0 commit comments