Код: Выделить всё
using Android;
using Android.App;
using Android.Content;
using Android.Util;
using BeMoSoft.Packer.Code;
using System.Diagnostics.CodeAnalysis;
using Context = Android.Content.Context;
[assembly: UsesPermission(Manifest.Permission.ReceiveBootCompleted)]
namespace BeMoSoft.Packer.Platforms.Android.Background
{
[BroadcastReceiver(Enabled = true, Exported = true)]
[IntentFilter(new[] { Intent.ActionBootCompleted })]
public class RebootReceiver : BroadcastReceiver
{
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(RebootReceiver))]
public override void OnReceive(Context? context, Intent? intent)
{
Log.Debug("RebootReceiver", "OnReceive called after boot!");
/* Do something here */
}
}
}
< /code>
my androidmanifest.xml: < /pbr />
...
...
adb shell cmd package query-receivers com.bemosoft.packer_maui
не показывает результата.
Подробнее здесь: https://stackoverflow.com/questions/797 ... d-receiver
Мобильная версия