Skip to content

Push permission application authorization (required) ​

!!! This API exists only in the swift SDK of version 1.2.0 or later. You do not need to call this API if you use the Object-C SDK or the Swift SDK before version 1.2.0.

effect ​

Pull up the push authority authorization pop-up window, and the specific call timing can be communicated with our PM for confirmation. Make sure to apply for push permissions to users at the right time. If there is no call timing requirement, it can be called in the didFinishLaunchingWithOptions function of the app startup agent.


Function ​

objective-c
- (void)gamedreamerNotificationAuthWithCompletion:(void (^)(bool success, NSError *error))completion;

Correction ​

Parameter nameParameter typeexplain
successbool0: application failed; 1: permission succeeded
successNSErrorThe authorization error message returned by the system,⚠The error message is empty when the user does not allow authorization.

Example code ​

objective-c
[GamedreamerManager.shareInstance gamedreamerNotificationAuthWithCompletion:^(_Bool success, NSError *error) {
        NSLog(@"---通知授权状态:%d---",success);
        NSLog(@"---错误信息:%@---",error);
}];