我正在通过 GCM 服务向 android 设备发送通知。向客户端传递消息不是问题,因为在电话上收到通知时没有播放声音,这是问题所在。
我在客户端(mono android)上使用以下代码来建立通知请求
void createNotification(string title, string desc)
{
//Create notification
var notificationManager = GetSystemService(Context.NotificationService) as NotificationManager;
//Create an intent to show ui
var uiIntent = new Intent(this, typeof(Main));
//Create the notification
var notification = new Notification(Android.Resource.Drawable.SymActionEmail, title);
//Auto cancel will remove the notification once the user touches it
notification.Flags = NotificationFlags.AutoCancel;
//Set the notification info
//we use the pending intent, passing our ui intent over which will get called
//when the notification is tapped.
notification.SetLatestEventInfo(this, title, desc, PendingIntent.GetActivity(this, 0, uiIntent, 0));
//Show the notification
notificationManager.Notify(1, notification);
}
在这里我可以在哪里放置要播放的通知声音的详细信息?我已经尝试过 Notification.Sound 成员,但它要求我没有参考的 uri。