Language

NotificationChannel.SetSound(Uri, AudioAttributes) メソッド

定義

このチャネルに投稿された通知とそのオーディオ属性に対して再生するサウンドを設定します。

[Android.Runtime.Register("setSound", "(Landroid/net/Uri;Landroid/media/AudioAttributes;)V", "", ApiSince=26)]
public void SetSound(Android.Net.Uri? sound, Android.Media.AudioAttributes? audioAttributes);
[<Android.Runtime.Register("setSound", "(Landroid/net/Uri;Landroid/media/AudioAttributes;)V", "", ApiSince=26)>]
member this.SetSound : Android.Net.Uri * Android.Media.AudioAttributes -> unit

パラメーター

sound
Uri

Uri

audioAttributes
AudioAttributes

AudioAttributes

属性

注釈

このチャネルに投稿された通知とそのオーディオ属性に対して再生するサウンドを設定します。 少なくともNotificationManager.IMPORTANCE_DEFAULTの重要性を持つ通知チャネルは、音を持っている必要があります。 注: アプリ固有のサウンドは Uri パラメーターで指定できますが、チャネルはアプリのインストール期間中は永続的であり、バックアップと復元が行われるため、URI は安定している必要があります。 このため、アプリのアップグレード時にリソース ID が変更される可能性があるため、ContentResolver.SCHEME_ANDROID_RESOURCE URI を使用することはお勧めしません。 チャネルが NotificationManager.createNotificationChannel(NotificationChannel) に送信される前にのみ変更可能です。

android.app.NotificationChannel.setSoundの Android リファレンス。

このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。

適用対象