@@ -9,7 +9,7 @@ @interface NSError (FlutterError)
9
9
@implementation NSError (FlutterError)
10
10
- (FlutterError *)flutterError {
11
11
return [FlutterError
12
- errorWithCode: [NSString stringWithFormat: @" Error %d " , self .code]
12
+ errorWithCode: [NSString stringWithFormat: @" Error %ld " , self .code]
13
13
message: self .domain
14
14
details: self .localizedDescription];
15
15
}
@@ -24,6 +24,13 @@ + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar {
24
24
binaryMessenger: [registrar messenger ]];
25
25
FirebaseDatabasePlugin *instance = [[FirebaseDatabasePlugin alloc ] init ];
26
26
[registrar addMethodCallDelegate: instance channel: channel];
27
+ // TODO(jackson): stub code that should be replaced with dynamic registration.
28
+ [[[FIRDatabase database ].reference queryLimitedToLast: 10 ]
29
+ observeEventType: FIRDataEventTypeChildAdded
30
+ withBlock: ^(FIRDataSnapshot *_Nonnull snapshot) {
31
+ [channel invokeMethod: @" DatabaseReference#childAdded"
32
+ arguments: @[ snapshot.key, snapshot.value ]];
33
+ }];
27
34
}
28
35
29
36
- (instancetype )init {
@@ -32,12 +39,6 @@ - (instancetype)init {
32
39
if (![FIRApp defaultApp ]) {
33
40
[FIRApp configure ];
34
41
}
35
- [[[FIRDatabase database ].reference queryLimitedToLast: 10 ]
36
- observeEventType: FIRDataEventTypeChildAdded
37
- withBlock: ^(FIRDataSnapshot *_Nonnull snapshot) {
38
- [channel invokeMethod: @" DatabaseReference#childAdded"
39
- arguments: @[ snapshot.key, snapshot.value ]];
40
- }];
41
42
}
42
43
return self;
43
44
}
0 commit comments