簽到簽退提醒_第1頁(yè)
簽到簽退提醒_第2頁(yè)
簽到簽退提醒_第3頁(yè)
簽到簽退提醒_第4頁(yè)
簽到簽退提醒_第5頁(yè)
已閱讀5頁(yè),還剩1頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、簽到簽退提醒說(shuō)明:還有5(10,15)分鐘到上班時(shí)間時(shí)推送提醒消息,下班時(shí)間已過(guò)5(10,15)分鐘時(shí)推送提醒消息,上班和下班時(shí)間均為從服務(wù)器獲取的配置時(shí)間NSDateFormatter *df=NSDateFormatter alloc init; df setTimeZone:NSTimeZone timeZoneWithAbbreviation:"UTC" df setDateFormat:"HH:mm:ss" NSDate *date = NSDate date; NSTimeZone *zone = NSTimeZone systemTimeZ

2、one; NSInteger interval = zone secondsFromGMTForDate: date; NSDate *localeDate = date dateByAddingTimeInterval: interval; NSString *localStr = df stringFromDate:localeDate; NSDate *localDate = df dateFromString:localStr; /獲取上班時(shí)間 NSString * amTime = responseObject objectForKey:"am" NSDate *

3、amDate=df dateFromString:amTime; /獲取下班時(shí)間 NSString * pmTime = responseObject objectForKey:"pm" NSDate *pmDate=df dateFromString:pmTime;if (UIApplication sharedApplication currentUserNotificationSettings.types != UIUserNotificationTypeNone) if (inRemind = YES) if (label.text isEqualToString:

4、"提前5分鐘提醒") NSDate *advanceTime = NSDate dateWithTimeInterval:-60 * 5 sinceDate:amDate; NSTimeInterval inRemindTime=advanceTime timeIntervalSinceDate:localDate; UILocalNotification *notification=UILocalNotification allocinit; /設(shè)置調(diào)用時(shí)間 notification.fireDate=NSDate dateWithTimeIntervalSinceNow

5、:inRemindTime;/通知觸發(fā)的時(shí)間,10s以后 notification.repeatInterval=kCFCalendarUnitDay;/循環(huán)通知的周期 /設(shè)置通知屬性 notification.alertBody="還有5分鐘,記得簽到哦!" /通知主體/ /notification.applicationIconBadgeNumber=1;/應(yīng)用程序圖標(biāo)右上角顯示的消息數(shù) notification.alertAction="打開(kāi)應(yīng)用" /待機(jī)界面的滑動(dòng)動(dòng)作提示 notification.alertLaunchImage="D

6、efault"/通過(guò)點(diǎn)擊通知打開(kāi)應(yīng)用時(shí)的啟動(dòng)圖片,這里使用程序啟動(dòng)圖片 notification.soundName=UILocalNotificationDefaultSoundName;/收到通知時(shí)播放的聲音,默認(rèn)消息聲音 /設(shè)置用戶信息 notification.userInfo="id":1,"user":"Kenshin Cui"/綁定到通知上的其他附加信息 /調(diào)用通知 UIApplication sharedApplication scheduleLocalNotification:notification; e

7、lse if (label.text isEqualToString:"提前10分鐘提醒") NSDate *advanceTime = NSDate dateWithTimeInterval:-60 *10 sinceDate:amDate; NSTimeInterval inRemindTime=advanceTime timeIntervalSinceDate:localDate; UILocalNotification *notification=UILocalNotification allocinit; /設(shè)置調(diào)用時(shí)間 notification.fireDate

8、=NSDate dateWithTimeIntervalSinceNow:inRemindTime; notification.repeatInterval=kCFCalendarUnitDay;/循環(huán)通知的周期 / notification.repeatInterval=2;/通知重復(fù)次數(shù) /notification.repeatCalendar=NSCalendar currentCalendar;/當(dāng)前日歷,使用前最好設(shè)置時(shí)區(qū)等信息以便能夠自動(dòng)同步時(shí)間 /設(shè)置通知屬性 notification.alertBody="還有10分鐘,記得簽到哦!" /通知主體 /noti

9、fication.applicationIconBadgeNumber=1;/應(yīng)用程序圖標(biāo)右上角顯示的消息數(shù) notification.alertAction="打開(kāi)應(yīng)用" /待機(jī)界面的滑動(dòng)動(dòng)作提示 notification.alertLaunchImage="Default"/通過(guò)點(diǎn)擊通知打開(kāi)應(yīng)用時(shí)的啟動(dòng)圖片,這里使用程序啟動(dòng)圖片 notification.soundName=UILocalNotificationDefaultSoundName;/收到通知時(shí)播放的聲音,默認(rèn)消息聲音 / notification.soundName="msg

10、.caf"/通知聲音(需要真機(jī)才能聽(tīng)到聲音) /設(shè)置用戶信息 notification.userInfo="id":1,"user":"Kenshin Cui"/綁定到通知上的其他附加信息 /調(diào)用通知 UIApplication sharedApplication scheduleLocalNotification:notification; else if (label.text isEqualToString:"提前15分鐘提醒") NSDate *advanceTime = NSDate dateW

11、ithTimeInterval:-60 * 15 sinceDate:amDate; NSTimeInterval inRemindTime=advanceTime timeIntervalSinceDate:localDate; UILocalNotification *notification=UILocalNotification allocinit; /設(shè)置調(diào)用時(shí)間 notification.fireDate=NSDate dateWithTimeIntervalSinceNow:inRemindTime; notification.repeatInterval=kCFCalendar

12、UnitDay;/循環(huán)通知的周期 / notification.repeatInterval=2;/通知重復(fù)次數(shù) /notification.repeatCalendar=NSCalendar currentCalendar;/當(dāng)前日歷,使用前最好設(shè)置時(shí)區(qū)等信息以便能夠自動(dòng)同步時(shí)間 /設(shè)置通知屬性 notification.alertBody="還有15分鐘,記得簽到哦!" /通知主體 /notification.applicationIconBadgeNumber=1;/應(yīng)用程序圖標(biāo)右上角顯示的消息數(shù) notification.alertAction="打開(kāi)應(yīng)用

13、" /待機(jī)界面的滑動(dòng)動(dòng)作提示 notification.alertLaunchImage="Default"/通過(guò)點(diǎn)擊通知打開(kāi)應(yīng)用時(shí)的啟動(dòng)圖片,這里使用程序啟動(dòng)圖片 notification.soundName=UILocalNotificationDefaultSoundName;/收到通知時(shí)播放的聲音,默認(rèn)消息聲音 / notification.soundName="msg.caf"/通知聲音(需要真機(jī)才能聽(tīng)到聲音) /設(shè)置用戶信息 notification.userInfo="id":1,"user"

14、;:"Kenshin Cui"/綁定到通知上的其他附加信息 /調(diào)用通知 UIApplication sharedApplication scheduleLocalNotification:notification; if (outRemind = YES) if (label2.text isEqualToString:"延后5分鐘提醒") NSDate *delayTime = NSDate dateWithTimeInterval:60 * 5 sinceDate:pmDate; NSTimeInterval outRemindTime=delayT

15、ime timeIntervalSinceDate:localDate; if (outRemindTime > 0) UILocalNotification *notification=UILocalNotification allocinit; /設(shè)置調(diào)用時(shí)間 notification.fireDate=NSDate dateWithTimeIntervalSinceNow:outRemindTime;/通知觸發(fā)的時(shí)間,10s以后 notification.repeatInterval=kCFCalendarUnitDay;/循環(huán)通知的周期 /設(shè)置通知屬性 notification.

16、alertBody="辛苦了一天,別忘了簽退!" /通知主體 /notification.applicationIconBadgeNumber=1;/應(yīng)用程序圖標(biāo)右上角顯示的消息數(shù) notification.alertAction="打開(kāi)應(yīng)用" /待機(jī)界面的滑動(dòng)動(dòng)作提示 notification.alertLaunchImage="Default"/通過(guò)點(diǎn)擊通知打開(kāi)應(yīng)用時(shí)的啟動(dòng)圖片,這里使用程序啟動(dòng)圖片 notification.soundName=UILocalNotificationDefaultSoundName;/收到通知時(shí)播

17、放的聲音,默認(rèn)消息聲音 /設(shè)置用戶信息 notification.userInfo="id":1,"user":"Kenshin Cui"/綁定到通知上的其他附加信息 /調(diào)用通知 UIApplication sharedApplication scheduleLocalNotification:notification; else if (label2.text isEqualToString:"延后10分鐘提醒") NSDate *delayTime = NSDate dateWithTimeInterval:6

18、0 * 10 sinceDate:pmDate; NSTimeInterval outRemindTime=delayTime timeIntervalSinceDate:localDate; if (outRemindTime > 0) UILocalNotification *notification=UILocalNotification allocinit; /設(shè)置調(diào)用時(shí)間 notification.fireDate=NSDate dateWithTimeIntervalSinceNow:outRemindTime;/通知觸發(fā)的時(shí)間,10s以后 notification.repe

19、atInterval=kCFCalendarUnitDay;/循環(huán)通知的周期 /設(shè)置通知屬性 notification.alertBody="辛苦了一天,別忘了簽退!" /通知主體 /notification.applicationIconBadgeNumber=1;/應(yīng)用程序圖標(biāo)右上角顯示的消息數(shù) notification.alertAction="打開(kāi)應(yīng)用" /待機(jī)界面的滑動(dòng)動(dòng)作提示 notification.alertLaunchImage="Default"/通過(guò)點(diǎn)擊通知打開(kāi)應(yīng)用時(shí)的啟動(dòng)圖片,這里使用程序啟動(dòng)圖片 notifi

20、cation.soundName=UILocalNotificationDefaultSoundName;/收到通知時(shí)播放的聲音,默認(rèn)消息聲音 /設(shè)置用戶信息 notification.userInfo="id":1,"user":"Kenshin Cui"/綁定到通知上的其他附加信息 /調(diào)用通知 UIApplication sharedApplication scheduleLocalNotification:notification; else if (label2.text isEqualToString:"延后15分

21、鐘提醒") NSDate *delayTime = NSDate dateWithTimeInterval:60 * 15 sinceDate:pmDate; NSTimeInterval outRemindTime=delayTime timeIntervalSinceDate:localDate; if (outRemindTime > 0) UILocalNotification *notification=UILocalNotification allocinit; /設(shè)置調(diào)用時(shí)間 notification.fireDate=NSDate dateWithTimeIntervalSinceNow:outRemindTime;/通知觸發(fā)的時(shí)間,10s以后 notification.repeatInterval=kCFCalendarUnitDay;/循環(huán)通知的周期 /設(shè)置通知屬性 notifi

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論