How to Implement iOS8 Interactive Notification

后端 未结 2 1221
刺人心
刺人心 2020-12-01 03:28

I am developing an iOS8 application which supports interactive notification. But I don\'t have clarity on the features supported by interactive notification and how to send/

2条回答
  •  春和景丽
    2020-12-01 03:38

    I would like to extend Sourav Gupta's answer a bit. Once you have done up to what Sourav explained, you have to implement the delegates for receiving push notification actions. The delegates are,

    - (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forLocalNotification:(UILocalNotification *)notification completionHandler:(void(^)())completionHandler {
    
    // Handle actions of local notifications here. You can identify the action by using "identifier" and perform appropriate operations
    
         if(completionHandler != nil)    //Finally call completion handler if its not nil
             completionHandler();
    }
    
    - (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void(^)())completionHandler {
    
    // Handle actions of remote notifications here. You can identify the action by using "identifier" and perform appropriate operations
    
         if(completionHandler != nil)    //Finally call completion handler if its not nil
             completionHandler();
    }
    

    You can refer remote notification payload sample here iOS8 Push notification Payload

提交回复
热议问题