ad localnoti background music

This commit is contained in:
lianxiang
2018-08-24 21:20:18 +08:00
parent d43d7eaaf6
commit 983bb33644
25 changed files with 1773 additions and 35 deletions
+35 -2
View File
@@ -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