Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,326 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I want the user go to inbox and read the incoming message.
Hello,
Welcome to our Microsoft Q&A platform!
public interface IOpenManager
{
void openMail();
}
In Android.
[assembly: Dependency(typeof(OpenImplementation))]
namespace App23.Droid
{
public class OpenImplementation : IOpenManager
{
public void openMail()
{
Intent intent = new Intent(Intent.ActionMain);
intent.AddCategory(Intent.CategoryAppEmail);
intent.AddFlags(ActivityFlags.NewTask);
//FLAG_ACTIVITY_NEW_TASK
Android.App.Application.Context.StartActivity(intent);
}
}
}
In iOS.
[assembly: Dependency(typeof(OpenImplementation))]
namespace App23.iOS
{
public class OpenImplementation : IOpenManager
{
public void openMail()
{
NSUrl mailUrl = new NSUrl("message://");
if (UIApplication.SharedApplication.CanOpenUrl(mailUrl))
{
UIApplication.SharedApplication.OpenUrl(mailUrl);
}
}
}
}
call this dependcy via: DependencyService.Get<IOpenManager>().openMail();
Best Regards,
Leon Lu
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.