Activate / Deactivate Channel Push Notification
You can enable or disable channel push notification settings for current user.
// activate
TalkPlus.enableChannelPushNotification(channel,
new TalkPlus.CallbackListener<TPChannel>() {
@Override
public void onSuccess(TPChannel tpChannel) {
}
@Override
public void onFailure(int errorCode, Exception exception) {
}
}
);
// deactivate
TalkPlus.disableChannelPushNotification(channel,
new TalkPlus.CallbackListener<TPChannel>() {
@Override
public void onSuccess(TPChannel tpChannel) {
}
@Override
public void onFailure(int errorCode, Exception exception) {
}
}
);
// activate
TalkPlus.enableChannelPushNotification(channel,
object : TalkPlus.CallbackListener<TPChannel>() {
override fun onSuccess(tpChannel: TPChannel) { }
override fun onFailure(errorCode: Int, exception: Exception) { }
})
// deactivate
TalkPlus.disableChannelPushNotification(channel,
object : TalkPlus.CallbackListener<TPChannel>() {
override fun onSuccess(tpChannel: TPChannel) { }
override fun onFailure(errorCode: Int, exception: Exception) { }
})
Channel Push Notification Settings (Sound)
You can change channel push notification (FCM) sound settings for current user.
// change channel notification sound
TalkPlus.setChannelPushSound(channel,
"mySound.mp3",
new TalkPlus.CallbackListener<TPChannel>() {
@Override
public void onSuccess(TPChannel tpChannel) {
}
@Override
public void onFailure(int errorCode, Exception exception) {
}
}
);
// change channel notification sound
TalkPlus.setChannelPushSound(channel,
"mySound.mp3",
object : TalkPlus.CallbackListener<TPChannel>() {
override fun onSuccess(tpChannel: TPChannel) { }
override fun onFailure(errorCode: Int, exception: Exception) { }
})
Last updated