[firestore] Cleanup unused methods

This commit is contained in:
Chris Bianca 2017-10-18 10:29:46 +01:00
parent 4f51b48430
commit 2d35514287
5 changed files with 3 additions and 51 deletions

View File

@ -111,18 +111,6 @@ public class RNFirebaseFirestore extends ReactContextBaseJavaModule {
}); });
} }
@ReactMethod
public void documentCollections(String appName, String path, final Promise promise) {
RNFirebaseFirestoreDocumentReference ref = getDocumentForAppPath(appName, path);
ref.collections(promise);
}
@ReactMethod
public void documentCreate(String appName, String path, ReadableMap data, final Promise promise) {
RNFirebaseFirestoreDocumentReference ref = getDocumentForAppPath(appName, path);
ref.create(data, promise);
}
@ReactMethod @ReactMethod
public void documentDelete(String appName, String path, final Promise promise) { public void documentDelete(String appName, String path, final Promise promise) {
RNFirebaseFirestoreDocumentReference ref = getDocumentForAppPath(appName, path); RNFirebaseFirestoreDocumentReference ref = getDocumentForAppPath(appName, path);

View File

@ -40,14 +40,6 @@ public class RNFirebaseFirestoreDocumentReference {
this.ref = RNFirebaseFirestore.getFirestoreForApp(appName).document(path); this.ref = RNFirebaseFirestore.getFirestoreForApp(appName).document(path);
} }
public void collections(Promise promise) {
// Not supported on Android
}
public void create(ReadableMap data, Promise promise) {
// Not supported on Android out of the box
}
public void delete(final Promise promise) { public void delete(final Promise promise) {
this.ref.delete().addOnCompleteListener(new OnCompleteListener<Void>() { this.ref.delete().addOnCompleteListener(new OnCompleteListener<Void>() {
@Override @Override

View File

@ -85,21 +85,6 @@ RCT_EXPORT_METHOD(documentBatch:(NSString *) appName
}]; }];
} }
RCT_EXPORT_METHOD(documentCollections:(NSString *) appName
path:(NSString *) path
resolver:(RCTPromiseResolveBlock) resolve
rejecter:(RCTPromiseRejectBlock) reject) {
[[self getDocumentForAppPath:appName path:path] get:resolve rejecter:reject];
}
RCT_EXPORT_METHOD(documentCreate:(NSString *) appName
path:(NSString *) path
data:(NSDictionary *) data
resolver:(RCTPromiseResolveBlock) resolve
rejecter:(RCTPromiseRejectBlock) reject) {
[[self getDocumentForAppPath:appName path:path] create:data resolver:resolve rejecter:reject];
}
RCT_EXPORT_METHOD(documentDelete:(NSString *) appName RCT_EXPORT_METHOD(documentDelete:(NSString *) appName
path:(NSString *) path path:(NSString *) path
resolver:(RCTPromiseResolveBlock) resolve resolver:(RCTPromiseResolveBlock) resolve

View File

@ -17,8 +17,6 @@
@property FIRDocumentReference *ref; @property FIRDocumentReference *ref;
- (id)initWithPath:(RCTEventEmitter *)emitter app:(NSString *)app path:(NSString *)path; - (id)initWithPath:(RCTEventEmitter *)emitter app:(NSString *)app path:(NSString *)path;
- (void)collections:(RCTPromiseResolveBlock) resolve rejecter:(RCTPromiseRejectBlock) reject;
- (void)create:(NSDictionary *)data resolver:(RCTPromiseResolveBlock) resolve rejecter:(RCTPromiseRejectBlock) reject;
- (void)delete:(RCTPromiseResolveBlock) resolve rejecter:(RCTPromiseRejectBlock) reject; - (void)delete:(RCTPromiseResolveBlock) resolve rejecter:(RCTPromiseRejectBlock) reject;
- (void)get:(RCTPromiseResolveBlock) resolve rejecter:(RCTPromiseRejectBlock) reject; - (void)get:(RCTPromiseResolveBlock) resolve rejecter:(RCTPromiseRejectBlock) reject;
+ (void)offSnapshot:(NSString *)listenerId; + (void)offSnapshot:(NSString *)listenerId;

View File

@ -23,17 +23,6 @@ static NSMutableDictionary *_listeners;
return self; return self;
} }
- (void)collections:(RCTPromiseResolveBlock) resolve
rejecter:(RCTPromiseRejectBlock) reject {
// Not supported on iOS
}
- (void)create:(NSDictionary *) data
resolver:(RCTPromiseResolveBlock) resolve
rejecter:(RCTPromiseRejectBlock) reject {
// Not supported on iOS out of the box
}
- (void)delete:(RCTPromiseResolveBlock) resolve - (void)delete:(RCTPromiseResolveBlock) resolve
rejecter:(RCTPromiseRejectBlock) reject { rejecter:(RCTPromiseRejectBlock) reject {
[_ref deleteDocumentWithCompletion:^(NSError * _Nullable error) { [_ref deleteDocumentWithCompletion:^(NSError * _Nullable error) {
@ -176,7 +165,7 @@ static NSMutableDictionary *_listeners;
NSDictionary *typeMap = [RNFirebaseFirestoreDocumentReference buildTypeMap:obj]; NSDictionary *typeMap = [RNFirebaseFirestoreDocumentReference buildTypeMap:obj];
map[key] = typeMap; map[key] = typeMap;
}]; }];
return map; return map;
} }
@ -186,7 +175,7 @@ static NSMutableDictionary *_listeners;
NSDictionary *typeMap = [RNFirebaseFirestoreDocumentReference buildTypeMap:obj]; NSDictionary *typeMap = [RNFirebaseFirestoreDocumentReference buildTypeMap:obj];
[array addObject:typeMap]; [array addObject:typeMap];
}]; }];
return array; return array;
} }
@ -231,7 +220,7 @@ static NSMutableDictionary *_listeners;
// TODO: Log an error // TODO: Log an error
typeMap[@"type"] = @"null"; typeMap[@"type"] = @"null";
} }
return typeMap; return typeMap;
} }