Logout push
[[uiapplication sharedapplication] unregisterforremotenotifications];
Register push
[[uiapplication sharedapplication] registerforremotenotifications];
Code control turn off system push beep
Configuring a user to configure a sound health value nil There's a voice, not a sound.
-(void) Jpushnotificationcenter: (unusernotificationcenter *) Center willpresentnotification: ( Unnotification *) notification Withcompletionhandler: (void (^) (nsinteger)) completionhandler{
//Required
nsdictionary * userInfo = notification. Request. Content. UserInfo;
if([Notification. Request. Trigger iskindofclass: [unpushnotificationtrigger class]]) {
[jpushservice handleremotenotification: userInfo];
}
nsuserdefaults * userdefault = [nsuserdefaults standarduserdefaults];
if ([Userdefault objectforkey:@ "sound"]) {
audioservicesplaysystemsound(xx);
}Else{
audioservicesplaysystemsound(1312);
}
Completionhandler (unnotificationpresentationoptionalert); // need to implement this method, choose whether to remind the user, there are Badge, sound,alert Three types can choose to set
}
Settings for iOS development push messages