[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
public void documentDelete(String appName, String path, final Promise promise) {
RNFirebaseFirestoreDocumentReference ref = getDocumentForAppPath(appName, path);

View File

@ -40,14 +40,6 @@ public class RNFirebaseFirestoreDocumentReference {
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) {
this.ref.delete().addOnCompleteListener(new OnCompleteListener<Void>() {
@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
path:(NSString *) path
resolver:(RCTPromiseResolveBlock) resolve

View File

@ -17,8 +17,6 @@
@property FIRDocumentReference *ref;
- (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)get:(RCTPromiseResolveBlock) resolve rejecter:(RCTPromiseRejectBlock) reject;
+ (void)offSnapshot:(NSString *)listenerId;

View File

@ -23,17 +23,6 @@ static NSMutableDictionary *_listeners;
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
rejecter:(RCTPromiseRejectBlock) reject {
[_ref deleteDocumentWithCompletion:^(NSError * _Nullable error) {