SendBird .NET SDK предоставляет два метода принудительной регистрации, поскольку его можно использовать как в Android, так и в iOS.
Android: Регистрация FCMPushTokenForCurrentUser
iOS: Зарегистрировать APNSPushTokenForCurrentUser
SendBirdClient.Connect(userId, (User user, SendBirdException e) => {
if (e != null) {
// Error.
return;
}
if (SendBirdClient.GetPendingPushToken() == null) return;
// For Android
SendBirdClient.RegisterFCMPushTokenForCurrentUser(SendBirdClient.GetPendingPushToken(), (SendBirdClient.PushTokenRegistrationStatus status, SendBirdException e1) => {
if (e1 != null) {
// Error.
return;
}
if (status == SendBirdClient.PushTokenRegistrationStatus.PENDING) {
// Try registration after connection is established.
}
});
// For iOS
SendBirdClient.RegisterAPNSPushTokenForCurrentUser(SendBirdClient.GetPendingPushToken(), (SendBirdClient.PushTokenRegistrationStatus status, SendBirdException e1) => {
if (e1 != null) {
// Error.
return;
}
if (status == SendBirdClient.PushTokenRegistrationStatus.PENDING) {
// Try registration after connection is established.
}
});
});