Skip to content

Instantly share code, notes, and snippets.

@codercampos
Created September 17, 2018 01:32
Show Gist options
  • Save codercampos/b4ff415b4e5dc1aaa89441e59ee696c4 to your computer and use it in GitHub Desktop.
Save codercampos/b4ff415b4e5dc1aaa89441e59ee696c4 to your computer and use it in GitHub Desktop.
Xam.Plugin.Notifier implementation on Xamarin Forms - Xamarin Latino
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:LocalNotifications" x:Class="LocalNotifications.MainPage">
<StackLayout>
<!-- Place new controls here -->
<Button x:Name="btnNotification" Text="Send Notification in 5 seconds" HorizontalOptions="Center" VerticalOptions="CenterAndExpand" />
</StackLayout>
</ContentPage>
using System;
using Xamarin.Forms;
using Plugin.LocalNotifications;
namespace LocalNotifications
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
btnNotification.Clicked += BtnNotification_Clicked;
}
void BtnNotification_Clicked(object sender, EventArgs e)
{
CrossLocalNotifications.Current.Show("Xamarin Latino", "Hello, this is a local notification from Xamarin Forms", 0, DateTime.Now.AddSeconds(7));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment