ad localnoti background music
This commit is contained in:
+32
-7
@@ -11,6 +11,7 @@
|
||||
#import "AppDelegate+ThirdParty.h"
|
||||
#import "GiGaUserDefault.h"
|
||||
#import "JPUSHService.h"
|
||||
#import "GiGaLocalNotificationManager.h"
|
||||
|
||||
@interface AppDelegate ()
|
||||
//保持后台长时间运行
|
||||
@@ -26,10 +27,15 @@
|
||||
// Override point for customization after application launch.
|
||||
//[NSThread sleepForTimeInterval:1];//延迟启动
|
||||
|
||||
application.applicationIconBadgeNumber = 0;
|
||||
[JPUSHService resetBadge];
|
||||
_isMasking = NO;
|
||||
|
||||
[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
|
||||
[self registLocalNotification];
|
||||
|
||||
[self configThridPartyWithOptions:launchOptions];
|
||||
|
||||
[self configEnvironment];
|
||||
|
||||
[self setupRootVC];
|
||||
//广告页
|
||||
[self creatAdView];
|
||||
@@ -41,16 +47,21 @@
|
||||
- (void)applicationWillResignActive:(UIApplication *)application {
|
||||
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (void)applicationDidEnterBackground:(UIApplication *)application {
|
||||
|
||||
|
||||
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||
//后台模式
|
||||
[self creatBackGoundTask];
|
||||
|
||||
|
||||
// 当 开启面膜时间 长期保持后台模式
|
||||
if (_isMasking) {
|
||||
[self creatBackGoundTask];
|
||||
}
|
||||
//[self creatBackGoundTask];
|
||||
|
||||
}
|
||||
|
||||
@@ -83,18 +94,32 @@
|
||||
- (void)applicationWillEnterForeground:(UIApplication *)application {
|
||||
application.applicationIconBadgeNumber = 0;
|
||||
[JPUSHService resetBadge];
|
||||
|
||||
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
|
||||
}
|
||||
|
||||
|
||||
- (void)applicationDidBecomeActive:(UIApplication *)application {
|
||||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||
}
|
||||
|
||||
|
||||
- (void)applicationWillTerminate:(UIApplication *)application {
|
||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||
|
||||
//app 挂起 面膜时间未结束 将发送本地通知提醒
|
||||
|
||||
if (_isMasking) {
|
||||
|
||||
[[GiGaLocalNotificationManager localNotifiationCenter] sendLocalNotification:@"闹钟提醒!" fireTimeInterval:2 alertAction:@"面膜时间已添加闹钟提醒!" withIdentifier:kLOCALNotifiID_APPTERMINAL];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-(void)remoteControlReceivedWithEvent:(UIEvent *)event
|
||||
{
|
||||
if (event.type == UIEventTypeRemoteControl ) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user