how to set Action Button (i.e. UNNotificationAction) Title from payload received in iOS 10
<p>I am working on <strong>iOS 10 Rich media Push Notification</strong>. I want to send the title of <strong>UNNotificationAction</strong> Button title in notification <strong>Payload</strong>, how can I do it in Objective C. Suppose I send the notification Payload as follows :</p>

<pre><code> "apns": {
    "aps": {
     "alert":{
    "title":"Pusher Native Push Notifications API",
    "subtitle":"Bringing you iOS 10 support!",
    "body":"Now add more content to your Push Notifications!"
    },
 "badge":0,
 "sound":"default",
 "mutable-content":1,
 "category":"pusher"
},
"mediaUrl":"https:\/\/framework.realtime.co\/blog\/img\/ios10-video.mp4",
"mediaType":"mp4",
"action 1":{
"btnTitle":"View",
"Url":"https://www.go_to_this_link_on_Click_This_Link"
},
"action 2":{
"btnTitle":"Send Action",
"Url":"https://www.go_to_this_link_on_Click_This_Link"
}
}
</code></pre>

<p>I want to set the <strong>action button titles</strong> in push as the above payload described.</p>

<p>Static <strong>UNNotificationAction</strong> Title is working for me but I want to set it from payload My code for Static Button is as follows :</p>

<pre><code>    UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
    center.delegate = delegate;                    
    [center requestAuthorizationWithOptions:(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge) completionHandler:^(BOOL granted, NSError * _Nullable error) {
      if( !error ) {
        [[UIApplication sharedApplication] registerForRemoteNotifications];
        // required to get the app to do anything at all about push notifications
        NSLog( @"Push registration success." );
      } else {
        NSLog( @"Push registration FAILED" );
        NSLog( @"ERROR: %@ - %@", error.localizedFailureReason, error.localizedDescription );
        NSLog( @"SUGGESTIONS: %@ - %@", error.localizedRecoveryOptions, error.localizedRecoverySuggestion );
                             }
                         }];



 UNNotificationAction *ActionBtn1 = [UNNotificationAction actionWithIdentifier:@"Btn1" title:@"BUTTON 1" options:UNNotificationActionOptionNone];

UNNotificationAction *ActionBtn2 = [UNNotificationAction actionWithIdentifier:@"Btn2" title:@"BUTTON 2" options:UNNotificationActionOptionDestructive];

UNNotificationCategory *category = [UNNotificationCategory categoryWithIdentifier:@"pusher" actions:@[ActionBtn1,ActionBtn1] intentIdentifiers:@[] options:UNNotificationCategoryOptionNone];

    NSSet *categories = [NSSet setWithObject:category];
    [center setNotificationCategories:categories];
</code></pre>

<p>Could anyone please help me !</p>