开发者

UIAlertView Display while iPhone is asleep and locked

开发者 https://www.devze.com 2023-01-14 21:03 出处:网络
I am writing an app the is pretty much always going to be open (hardly ever would run in background) and I want to be able to alert the user with a 开发者_StackOverflowsound, vibrating the phone, and

I am writing an app the is pretty much always going to be open (hardly ever would run in background) and I want to be able to alert the user with a 开发者_StackOverflowsound, vibrating the phone, and showing an alert message when there is a state change. The problem I am having is that when I use the UIAlertView, the AlertView seems to be hit or miss whether it plays the sound and/or vibrates. For example, sometimes it only alerts the user after the phone is unlocked. Is there a way that I can make the UIAlertView more aggressive?


In iOS 4, Push Notifications are no longer the only option.

You'll want to look into the UILocalNotification class. It provides similar functionality without having to setup/maintain a push notification server.

More information here: Local Notification Programming Guide.

0

精彩评论

暂无评论...
验证码 换一张
取 消