-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented Database.add(Document)ChangeListener
- Loading branch information
Kin Mak
committed
Jul 14, 2020
1 parent
3be54eb
commit c79fc36
Showing
11 changed files
with
323 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
android/src/main/java/com/saltechsystems/couchbase_lite/DatabaseEventListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.saltechsystems.couchbase_lite; | ||
|
||
import io.flutter.plugin.common.EventChannel; | ||
|
||
public class DatabaseEventListener implements EventChannel.StreamHandler { | ||
public EventChannel.EventSink mEventSink; | ||
|
||
/* | ||
* IMPLEMENTATION OF EVENTCHANNEL.STREAMHANDLER | ||
*/ | ||
|
||
@Override | ||
public void onListen(Object args, final EventChannel.EventSink eventSink) { | ||
mEventSink = eventSink; | ||
} | ||
|
||
@Override | ||
public void onCancel(Object args) { | ||
mEventSink = null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// DatabaseEventListener.swift | ||
// couchbase_lite | ||
// | ||
// Created by Kin Mak on 8/7/2020. | ||
// | ||
|
||
import Foundation | ||
import CouchbaseLiteSwift | ||
|
||
class DatabaseEventListener: FlutterStreamHandler { | ||
var mEventSink: FlutterEventSink? | ||
|
||
func onListen(withArguments arguments: Any?, eventSink events: @escaping FlutterEventSink) -> FlutterError? { | ||
mEventSink = events | ||
|
||
return nil | ||
} | ||
|
||
func onCancel(withArguments arguments: Any?) -> FlutterError? { | ||
|
||
|
||
return nil | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.