私のiPhoneアプリケーションがバックグラウンドでも、UILocalNotificationを使用して毎日午後8時にalramを表示できますか?iPhone - アラームとしてのUILocalNotification
1
A
答えて
3
fireDate
8.00にPMを設定し、NSDayCalendarUnit
からrepeatInterval
を設定し、正しい[[UIApplication sharedApplication] scheduleLocalNotification: myNotification];
2
dasdomの答えとアラートをスケジュールします。デバイスにサイレントモードが設定されている場合は、アラームで音が鳴らないようにするだけです。 UILocalNotificationのAppleの制限です。
+0
それはすべきです!私は電話が黙って欲しいと思っているときには、どんなアプリもノーズにしたくない! – dasdom
0
UILocalNotification *localNotification =[[UILocalNotification alloc]init];
NSCalendar *calendar=[NSCalendar currentCalendar];
[calendar setTimeZone:[NSTimeZone defaultTimeZone]];
unsigned currentFlag=NSDayCalendarUnit|NSMonthCalendarUnit|NSYearCalendarUnit|NSWeekdayCalendarUnit;
NSDateComponents *comp=[calendar components:currentFlag fromDate:[NSDate date]];
comp.hour=8;
comp.minute=0;
comp.second=0;
NSDate *date=[[calendar dateFromComponents:comp]dateByAddingTimeInterval:0];
if (localNotification==nil) {
return;
}
localNotification.fireDate=date;
localNotification.timeZone=[NSTimeZone defaultTimeZone];
localNotification.repeatCalendar=[NSCalendar currentCalendar];
[email protected]"Good Morning dude..!";
[email protected]"Snooze";
localNotification.repeatInterval=NSDayCalendarUnit;
[email protected]"goodmorning.caf";
[[UIApplication sharedApplication]scheduleLocalNotification:localNotification];
私は、これはあなたを助けることを願っています...!
関連する問題
- 1. iPhoneの設定とUILocalNotification
- 2. iPhone UILocalNotificationの値
- 3. アラームiphone sdkの問題
- 4. UILocalNotificationはiPhoneでサウンドを再生していませんか?
- 5. iPhoneアラームをコードに設定していますか?
- 6. iPhoneアラームをアクティブにして音を出す
- 7. UILocalNotificationとiOS 4.2
- 8. テーブルビューとUILocalNotificationとDetailViewController
- 9. 繰り返しのローカル通知を使用したiPhoneアラーム
- 10. アラーム偶数アプリケーションiPhoneで閉じた
- 11. iPhoneでcaldavアラームを無効にする
- 12. iPhoneとiPadのアラームをプログラム的に再生する方法は?
- 13. iphone一定の時間にアラーム音を鳴らします
- 14. iOS 4.3、iPhone 4はUILocalNotificationでカスタムサウンドを再生していません
- 15. iPhoneのアラーム/ユーザアラートにアクセスして設定する時間間隔で
- 16. 毎日の固定時間としてUILocalNotificationが発生する
- 17. デバイスの音量を設定する - UILocalNotification - iphoneをサイレントモードにする
- 18. UILocalNotification repeatInterval
- 19. UILocalNotificationプロセス
- 20. UILocalNotification - Later
- 21. UILocalNotificationスケジュールアラート
- 22. UILocalNotificationクラッシュ
- 23. アラームとベースアダプター[アンドロイドアプリケーション]
- 24. イベントベースのUILocalNotification
- 25. Androidのアラームとサービスのトリガー
- 26. アラームの解除と削除
- 27. 「隠し」カレンダーアイテムを作成して、iPhoneアプリで通知アラームを表示することはできますか?
- 28. UILocalNotificationのアラートアクションのコード
- 29. サイレントモードでのUILocalNotificationサウンド
- 30. NSWeekCalendarUnitとNSWeekDayCalendarUnitの違いはUILocalNotification repeatInterva
電話がサイレントモードに設定されていても音を出すように強制することはできますか? – Anthony
アプリがバックグラウンドで実行されていない場合でも、これは機能しますか? – Satyam
はい、そうです。魔法です。 – dasdom