Created
March 1, 2018 17:49
-
-
Save juucustodio/21ac1f75c5c0119bd34afd0a8cfbdeb7 to your computer and use it in GitHub Desktop.
This example show native messages to users in Xamarin.Forms applications - http://julianocustodio.com/native-message
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Android.App; | |
using Android.Widget; | |
using DemoNativeMessage.Droid; | |
[assembly: Xamarin.Forms.Dependency(typeof(MessageAndroid))] | |
namespace DemoNativeMessage.Droid | |
{ | |
public class MessageAndroid : IMessage | |
{ | |
public void LongAlert(string message) | |
{ | |
Toast.MakeText(Application.Context, message, ToastLength.Long).Show(); | |
} | |
public void ShortAlert(string message) | |
{ | |
Toast.MakeText(Application.Context, message, ToastLength.Short).Show(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment