No corner mark issue fixed on iOS app desktop icon

Source: Internet
Author: User

Today is a message notification, to display the number of messages on the icon on the desktop, for example

, the code is also added to the program: [UIApplication sharedapplication].applicationiconbadgenumber = 25;

But what to do is not to show, the last check data found in the iOS8 system must first let the user authorization to display, you can add the following code in the code


if (IS_IOS8) {
Uiusernotificationtype MyType = Uiremotenotificationtypebadge | Uiremotenotificationtypealert | Uiremotenotificationtypesound;
Uiusernotificationsettings *mysetting = [uiusernotificationsettings settingsfortypes:mytype categories:nil];
[[UIApplication sharedapplication] registerusernotificationsettings:mysetting];
}else{
Uiremotenotificationtype MyType = Uiremotenotificationtypebadge | Uiremotenotificationtypealert | Uiremotenotificationtypesound;
[[UIApplication sharedapplication] registerforremotenotificationtypes:mytype];
}


Where Is_ios8 is the macro definition I added, used to determine whether iOS8, the code is as follows:


#define IS_IOS8 ([[Uidevice currentdevice].systemversion Doublevalue] >= 8.0)

This, after restarting the app, will pop up a prompt user authorization prompt box, select OK, so you can display the number of corners on the desktop, and then go to the phone-set inside to see, there will be surprises, set up a lot of our app, such as:



No corner mark issue fixed on iOS app desktop icon

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.