【发布时间】:2018-07-20 10:27:09
【问题描述】:
我有一个带有local notification 的应用程序。问题是它显示了来自 Visual Studio 的“项目名称”(见截图)。我希望应用程序显示我可以指定的内容(应用程序名称)。
[
您在上面看到的构建通知的代码是:
PendingIntent resultPendingIntent = stackBuilder.GetPendingIntent(0, (int)PendingIntentFlags.UpdateCurrent);
// Build the notification:
NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
.SetAutoCancel(true)
.SetContentIntent(resultPendingIntent)
.SetContentTitle("Button Clicked")
.SetNumber(count)
.SetSmallIcon(Resource.Drawable.ic_stat_button_click)
.SetContentText(String.Format("The button has been clicked {0} times.", count));
// Finally, publish the notification:
NotificationManager notificationManager = (NotificationManager)GetSystemServiceContext.NotificationService);
notificationManager.Notify(ButtonClickNotificationId, builder.Build());
我正在使用 Android 7.0 进行测试,本地通知文档似乎没有显示任何关于显示通知的“新”方式的任何内容。不过我可以更改小图标。
我在 Xamarin 论坛或 Google 上找不到有关该问题的任何信息。我真的怀疑人们想在那里看到 Visual Studio 的项目名称。
我什至下载了local notification sample project,它显示了项目名称。
这是一个限制还是我错过了什么?在我看来,这件事太重要了,不能成为限制。
【问题讨论】:
标签: c# xamarin xamarin.forms notifications xamarin.android