ad localnoti background music
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
#import "GiGaMaskTaskViewController.h"
|
||||
#import "GiGaUserDefault.h"
|
||||
#import "GiGaStartAdView.h"
|
||||
#import <UserNotifications/UserNotifications.h>
|
||||
#import "GiGaLocalNotificationManager.h"
|
||||
|
||||
@implementation AppDelegate (GiGaConfig)
|
||||
|
||||
@@ -77,7 +79,7 @@
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
- (void)setupRootVC{
|
||||
|
||||
GiGaMaskTaskViewController *maskeVC = [[GiGaMaskTaskViewController alloc] init];
|
||||
@@ -89,11 +91,42 @@
|
||||
[self.window makeKeyAndVisible];
|
||||
}
|
||||
|
||||
|
||||
-(void)creatAdView{
|
||||
|
||||
GiGaStartAdView *startadview = [[GiGaStartAdView alloc] initWithFrame:self.window.bounds];
|
||||
[startadview show];
|
||||
}
|
||||
|
||||
-(void)registLocalNotification{
|
||||
|
||||
if (@available(iOS 10.0, *)) {
|
||||
|
||||
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
|
||||
[center requestAuthorizationWithOptions:(UNAuthorizationOptionAlert | UNAuthorizationOptionBadge | UNAuthorizationOptionSound) completionHandler:^(BOOL granted, NSError * _Nullable error) {
|
||||
|
||||
}];
|
||||
|
||||
} else {
|
||||
|
||||
// Fallback on earlier versions
|
||||
UIUserNotificationSettings *setings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert categories:nil];
|
||||
//授权
|
||||
[[UIApplication sharedApplication] registerUserNotificationSettings:setings];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//接收本地通知 ios 8
|
||||
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
|
||||
{
|
||||
|
||||
if ([[[UIDevice currentDevice] systemVersion] floatValue] >=8.0 && [[[UIDevice currentDevice] systemVersion] floatValue] <10.0) {
|
||||
|
||||
[[GiGaLocalNotificationManager localNotifiationCenter] didResaveloaclNitification:notification];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user