File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
iOS_SDK/OneSignalSDK/Source Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,18 @@ - (void)loadTagsFromUserDefaults {
101101 _tags = [standardUserDefaults getSavedDictionaryForKey: OSUD_PLAYER_TAGS defaultValue: nil ];
102102}
103103
104+ - (void )removeNSNullFromTags {
105+ NSMutableDictionary *tagsDict = [NSMutableDictionary dictionaryWithDictionary: _tags];
106+ for (id key in tagsDict.allKeys ) {
107+ if ([tagsDict[key] isKindOfClass: [NSNull class ]]) {
108+ tagsDict[key] = nil ;
109+ }
110+ }
111+ _tags = tagsDict;
112+ }
113+
104114- (void )saveTagsToUserDefaults {
115+ [self removeNSNullFromTags ];
105116 let standardUserDefaults = OneSignalUserDefaults.initStandard ;
106117 [standardUserDefaults saveDictionaryForKey: OSUD_PLAYER_TAGS withValue: _tags];
107118}
You can’t perform that action at this time.
0 commit comments