protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            CrossMediaManager.Current.Init(this);
            //CrossMediaManager.Android.Notification.Enabled = false;
            var musicControls = new MusicControls();

            musicControls.Initialize(Application.Context);

            Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, savedInstanceState);

            if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.O)
            {
                // default notification channel id
                FirebasePushNotificationManager.DefaultNotificationChannelId = "FirebasePushNotificationChannel";
                // default notification channel name
                FirebasePushNotificationManager.DefaultNotificationChannelName = "General";
            }

#if DEBUG
            FirebasePushNotificationManager.Initialize(this, true);
#else
            FirebasePushNotificationManager.Initialize(this, false);
#endif

            // handle notification when app is closed
            CrossFirebasePushNotification.Current.OnNotificationReceived += (s, p) =>
            {
                // handle
            };

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            LoadApplication(new App());
        }
Example #2
0
 public MusicControlsBroadcastReceiver(MusicControls musicControls)
 {
     mc = musicControls;
 }