Skip to content

Instantly share code, notes, and snippets.

View warodri-sendbird's full-sized avatar

Walter Rodriguez warodri-sendbird

View GitHub Profile
sb.connect(userId, "...").then((user, error) => {
sb.GroupChannel.getChannel('test2').then((channel, error) => {
// console.log(channel)
messageCollection = channel.createMessageCollection()
.setStartingPoint(Date.now())
.setLimit(30)
// Flag to check if the chat is connected or not
connected = false;
// String with the error (in case of any, when creating a group channel)
startConversationResult: string;
// List of this signed user's group channels
conversations: Array<SendBird.GroupChannel> | null;
// String with the error (in case of any, when trying to list our group channels)
<p>
<button (click)="connect()">Connect to chat</button>
</p>
import { Injectable, Query } from '@angular/core';
import SendBird from 'sendbird';
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".UIKitActivity">
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/mainLayout"
package com.example.uikitinsidefragment;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentManager;
import android.os.Bundle;
import com.sendbird.android.GroupChannel;
import com.sendbird.android.GroupChannelListQuery;
import com.sendbird.uikit.fragments.ChannelListFragment;
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
android:id="@+id/butCallUIKit"
package com.example.uikitinsidefragment;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentManager;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
package com.example.uikitinsidefragment;
import android.app.Application;
import com.sendbird.uikit.SendBirdUIKit;
import com.sendbird.uikit.adapter.SendBirdUIKitAdapter;
import com.sendbird.uikit.interfaces.UserInfo;
import com.sendbird.uikit.log.Logger;
public class BaseApplication extends Application {
@warodri-sendbird
warodri-sendbird / supergroup_to_group_channel.js
Created December 1, 2021 17:25 — forked from charisTheo/supergroup_to_group_channel.js
This script migrates all messages and users from a Sendbird supergroup channel to a group channel
/*
* This script migrates all messages and users
* from a Sendbird supergroup channel to a group channel
* by creating a new group channel and deleting the old supergroup channel.
*
* Note: make sure you have chat history enabled for newly joined members
* Enable it by selecting an App from the Dashboard and toggle the checkbox under
* Settings > Chat > Group Channels > Chat history
*
* To use this script, you need to change APP_ID and API_TOKEN below