4,166 questions
using ReadSMSMessages.Platforms.Android;
this is the line with the error?
I think you should use
#if ANDROID
using ReadSMSMessages.Platforms.Android;
#endif
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I am trying to start writing Android specific code in order to read SMS messages from the device but I am facing an error as in the Title of this question.
Repo is here https://github.com/asafgo/ReadSMSMessages
namespace ReadSMSMessages
{
public interface IMyReadSMS
{
Task<bool> RequestPermissions();
Task<string[]> getAllSms();
}
}
namespace ReadSMSMessages.Platforms.Android
{
public class MyReadSMS : IMyReadSMS
{
public Task<string[]> getAllSms()
{
throw new NotImplementedException();
}
public Task<bool> RequestPermissions()
{
throw new NotImplementedException();
}
}
}
using ReadSMSMessages.Platforms.Android;
using Microsoft.Extensions.Logging;
namespace ReadSMSMessages;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
#if DEBUG
builder.Logging.AddDebug();
#endif
return builder.Build();
}
}
Thanks for any help,
AG
using ReadSMSMessages.Platforms.Android;
this is the line with the error?
I think you should use
#if ANDROID
using ReadSMSMessages.Platforms.Android;
#endif