iOS8 APNs,cancel a notification from notification center - ios

I need to cancel a notification from the notification center on iOS8.
You need at least 10 reputation publish pictures, but you can look at the two pictures in the following URL to see what I mean: http://www.cocoachina.com/bbs/read.php?tid-307533.html. Image one has two notifications, but in image two 未接来电(4) has been 未接来电(5).
I know the cancelAllLocalNotifications API, but how can I cancel a single notification in iOS8 new api?

Related

Define Thumbnail in iOS Notifications

if you are receiving a local or push notification on iOS 15, normally you see the app's icon on the left of the notification and have the ability to attach media that is shown as thumbnail on the right. See here:
However some notifications (communications apps?) show the profile picture of the person sending the message (eg. iMessage or Slack in the example).
I'm running a news app and would like to place the logo of the publisher there. Is it possible to manipulate the image on the left and if so, how?

Notification should stay

I have my application developed on iOS 8 . I have implemented push notification in my application. In iOS 8 clicking on notification automatically clears that particular notification. But my requirement is notification should stay until clear manually. Please give suggestion how to achieve this.
This is a system behavior. You can not prevent this to happen.
If you need something to be always visible from the notification center, consider to create a Notification Center Widget.

iOS push/local notifications with image like in iMessage

I want to display an image (custom view) in Notification Center when app receives push/local notification. e.g -
or
How could I achieve the same? Can anyone help me?
No you can't. The notification payload contains up to 256 bytes long. You can't send an image with it however you can send image URL with payload and show it in your application.
The official documentation does not provide information about this. Currently, it is possible but I guess this feature is Apple exclusive.
Adding to that what you have shown in the images is called Widget, you can create it using this link.

Questions about Local notifications in iOS

I'm working on a project on iOS 7, 8 that use a lot of notifications (Remote, Local). I have some questions about Local Notification.
I'm using Local Notification to schedule an alarm or a count-down. As I know, the use of NSTimer is not really a good choice since it has only up to 10' in background & if the app process is killed it doesn't work anymore. Local Notification is managed by iOS but I have to accept its alert when the app is not in foreground. There's nothing like silent local notification (local notification without alert, sound or badge and app still knows about it although it's in background). Am I right ?
Let's assume that there're some simple local notifications in Notification Center, scheduled by our app. Normally when I touch on a notification to see it in my app, the others remain present until we interact with them. In some cases that I haven't figured out, all other notifications are removed from the Notification Center. Does anyone encounter this & understand why ?
I find the interactive notification feature in iOS very limited. I want to change the title of a defined UIMutableUserNotificationAction button & add an image for it, like I can do with UIButton. So the question is : Is it possible to customize the UI of an action button ?
Thanks for your help !
Unfortunately there is no correspondence in silent notification using local notifications.
The number of the visible notification in the notification center is a user decision, the user in Settings can decide to set a different number or decide to do not show them in notification center as well. As for the first point no. The third point is not clear, you can set the image you want for a remote just put in the payload the right name, local notifications use the app icon.
There is no silent notification for Local Notification. The user has to click to the notification to open your App.
I suppose that the associated application has deleted those notifications programmatically. Else, those notifications must stay in the notification center.
You cannot add image to action buttons but just the titles.
I tried more than two weeks to do the same. I had to show notification after 2 hrs even if the use doesn't click the notification. But the repetition facility is well handled in objective C. I could have created multiple local notification but it will also violates the total number of 64 notifications. Apple needs to improved the same.

Retract push notification on iPhone?

I haven't come across a documented method of doing it, but is it at all possible to retract expired notifications/alerts pushed to an iPhone?
I know it can be done in theory, as the prime example is iMessage: if you receive an iMessage but read it on another device, the unread message notification on the lock screen will disappear from any other devices subscribed to the iMessage account in question.
Thanks!

Resources