NotificationManager.CreateNotificationChannel(NotificationChannel) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Crée un canal de notification sur lequel les notifications peuvent être publiées.
[Android.Runtime.Register("createNotificationChannel", "(Landroid/app/NotificationChannel;)V", "GetCreateNotificationChannel_Landroid_app_NotificationChannel_Handler", ApiSince=26)]
public virtual void CreateNotificationChannel(Android.App.NotificationChannel channel);
[<Android.Runtime.Register("createNotificationChannel", "(Landroid/app/NotificationChannel;)V", "GetCreateNotificationChannel_Landroid_app_NotificationChannel_Handler", ApiSince=26)>]
abstract member CreateNotificationChannel : Android.App.NotificationChannel -> unit
override this.CreateNotificationChannel : Android.App.NotificationChannel -> unit
Paramètres
- channel
- NotificationChannel
NotificationChannel : canal à créer. Notez que le canal créé peut différer de cette valeur. Si le canal fourni est incorrect, une exception RemoteException est levée. Cette valeur ne peut pas être null.
- Attributs
Remarques
Crée un canal de notification sur lequel les notifications peuvent être publiées. Cela peut également être utilisé pour restaurer un canal supprimé et mettre à jour le nom, la description, le groupe et/ou l’importance d’un canal existant. Le nom et la description ne doivent être modifiés que si les paramètres régionaux changent ou en réponse au changement de nom d’utilisateur de ce canal. Par exemple, si un utilisateur a un canal nommé « Messages » et que l’utilisateur modifie ses paramètres régionaux, le nom de ce canal doit être mis à jour avec la traduction de « Messages » dans les nouveaux paramètres régionaux. L’importance d’un canal existant ne sera modifiée que si la nouvelle importance est inférieure à la valeur actuelle et que l’utilisateur n’a modifié aucun paramètre sur ce canal. Le groupe d’un canal existant ne sera modifié que si le canal n’appartient pas déjà à un groupe. Tous les autres champs sont ignorés pour les canaux qui existent déjà.
Référence Android pour android.app.NotificationManager.createNotificationChannel.
Les parties de cette page sont des modifications basées sur le travail créé et partagé par Android Open Source et utilisées en fonction des termes décrits dans la Creative Commons 2.5 Attribution License.