File tree 2 files changed +15
-0
lines changed
library/src/main/java/org/xmtp/android/library/push
2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -79,3 +79,7 @@ This example branch can serve as the basis for what you might want to provide fo
79
79
```kotlin
80
80
XMTPPush(context, "10.0.2.2:8080").subscribe(conversations.map { it.topic })
81
81
```
82
+
83
+ ```kotlin
84
+ XMTPPush(context, "10.0.2.2:8080").unsubscribe(conversations.map { it.topic })
85
+ ```
Original file line number Diff line number Diff line change @@ -51,6 +51,17 @@ class XMTPPush() {
51
51
client.subscribe(request)
52
52
}
53
53
54
+ fun unsubscribe (topics : List <String >) {
55
+ if (pushServer == " " ) {
56
+ throw XMTPException (" No push server" )
57
+ }
58
+ val request = Service .UnsubscribeRequest .newBuilder().also { request ->
59
+ request.installationId = installationId
60
+ request.addAllTopics(topics)
61
+ }.build()
62
+ client.unsubscribe(request)
63
+ }
64
+
54
65
val client: NotificationsGrpc .NotificationsFutureStub
55
66
get() {
56
67
val protocolClient: ManagedChannel =
You can’t perform that action at this time.
0 commit comments