当前位置: 动力学知识库 > 问答 > 编程问答 >

badge - Is there any limitation upon iOS applicationBadgeNumber?

问题描述:

Each time a pushNotification is received, a push badge appears on the right top corner of the application. As the number of the pushNotification grows, the badge number can turn out to be incredibly large.

Is there any limitation can be set to the badge number? Say, if the number of the push notification is over 100, can I set the badge number to "100+"?

I have already tried numbers with over 10 digits, and the badge appears to be "1,...3", which only the first and last numbers are displayed and the rest are presented by ".".

网友答案:

I imagine it will be an int64 (or int32) depending on device so that sets an upper limit of.

9,223,372,036,854,775,807 on iPhone 5s and iPad air

or

2,147,483,647 on other devices

and no, you can't set a custom format.

网友答案:

No , You cant set some custom format for app badge icon, we can only set int number to it,

and as you say if there is 10 digit nos., i'll guess it is rarest possibility for that user hasn't open app for too long.

网友答案:

Is there any limitation can be set to the badge number? Say, if the number of the push notification is over 100, can I set the badge number to "100+"?

No, i don't think you can do that.but you can limit badge number in your application, such as reset badge number when user enter your app each time.

分享给朋友:
您可能感兴趣的文章:
随机阅读: