ArtSabintsev / Siren

Notify users when a new version of your app is available and prompt them to upgrade.
http://sabintsev.com/
MIT License
4.24k stars 407 forks source link

Can I have a different text in the alert depending on the type of alert displayed? #393

Closed frank137 closed 2 years ago

frank137 commented 2 years ago

Is there a way to show a different text in the alert depending on the type of alert? For example,

If my Rule says that for a minor update I want the rule to be .annoying and for a major update the rule is .critical, then can I show a different body and title in the alert?

"Please make sure to update your app" in the case of .annoying

"You need to update your app in order to continue using it" in the case of .critical.

Thanks!

Frank

ArtSabintsev commented 2 years ago

Yes, see this example: https://github.com/ArtSabintsev/Siren/blob/master/Example/Example/AppDelegate.swift#L121

frank137 commented 2 years ago

Yes, see this example: https://github.com/ArtSabintsev/Siren/blob/master/Example/Example/AppDelegate.swift#L121

Hi Art, Thanks for your quick reply! As far as I understand in that example the custom strings will be applied to all rules.

Is there a way that I can have a different string for each different rule?

Like alert title for .annoying to be "Annoying Alert" And alert title for .critical to be "Critical Alert"

Or am I missing something obvious? Thanks again!

ArtSabintsev commented 2 years ago

Ah, no, no way to do it without building your own custom modal. That's too much of an edge case to support here.