UILocalNotificationを使用して、領域に侵入した際にローカル通知を行っているのですが
領域に侵入してから周期的に繰り返す設定の仕方がありましたらご教授願いたいと思います。
試しに、
notification.repeatInterval = NSCalendarUnit.Minute
を以下のコードに追加して、分刻みに通知できるか試してみましたが
最初の1回しか通知されませんでした。
<コード>
let coordinate = CLLocationCoordinate2DMake(省略)
let notification: UILocalNotification = UILocalNotification()
notification.alertBody = "目的地に近づきました"
notification.regionTriggersOnce = false
notification.region = CLCircularRegion(center: coordinate, radius: 100, identifier: "ID")
notification.region?.notifyOnEntry = true
notification.region?.notifyOnExit = false
notification.soundName = UILocalNotificationDefaultSoundName
UIApplication.sharedApplication().scheduleLocalNotification(notification)
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/03/10 01:15
2016/03/10 07:32 編集
2016/03/12 14:25