ANCS : what is the concept of PositiveAction?
<p>I'm trying to work with the Apple Notification Center Service to make interactions between a Bluetooth peripheral and an iOS device.
In the <a href="https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/AppleNotificationCenterServiceSpecification/Specification/Specification.html#//apple_ref/doc/uid/TP40013460-CH1-SW61" rel="nofollow">documentation</a> Apple mention the 2 notification actions: EventFlagPositiveAction and EventFlagNegativeAction…</p>

<p>So far, the <em>Negative</em> part works: once the notification is transmitted to the peripheral, this latter one can trigger the negative action, resulting dismissal of the notification.</p>

<p>But I cannot trigger the <em>Positive</em> side of the force... My Notification has a single action button and I want this button to be considered as the positive action... But I don't know how it works: is it implicit ? do all actions have the <em>positive</em> flag ? or should I do something to make it recognized as the <em>positive</em> one ?</p>

<p>This is more a conceptual question about ACNS, but for information, below is the code I'm using:</p>

<p>1st to register for the local notification in the AppDelegate:</p>

<pre><code>    let notificationTypes = UIUserNotificationType.Alert.union(UIUserNotificationType.Sound).union(UIUserNotificationType.Badge)

    let launchAction = UIMutableUserNotificationAction()
    launchAction.identifier = "LAUNCH_ACTION"
    launchAction.title = "OK"
    launchAction.activationMode = UIUserNotificationActivationMode.Foreground
    launchAction.destructive = false
    /* this is this UIMutableUserNotificationAction that I want to trigger from my external device, and should be considered as the famous positive action I am looking for */

    let notificationCategory = UIMutableUserNotificationCategory()

    notificationCategory.identifier = "LAUNCH_NOTIFICATION"
    notificationCategory.setActions([launchAction], forContext: .Minimal) 
    application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: notificationTypes, categories: NSSet(array:[notificationCategory]) as? Set&lt;UIUserNotificationCategory&gt;))
</code></pre>

<p>And 2nd, later to create a notification</p>

<pre><code>    let localNotification:UILocalNotification = UILocalNotification()
    localNotification.alertAction = "Hello"
    localNotification.alertBody = "World"
    localNotification.fireDate = NSDate(timeIntervalSinceNow: 5)
    localNotification.soundName = UILocalNotificationDefaultSoundName
    localNotification.hasAction = true
    localNotification.category = "LAUNCH_NOTIFICATION"
    UIApplication.sharedApplication().scheduleLocalNotification(localNotification)
</code></pre>