Skip to main content
Android
iOS
Web
Windows
Unity
Flutter
React Native

Translate push notifications

Push notifications work in conjunction with the translation feature. If a user enables the auto-translate feature and sends a message, the SDK will send both the original message and the translated message.

A recipient can set the preferred language for push notifications. If the language of the translated message matches their setting, the translated message is displayed in the push notification bar; otherwise, the original message is displayed.

The following sample code shows how to set and get the preferred language for push notifications:


_5
// Set the preferred language for offline push.
_5
ChatClient.getInstance().pushManager().setPreferredNotificationLanguage("en", new CallBack(){});
_5
_5
// Get the preferred language for offline push.
_5
ChatClient.getInstance().pushManager().getPreferredNotificationLanguage(new ValueCallBack<String>(){});

vundefined