public override async void OnReceive(Context context, Intent intent)
        {
            var pendingResult = base.GoAsync();

            try
            {
                QueryString qs             = QueryString.Parse(intent.DataString.Substring(intent.DataString.IndexOf('?') + 1));
                Guid        localAccountId = Guid.Parse(qs["localAccountId"]);
                await AndroidRemindersExtension.UpdateAndScheduleDayBeforeNotification(context, localAccountId, fromForeground : false);
            }
            catch (Exception ex)
            {
                TelemetryExtension.Current?.TrackException(ex);
            }

            pendingResult.Finish();
        }
Пример #2
0
        public override async void OnReceive(Context context, Intent intent)
        {
            var pendingResult = base.GoAsync();

            try
            {
                var allAccounts = await AccountsManager.GetAllAccounts();

                foreach (var account in allAccounts)
                {
                    // Update/schedule both day-of and day-before
                    await AndroidRemindersExtension.UpdateAndScheduleNotifications(context, account, fromForeground : false);
                }
            }

            catch (Exception ex)
            {
                // Avoid throwing here, since otherwise we'll get a "Power Planner has stopped responding" dialog when the user isn't even using the app
                TelemetryExtension.Current?.TrackException(ex);
            }

            pendingResult.Finish();
        }