NotificationManager.GetNotificationChannel 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| 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
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
适用于
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
字符串:此值不能为 null。
- conversationId
- String
字符串:此值不能为 null。
返回
- 特性
注解
返回给定通道和聊天 ID 的通知通道设置。通道必须属于你的包,或者你作为已批准的通知委托的包(请参阅 canNotifyAsPackage(String)),否则不会返回。 若要将通道查询为通知委托,请从为该包创建的上下文(请参阅 Context.createPackageContext(String,int)调用此方法。
如果未找到具有给定会话 ID 的对话通道,则此方法将返回具有给定通道 ID 的父通道;如果不存在,则返回 null。
Android 参考。android.app.NotificationManager.getNotificationChannel
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。