notificationcenter

NotificationCenter swift3 Can't observe post

馋奶兔 提交于 2019-12-08 10:19:56
问题 I have 3 notifications: NotificationCenter.default.post(name:NSNotification.Name("Notification1"), object: nil) NotificationCenter.default.post(name:NSNotification.Name("Notification2"), object: nil) NotificationCenter.default.post(name:NSNotification.Name("Notification3"), object: nil) And I have for each post one differents observer in view controller First : NotificationCenter.default.addObserver(forName:NSNotification.Name("Notification1"), object: nil, queue: nil, using: updateUx) Second

Can I dismiss the local notification when next time the app launch?

霸气de小男生 提交于 2019-12-08 01:08:52
问题 I know I can cancel the notification when user tap this notification in notification center . But can I cancel the notification in other palce where I can't get the related local notification from system. Can I serialize the local notification, and cancel it when the app runs next time? Sorry for make you misunderstand! I want to dismiss a posted notification in the notification center, but not a scheduled one. So what I want to ask is how to save the local notification object, then I can use

How to display an image from Asset Catalog in Today Extension?

混江龙づ霸主 提交于 2019-12-06 17:24:13
问题 I'm working on a Today Extension for iOS8. My App Group is set up correctly and I can successfully use NSUserDefaults to send simple bits of data to my extension (using this tutorial). In the storyboard for my extension, I've placed an image onto the storyboard and set the image to be an asset I have in my Asset Catalog. Even though it appears in Interface Builder, when I run the app on a device and simulator the image doesn't display. What am I missing? 回答1: Make sure the asset catalog is

iOS 11.1 UIImagePickerController video crop start time not movable

不羁岁月 提交于 2019-12-06 09:30:37
问题 We are displaying a UIImagePickerController for users to choose (and crop) a video for use within our app. Recently users have been experiencing issues trying to crop videos, with the start time handle becoming almost impossible to drag. It seems that the Photos app doesn't have this issue because the video timeline (and crop selection) is moved to the bottom of the screen. I assume this has to do with the new notification centre gestures that were added for the iPhone X. I believe this

Image previews in Notification Center

…衆ロ難τιáo~ 提交于 2019-12-06 05:51:03
问题 Is it possible to add an image to a push notification's payload? I've seen it being done in the Photos & Messages apps. I was hoping this wasn't some private Apple API. The screen shot below was taken on a device running iOS 6. 回答1: Is not possible According to the Push Notification Programming guide the payload max size should not exceed 256 Bytes: Documentation extract: Payload length—The length of the payload in network order (that is, big endian). The payload must not exceed 256 bytes and

How to display an image from Asset Catalog in Today Extension?

南楼画角 提交于 2019-12-04 22:59:47
I'm working on a Today Extension for iOS8. My App Group is set up correctly and I can successfully use NSUserDefaults to send simple bits of data to my extension (using this tutorial ). In the storyboard for my extension, I've placed an image onto the storyboard and set the image to be an asset I have in my Asset Catalog. Even though it appears in Interface Builder, when I run the app on a device and simulator the image doesn't display. What am I missing? Make sure the asset catalog is included in the target for your Today extension. 来源: https://stackoverflow.com/questions/25963059/how-to

Remove push from notificationcenter after app has been opened

孤者浪人 提交于 2019-12-04 16:22:19
When I send out a PUSH notification to my app, it stays in the notification center in iOS 5. How can I remove the notification from the notification center from within the app? Clearing the badge clears the notifications from the notification center. - (void)applicationDidBecomeActive:(UIApplication *)application { // Clear application badge when app launches [[UIApplication sharedApplication] setApplicationIconBadgeNumber:0]; } This only works if the number changes. So to make it work in case badge is already zero, set it to some value and clear it again after a delay. - (void

Stopping notification bar to popup during game play

流过昼夜 提交于 2019-12-03 16:06:22
Context: I am working on a windows phone game using XNA 4.0 framework. During the gameplay, if the user accidentally drags the top of screen, notification center gets dragged down. I have seen few apps where this behaviour is overridden and instead of notification center popping up, a small cue is shown at the top as shown in the screenshot below. Question: What is the API that stops notification center to come up when user accidentally drags the top of screen during gameplay? Screenshot of what I want to achieve: Same question asked on WP forum also but waiting for correct solution. To hide

iOS push notifications of other apps

醉酒当歌 提交于 2019-12-01 13:12:22
Is there a way of receiving all the push notifications of all apps? So all notifications being displayed in the notification center? If yes, is it also possible to perform an action when any push notification from any app is received? Thanks EDIT: It is not important if the app will be accepted by Apple. Push notifications are dispatched to the app that registered to receive them. You cannot access all notifications, so the short answer would be no . No, this is not possible. Notifications are considered by Apple to be private. There is no (public) way to do this that would still get your app

Dragging Gestures in iOS 8 Today Extensions

廉价感情. 提交于 2019-11-30 13:04:21
问题 I'm using a UIView subclass in my Today widget. The view makes use of swiping gestures. However, these gestures either scroll the whole Notification Center up and down, or make the Notification Center switch from Today to Notifications . Is there any way to prevent the touch events to be bubbled up to the Notification Center scroll view? Using [self setExclusiveTouch:YES]; in the subclass did not solve it unfortunately. 回答1: Is there any way to prevent the touch events to be bubbled up to the