Muneeb Rehman
Muneeb Rehman

Reputation: 129

Text alignment for push notifications in iOS swift

My iOS application is supported in english and arabic language versions. So when the app language is english, notification is showing from (left to right) and that is perfect!

How can I do the text alignment of push notification title and description when in arabic language i.e. from right to left? Please anyone help me out on this.

Upvotes: 2

Views: 1156

Answers (3)

Ibrahim Zakarya
Ibrahim Zakarya

Reputation: 96

After some testing, I discovered that the alignment depends on the content of the notification like follow:

  • if the title starts with RTL letter (like the Arabic language) the alignment of the title will be RTL
  • if the title starts with an LTR letter (English) the alignment will be LTR and the same applies to the notification body

Upvotes: 1

SuryaKantSharma
SuryaKantSharma

Reputation: 1181

No, You can not because handle by iOS not by the application. If the user had selected the regional & language setting RTL. Then the only iOS will handle this and automatically choose the RTL and LTR when based on content. Hope it helps enter image description here

Upvotes: 1

Srdr
Srdr

Reputation: 323

Push notifications are handled by iOS and you don't have such control over how they're shown. I think they'll be shown RTL on devices where the user has selected correct iOS regional settings.

Upvotes: 0

Related Questions