2
我試圖通過iOS上的自定義分析系統跟蹤推送通知打開和解除,我一直無法獲得任何UNNotificationDismissActionIdentifier
響應。customDismissAction不適用於遠程通知
我的代碼與通知中心註冊:
if([[[UIDevice currentDevice] systemVersion] integerValue] >= 10){
UNNotificationCategory* generalCategory = [UNNotificationCategory
categoryWithIdentifier:@"GENERAL"
actions:@[]
intentIdentifiers:@[]
options:UNNotificationCategoryOptionCustomDismissAction];
// Register the notification categories.
UNUserNotificationCenter* center = [UNUserNotificationCenter currentNotificationCenter];
[center setNotificationCategories:[NSSet setWithObjects:generalCategory, nil]];
[center setDelegate:self];
};
當我把我的推送通知,我的類別設置爲常規。當我收到通知並刷卡右鍵解除該通知時,我不會收到任何代表回撥。
customDismissAction只適用於本地通知嗎?
您是否有幸運?不要'customDismissAction'假設你應該將一些動作傳遞給初始化器? – kelin
你能告訴我們你的有效載荷結構嗎?是'aps'鍵下的'category'嗎? – Honey