I've done following code to display action buttons while notification comes using one signal. But when app is killed notification is not coming. It's working properly in background/foreground mode. But when app is not in tray even notification stop coming. Without action buttons it's working perfectly.
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
center.delegate = self;
[center requestAuthorizationWithOptions:(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge) completionHandler:^(BOOL granted, NSError * _Nullable error)
{
if( !error ) {
[[UIApplication sharedApplication] registerForRemoteNotifications];
NSLog( @"Push registration success." );
} else {
NSLog( @"Push registration FAILED" );
}];
UNNotificationCategory *modifyCategory = [UNNotificationCategory categoryWithIdentifier:CYLInviteCategoryIdentifier actions:@[] intentIdentifiers:@[] options:UNNotificationCategoryOptionNone];
UNNotificationAction* snoozeAction = [UNNotificationAction
actionWithIdentifier:@"ACCEPT_ACTION"
title:@"Accept"
options:UNNotificationActionOptionForeground];
UNNotificationAction* stopAction = [UNNotificationAction
actionWithIdentifier:@"DECLINE_ACTION"
title:@"Decline"
options:UNNotificationActionOptionDestructive];
UNNotificationCategory* actionCategory = [UNNotificationCategory
categoryWithIdentifier:@"INCOMING_CALL"
actions:@[snoozeAction, stopAction]
intentIdentifiers:@[]
options:UNNotificationCategoryOptionNone];
[center setNotificationCategories:[NSSet setWithObjects: modifyCategory, actionCategory,
nil]];