import UIKit
import SendbirdChatSDK
let initParams = InitParams(applicationId: "APP_ID", isLocalCachingEnabled: true)
SendbirdChat.initialize(params: initParams, migrationStartHandler: {},
completionHandler: { error in
FeedChannel.getChannel(url: "FEED_CHANNEL_URL") { channel, error in
self.collection =
SendbirdChat.createNotificationCollection(channel: channel, startingPoint:
Int64.max, params: params, delegate: self)
}
}
)
import com.sendbird.android.SendbirdChat
import com.sendbird.android.channel.FeedChannel
import com.sendbird.android.collection.NotificationCollection
val initParams =
InitParams.Builder("APP_ID").setLocalCachingEnabled(true).build()
SendbirdChat.init(applicationContext, initParams, object : InitResultHandler {
override fun onInitSucceed() {
FeedChannel.getChannel("FEED_CHANNEL_URL", object :
FeedChannel.GetChannelHandler {
override fun onResult(channel: FeedChannel?, e:
SendbirdChatException?) {
collection =
SendbirdChat.createNotificationCollection(channel, Long.MAX_VALUE, params,
object : NotificationCollection.NotificationCollectionDelegate {...})
}
})
}
})
const SendBird = require('sendbird');
const sb = new SendBird({ appId: APP_ID });
sb.connect(USER_ID)
.then(user => {
return sb.FeedChannel.getChannel(FEED_CHANNEL_URL);
})
.then(feedChannel => {
const ChannelHandler = new sb.ChannelHandler();
sb.addChannelHandler('UNIQUE_HANDLER_ID', ChannelHandler);
})
.catch(error => {
// Handle errors
console.error('Error in Sendbird:', error);
});
import 'package:sendbird_sdk/sendbird_sdk.dart';
await SendbirdChat.init(appId: 'APP_ID');
final feedChannel = await FeedChannel.getChannel('FEED_CHANNEL_URL');
final notificationCollection = NotificationCollection(channel: feedChannel,
params: MessageListParams(), handler: MyNotificationCollectionHandler());
import requests
# Configuration
url = "YOUR_BASE_URL/v2/notifications"
headers = {
"Api-Token": "YOUR_API_TOKEN",
"Content-Type": "application/json"
}
payload = {
"template": {
"key": "appointment_reminder",
"variables": {
"user-1": {"first_name": "Chase", "datetime": "2024/03/18", "appointment_number": "388031"}
}
},
"targets": ["user-1"],
"mode": "realtime"
}
# POST request
response = requests.post(url, json=payload, headers=headers)