簡體   English   中英

交互式提醒選項在iOS中不可見

[英]Interactive reminder options not visible in iOS

我已經為本地通知實施了交互式提醒。 但是,只有在設備解鎖並且用戶在收到通知后立即拉下提醒時,這些交互選項才可見。 收到本地通知后立即顯示第一個圖像。

剛收到

如果向左或向右滑動,則不會發生任何事情。 但是,如果您下拉列表,則可以看到兩個交互選項。 就像第二張圖片一樣。

在此處輸入圖片說明

(問題1)實際上,我的第一個問題是,為什么在我聲明了三個交互式選項的情況下僅顯示兩個選項?

下面是我的相關代碼。

UIMutableUserNotificationCategory *notificationCategory = [[UIMutableUserNotificationCategory alloc] init];
notificationCategory.identifier = mutableUserNotificationCategoryId;
[notificationCategory setActions:@[notificationAction1, notificationAction2, notificationAction3] forContext:UIUserNotificationActionContextDefault];
[notificationCategory setActions:@[notificationAction1, notificationAction2, notificationAction3] forContext:UIUserNotificationActionContextMinimal];

NSSet *categories = [NSSet setWithObjects:notificationCategory, nil];

UIUserNotificationType types = (UIUserNotificationTypeSound | UIUserNotificationTypeAlert);
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types categories:categories];
[application registerUserNotificationSettings:settings];

(第2季度。)我的第二個問題是,為什么用戶在任何其他階段滑動通知時都看不到交互選項。 (示例通知顯示在通知中心下方)請查看我上傳的下一張圖像。

在此處輸入圖片說明 在此處輸入圖片說明

如果使用UIUserNotificationActionContextMinimal則通知警報將為此上下文顯示不超過2個自定義操作。 文件

在啟用3D觸摸的設備上,當下拉警報或使用3d觸摸手勢時,通知警報操作可用。 非3d觸摸設備可以使用您想要查看自定義動作的方式。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM