Wake up app on specific times automatically in Xamarin Forms (like AlarmManager in Android)

yousufctecyousufctec USMember ✭✭✭

Hi guys,
I would like to run the app on specific times of the day (with reference to the timetable I will have) even though my app is closed or running background or terminated, as long as it is installed.

Something like an AlarmManager in Android needs to implemented cross platform.

BTW, I don't want to run an background service all the time consuming power giving a bad experience to the user.

Regards,
Yousuf.

Answers

  • LucasZhangLucasZhang Member, Xamarin Team Xamurai

    We don't recommended user to automatically open their app . Especially in iOS , we could not implement it because it violate the policy of privacy . I suggest you can use notification and let users open the app by tapping the notification .

  • yousufctecyousufctec USMember ✭✭✭

    @LucasZhang,
    We will not be able to conclude as generically "violation of privacy policies" as the use case differs. This is an employer mobile device or own personal device with permission taken prior in which the employee need to carry it during their employed hours, where we needs to show them the schedules for the day and direct them to their target. So, we would like to track their location only during his employed hours and would like to go offline later.

    We can use the push notifications to send the schedules, but we also need the location updates from the device (when the office hours started) and update the employer. The use case is critical that the employee needs to be on time and if not employer needs to schedule another employee to the target.

    Hope you understood the scenario.

    Regards,
    Yousuf.

  • LucasZhangLucasZhang Member, Xamarin Team Xamurai

    Check background task in xamarin.forms https://robgibbens.com/backgrounding-with-xamarin-forms/

  • yousufctecyousufctec USMember ✭✭✭

    @LucasZhang,
    Is there any other way other than Backgrounding to implement this? And if I use it, do I need to use the background tasks to be running infinitely? As every day and every week, according to the employed hours I need to perform tasks.

    Regards,
    Yousuf.

  • LucasZhangLucasZhang Member, Xamarin Team Xamurai

    Yes, you need to use the background tasks to be running infinitely .And I think this is the best way.

Sign In or Register to comment.