Search code examples
iosswiftmessage

Swift Icon badge number exclamation mark


Is there a way to set the icon badge to an exclamation mark? Messages uses this feature if a message could not be send, but I'm not able to find something about this.


Solution

  • At the moment, you cannot set the app's icon badge text to anything other than a number. What you have seen in the messages app is only one of the "privileges" of the apps built by Apple, to give their users a better experience. But for matters of security, Apple does not allow developers to do that, because who knows in what way a dev will program his app to start spamming with unwanted messages in the badges of the app.

    Instead of that, you can just put a normal badge number and send a local notification with the desired text to catch the user's attention.

    Hope it helps!