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
return ( | |
<div className="channel-wrap"> | |
<div className="channel-list"> | |
<ChannelList | |
onChannelSelect={(channel) => { | |
setChannel(channel); | |
}} | |
/> | |
</div> | |
<div className="channel-chat"> |
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
function App() { | |
const APP_ID = process.env.REACT_APP_APP_ID; | |
const USER_ID = process.env.REACT_APP_USER_ID; | |
const NICKNAME = process.env.REACT_APP_NICKNAME; | |
const ACCESS_TOKEN = process.env.REACT_APP_ACCESS_TOKEN; | |
const sb = SendbirdChat.init({ | |
appId: APP_ID, | |
modules: [new GroupChannelModule()], | |
}); |
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
func didReceiveInvitation(_ invitation: RoomInvitation) { // Received invitation | |
invitation.accept { _in // Accepted invitation | |
invitation.room.enter { error in | |
// The user has entered the room. | |
} | |
} | |
} |
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
class MyClass: RoomDelegate { | |
func wasInvitationAccepted(_ invitation: RoomInvitation) { | |
// Invitation was accepted by `invitation.invitee` | |
} | |
func wasInvitationDeclined(_ invitation: RoomInvitation) { | |
// Invitation was declined by `invitation.invitee` | |
} | |
} |
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
func didReceiveInvitation(_ invitation: RoomInvitation) { | |
// Accept an invitation. | |
invitation.accept { error in | |
// Invitation was accepted with error: \(error) | |
} | |
// Decline an invitation. | |
invitation.decline { error in | |
// Invitation was accepted with error: \(error) | |
} |
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
class AppDelegate: UIResponder, UIApplicationDelegate, SendBirdCallDelegate { | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
let applicationId: String = <#YOUR_APPLICATION_ID#> | |
SendBirdCall.configure(appId: applicationId) | |
SendBirdCall.addDelegate(self, identifier: String(describing: Self.self)) | |
... | |
return true |
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
class AppDelegate: UIResponder, UIApplicationDelegate { | |
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { | |
SendBirdCall.application(application, didReceiveRemoteNotification: userInfo) | |
} | |
} |
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
room.sendInvitation(invitee: inviteeId) { invitation, error in | |
guard error == nil else { return } | |
// Invitation has been successfully sent to the invitee. | |
} |
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
room.enter { error in | |
// user has entered the room. | |
} |
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
let roomType = RoomType.smallRoomForVideo | |
let params = RoomParams(roomType: roomType) | |
SendBirdCall.createRoom(with: params) { room, error in | |
guard let room = room, error == nil else { return } // Handle error. | |
// `room` is created with a unique identifier `room.roomId`. | |
} |