알림 센터에서 iPhone을 여러 번 연속으로 진동 시키려합니다. 이것에 대해 연구하면서, 나는 애플이 단 하나의 경고가 발사되도록 허용하고 따라서 경고 당 하나의 진동 만 허용한다고 말하는 여러 게시물을 발견했다.잠긴 상태에서 여러 번 iPhone을 진동시키는 가장 좋은 방법은 무엇입니까?
최근에 내 전화에서 WhatsApp 전화가 들어 왔는데 그 전화가 방금 미쳐 버렸습니다. 나는 같은 행동을하려고 노력한다. 한 가지 가능한 해결책은 알림을 반복해서 삭제하고 만드는 것입니다.하지만 Apple이이 동작을 거부 할 것이라고 확신합니다.
이이 모양을 수있는 방법입니다 :
var interval = 10
var i = 0
while(i < interval) {
sendNotification(message)
sleep(1)
UIApplication.sharedApplication().cancelAllLocalNotifications()
i += 1
}
sendNotification(message)
func sendNotification(text: String) {
let notification = UILocalNotification()
notification.alertBody = "This is a test"
notification.alertAction = "Stop Alarm"
notification.soundName = UILocalNotificationDefaultSoundName
notification.category = "ALERT"
UIApplication.sharedApplication().scheduleLocalNotification(notification)
그래서,이를 달성하고 사과 지침을 준수하는 가장 좋은 방법은 무엇입니까?
당신은 애플 리케이션 전화를받을 수 있습니까? 걸려 오는 전화 알림은 로컬 알림과 다릅니다. –
알람 시계와 비슷합니다. – David