About resetting an iOS app request push authorization request

Source: Internet
Author: User

Project to add push notification, after testing the local notification, found that the remote notification is not detected. Then you want to reset the authorization request.

Here's how to reset the authorization request:

Method One:

通用 - 还原 -抹掉所有内容和设置

But the first method is time-consuming, and erasing content is estimated to take a few 10 minutes. Then there is the second method.


Method Two:

Remove the app from your device

Shut down the device completely and reboot

Open settings, general-purpose date and time unplug device time faster than one day
Turn the device off again completely and restart

Installing your app now allows you to test all authorizations like a pure new process,


Check your app licensing options in Settings and reset all.


The code for the registration notice is attached:


In the Appdelegate Didfinishlaunchingwithoptions method, add the code:

UIApplication *app = [uiapplication sharedapplication];        Uiusernotificationsettings *settings = [Uiusernotificationsettings Settingsfortypes:uiusernotificationtypealert | Uiusernotificationtypebadge | Uiusernotificationtypesound Categories:nil];                if ([App Respondstoselector: @selector (registerusernotificationsettings:)]) {            NSLog (@ "8.0 registration notice");            [App registerusernotificationsettings:settings];        } else {            NSLog ("7.0 and below Registration notice");            [App Registerforremotenotificationtypes:uiusernotificationtypealert | Uiusernotificationtypebadge | Uiusernotificationtypesound];        }

For IOS8, a new didregisterusernotificationsettings method is added. If you want to register remotenotification, you need to add the registration code in this method:

if (IS_IOS8) {        [[uiapplication sharedapplication] registerforremotenotifications];    }
Otherwise, if the registration notification is not completed, add

[[UIApplication sharedapplication] registerforremotenotifications]
Will cause the following warning:

Attempting to schedule a local notification ... with an alert but haven ' t received permission from the user to display a Lerts




Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

About resetting an iOS app request push authorization request

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.