Set two notifications with sounds but only 1 displays, and DisplayAlert() not able to use, please help #392
Unanswered
Cinmay2014
asked this question in
Q&A
Replies: 1 comment
-
@Cinmay2014 Can you please attach a sample project? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am learning Xamarin forms and trying to use Plugin.localnotification. I created two notification channels with different sounds: channel1 for the sound:goodnight and channel2 for the sound:goodmorning. But Notification1 displayed goodmoring sound and notification2 displayed a default sound. By the way, I am not able to use DisplayAlert(). Please help.
Thanks in advance.
My MainPageViewModel.cs shows below:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Windows.Input;
using Xamarin.Forms;
using Plugin.LocalNotification;
using Xamarin.Essentials;
using Plugin.LocalNotification.AndroidOption;
using Plugin.LocalNotification.Json;
using System.Threading.Tasks;
using Plugin.LocalNotification.EventArgs;
using System.IO;
using Xamarin.Forms.Internals;
namespace localnotice
{
internal class MainPageViewModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
}
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
MainActivity.cs as below:
using System;
using Android.App;
using Android.Content.PM;
using Android.Runtime;
using Android.OS;
using Plugin.LocalNotification;
using Plugin.LocalNotification.AndroidOption;
using Android.Content;
using static Java.Util.Jar.Attributes;
namespace localnotice.Droid
{
[Activity(Label = "localnotice", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize )]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
}
Beta Was this translation helpful? Give feedback.
All reactions