語言

NotificationManager.GetNotificationChannel 方法

定義

多載

名稱 Description
GetNotificationChannel(String)

回傳給指定頻道 ID 的通知頻道設定。

GetNotificationChannel(String, String)

回傳該頻道的通知頻道設定和對話 ID。

GetNotificationChannel(String)

回傳給指定頻道 ID 的通知頻道設定。

[Android.Runtime.Register("getNotificationChannel", "(Ljava/lang/String;)Landroid/app/NotificationChannel;", "GetGetNotificationChannel_Ljava_lang_String_Handler", ApiSince=26)]
public virtual Android.App.NotificationChannel? GetNotificationChannel(string? channelId);
[<Android.Runtime.Register("getNotificationChannel", "(Ljava/lang/String;)Landroid/app/NotificationChannel;", "GetGetNotificationChannel_Ljava_lang_String_Handler", ApiSince=26)>]
abstract member GetNotificationChannel : string -> Android.App.NotificationChannel
override this.GetNotificationChannel : string -> Android.App.NotificationChannel

參數

channelId
String

String

傳回

屬性

備註

回傳給指定頻道 ID 的通知頻道設定。該通道必須屬於你的套件,或是你被核准通知代理人的套件(參見 canNotifyAsPackage(String)),否則不會被回傳。 若要查詢通道作為通知代理,請從該套件建立的上下文中呼叫此方法(參見 Context.createPackageContext(String,int))。

Android 參考資料。android.app.NotificationManager.getNotificationChannel

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

GetNotificationChannel(String, String)

回傳該頻道的通知頻道設定和對話 ID。

[Android.Runtime.Register("getNotificationChannel", "(Ljava/lang/String;Ljava/lang/String;)Landroid/app/NotificationChannel;", "GetGetNotificationChannel_Ljava_lang_String_Ljava_lang_String_Handler", ApiSince=30)]
public virtual Android.App.NotificationChannel? GetNotificationChannel(string channelId, string conversationId);
[<Android.Runtime.Register("getNotificationChannel", "(Ljava/lang/String;Ljava/lang/String;)Landroid/app/NotificationChannel;", "GetGetNotificationChannel_Ljava_lang_String_Ljava_lang_String_Handler", ApiSince=30)>]
abstract member GetNotificationChannel : string * string -> Android.App.NotificationChannel
override this.GetNotificationChannel : string * string -> Android.App.NotificationChannel

參數

channelId
String

字串:此值不可能為空值。

conversationId
String

字串:此值不可能為空值。

傳回

屬性

備註

回傳該頻道的通知頻道設定和對話 ID。該通道必須屬於你的套件,或是你被核准通知代理人的套件(參見 canNotifyAsPackage(String)),否則不會被回傳。 若要查詢通道作為通知代理,請從該套件建立的上下文中呼叫此方法(參見 Context.createPackageContext(String,int))。

若找不到擁有該對話 ID 的對話頻道,此方法將回傳具有該頻道 ID 的父頻道,若兩者都不存在則為空頻道。

Android 參考資料。android.app.NotificationManager.getNotificationChannel

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於