Question:
How do I show an In-App message based on the application language?
Answer:
In-App content is localized by the Language tag, which the Pushwoosh SDK sets automatically from the device/system language (a lowercase two-letter ISO-639-1 code). Devices whose language has no translation in the template fall back to its default language.
If your app has its own in-app language switcher, the app language may differ from the system language. There are two ways to handle that:
- Recommended — redefine the Language tag. Call
setLanguage()from your app whenever the user picks a language (for examplePushwoosh.configure.setLanguage("de")on iOS). The Language tag then carries the app language, and the In-App is shown in the matching localization — no extra tag or segment needed. - Custom tag + segment. If you must keep the system language in the Language tag, create a custom tag (for example
App Language) in Audience → Tags, set it from your app withsetTags, build a segment on that tag value in Audience → Segments, and attach that segment to the In-App message.
Note: Segments were previously called Filters in the Control Panel.
Comments
0 comments
Please sign in to leave a comment.