How to show UIAlertView for local notification instead of the label-notification which appear at top of the screen in ios7 ?

爷,独闯天下 提交于 2019-12-11 11:28:31

问题


because I think beyond iOS5 they remove UIAlertView instead of one label appear at the top of screen which I don't want,I am using this code but it doesn't trigger alertview, i need old look of localnotification.

UILocalNotification* localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = pickerDate;
localNotification.alertBody = self.itemText.text;
localNotification.alertAction = @"Show me the item";
localNotification.timeZone = [NSTimeZone defaultTimeZone];
localNotification.applicationIconBadgeNumber = [[UIApplication sharedApplication] applicationIconBadgeNumber]  [[UIApplication sharedApplication] scheduleLocalNotification:localNotification];

please Help, Thanks in Advance!


回答1:


The notification alert style cannot be changed in our application programmatically. This alert styles shown based on the user wish. If you see in iPhone settings-> notification center, you may see all the applications registered for notifications. The user can change the alert style for each application based on their wish. This is not in our hand.




回答2:


This is not up to the control of the app or the developer (using public API). The user can decide if and how to receive notifications from your app. You may suggest you your user on first launch/tutorial/help that for best experience, you may want to enable alerts instead of banners and perhaps display visual cues on how to do it.



来源:https://stackoverflow.com/questions/20875566/how-to-show-uialertview-for-local-notification-instead-of-the-label-notification

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!