Skip to content
This repository has been archived by the owner on Dec 29, 2020. It is now read-only.

Commit

Permalink
feat(firestore): support clearPersistence() & terminate() APIs (inver…
Browse files Browse the repository at this point in the history
…tase#3591)

Co-authored-by: Mike Diarmid <mike.diarmid@gmail.com>

[publish]
  • Loading branch information
russellwheatley authored Jun 22, 2020
1 parent 7e0fa45 commit 4ade64c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ public void clearAll() {
getPreferences().edit().clear().apply();
}

public SharedPreferences.Editor remove(String key){
return getPreferences().edit().remove(key);
}

private SharedPreferences getPreferences() {
if (preferences == null) {
preferences = ReactNativeFirebaseApp
Expand Down
2 changes: 2 additions & 0 deletions ios/RNFBApp/RNFBPreferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@

- (void)clearAll;

- (void)remove:(NSString *)key;

+ (RNFBPreferences *)shared;

@end
4 changes: 4 additions & 0 deletions ios/RNFBApp/RNFBPreferences.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ - (void)clearAll {
[_userDefaults removePersistentDomainForName:RNFBDomainIdentifier];
}

- (void)remove:(NSString *)key {
[_userDefaults removeObjectForKey:key];
}

+ (RNFBPreferences *)shared {
return sharedInstance;
}
Expand Down

0 comments on commit 4ade64c

Please sign in to comment.