Pinning group channels
The channel pinning feature for group channels works the same as for direct channels. See Pinning Channels for the full API reference. All examples and APIs apply to GroupChannel in the same way they apply to DirectChannel.
For example, to pin a group channel:
- Kotlin
- Java
kotlin
val channel = GroupChannel("groupId")
channel.pin { success, error ->
if (error == null && success == true) {
// Pinned successfully
} else {
// Pin failed: ${error?.message}
}
}
Java
GroupChannel channel = new GroupChannel("groupId");
channel.pin(new OperationHandler<Boolean>() {
@Override
public void onResult(Boolean success, NCError error) {
if (error == null && success != null && success) {
// Pinned successfully
} else {
// Pin failed
}
}
});
For additional operations (unpin, check status, listen for changes, pin within a tag), refer to Pinning Channels.