Resolve iOS8 not be able to do local push problem (attempting to schedule a locally notification)

Source: Internet
Author: User

Error content attempting to schedule a local notification <uiconcretelocalnotification:0x15686ff0>{fire date = February 26, 2015 week Thu 3:14:57, time zone = Asia/shanghai (gmt+8) offset 28800, repeat interval = nscalendarunitday, repeat count = UIL Ocalnotificationinfiniterepeatcount, next Fire date = February 26, 2015 Thursday China Standard Time PM 3:14:57, user info = {
key = name;

}} with a badge number but haven ' t received permission from the user to badge the application

Cause of the problem

IOS8 to achieve badge, alert and sound are required by user consent.

Solution Solutions

Register the notification first, pop-up dialog box, user consent, you can push the local.

-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (Nsdictionary *) launchOptions {    Handling IOS8 Local push cannot receive    float Sysversion=[[uidevice currentdevice]systemversion].floatvalue;    if (sysversion>=8.0) {        Uiusernotificationtype Type=uiusernotificationtypebadge | Uiusernotificationtypealert | Uiusernotificationtypesound;        Uiusernotificationsettings *setting=[uiusernotificationsettings Settingsfortypes:type Categories:nil];        [[UIApplication sharedapplication]registerusernotificationsettings:setting];    }    return YES;}



Resolve iOS8 not be able to do local push problem (attempting to schedule a locally notification)

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.