MAUI Android Background Services: The .NET Show with Carl Franklin Ep. 46

Поділитися
Вставка
  • Опубліковано 19 вер 2024
  • Carl shows how to write a service on Android that runs in the background even when your app isn’t running, and shows app notifications.
    Download here: github.com/car...
    ⚡️⚡️⚡️ Register your FREE COPY of DevExpress MAUI Controls TODAY ⚡️⚡️⚡️
    www.devexpress...
    #Xamarin #MAUI #Microsoft #dotnet

КОМЕНТАРІ • 49

  • @jitendrajadav9110
    @jitendrajadav9110 Рік тому +6

    Thank you @Carl Franklin, please add background services for iOS this will really help!

    • @DeveloperExpress
      @DeveloperExpress  Рік тому +6

      He's working on it.

    • @jitendrajadav9110
      @jitendrajadav9110 Рік тому

      @@DeveloperExpress Thank you so much really appreciate!

    • @benhorton6758
      @benhorton6758 10 місяців тому +4

      Hi @@DeveloperExpress, any update on an iOS version? It'd be really helpful

    • @Spud9
      @Spud9 9 місяців тому

      ​@@DeveloperExpressIs there any progress on this? There's no really helpful guidance I can find anywhere else.

  • @jonny.rubber
    @jonny.rubber 4 місяці тому

    Amazing tutorial. Just implemented SignalR to show an Alert in my MAUI app, but was thinking of exactly this functionality. After a quick browse I came here. Everything is there. Not as simple as I imagined it. Hopefully I'll find the same for Windows and iOS. Thanks a lot.

    • @carlfranklin7894
      @carlfranklin7894 4 місяці тому +1

      Not at all as simple for iOS. I'm still trying to figure that out.

  • @cissemy
    @cissemy Рік тому +9

    Can you make one about IOS ?
    Thanks

  • @kelputoo.
    @kelputoo. 7 місяців тому +1

    It works, however an annoying notification will always appear sticky on your phone, is there any way to make a REAL background service and not a foreground service?
    I want to be able to display notifications on the app, without a foreground notification service. The title isn't very good explicit.

  • @ShinkuRaj-ji8nc
    @ShinkuRaj-ji8nc 16 днів тому

    Hi Thanks for sharing the video. I have a small Doubt Can we have implement Dependency Injection to this Backgroud Service

  • @billymartin6497
    @billymartin6497 Рік тому

    Great video. Would really love to see one on Home Screen Widgets, something a lot of us would love to do.

  • @michaelhamilton6905
    @michaelhamilton6905 8 місяців тому

    It would be nice to have some more details in regards to the warnings about not using it in production due to security concerns. It is not clear to me what are the details about the security concern or what needs to be done to mitigate that concern.

  • @RongMilon
    @RongMilon 7 місяців тому +1

    Not working with api 33/34 working fine with api 31 any solution for new api?

    • @RickardApps
      @RickardApps 5 місяців тому +1

      Have you found a solution?

  • @draganradovac8803
    @draganradovac8803 5 місяців тому

    That was an amazing tutorial. Thank you

  • @Dimitris.Christoforidis
    @Dimitris.Christoforidis Місяць тому

    Thank you Carl!! Exellent work!! Background jobs are very important in mobile apps. I wonder if there is any ready-made library for this purpose. I looked for shiny-jobs. I don't think that it works very well. Do you have found any other libraries for net maui?

    • @carlfranklin7894
      @carlfranklin7894 Місяць тому +1

      No, I couldn't find any. That's why I wrote it myself. :)

    • @Dimitris.Christoforidis
      @Dimitris.Christoforidis Місяць тому

      ​@@carlfranklin7894 Thank you Carl! Can you create a ready library for this? Like a nuget? Or to add it via devexpress maui libraries in future.

  • @marcoerlwein2165
    @marcoerlwein2165 Рік тому +5

    great Carl, thanks a lot, please for IOs

    • @carlfranklin7894
      @carlfranklin7894 Рік тому +4

      Working on it. iOS has an official process for notifications, so I'm first going to focus on background services, which have to continuously restart themselves to avoid being shut down by the OS.

    • @marcoerlwein2165
      @marcoerlwein2165 Рік тому

      @@carlfranklin7894 Thank you very much for the answer, you are a great person

    • @jeanhibbert
      @jeanhibbert Рік тому

      Thanks Carl!

    • @hamzaougui6751
      @hamzaougui6751 Рік тому

      ​@@carlfranklin7894hello carl .. please is there any news about iOS 😐

  • @Spud9
    @Spud9 9 місяців тому +1

    @DeveloperExpress, I'm running into an issue where after the app's closed and I get a notification, if I click the notification the app tries to launch but then gets stuck and crashes. Any insights?

    • @danielbrown7534
      @danielbrown7534 7 місяців тому

      did you find a solution I am having the same issue.

  • @AD2S2023
    @AD2S2023 Рік тому

    Hi how to disable the background service is running notification in this solution can you please help me

  • @ferhatbulga
    @ferhatbulga Рік тому

    Can we add a right click event to this background application? For android

  • @valentinoromelio5414
    @valentinoromelio5414 6 місяців тому

    Can the same done for Windows?

  • @craigpeter9355
    @craigpeter9355 5 місяців тому

    This is an excellent video, thank you!
    Does it work on Android Emulator (Pixel 5 API34 Android 14)? I got it to work on my phone but not the emulator.

    • @ChidubemMichael-sb6uz
      @ChidubemMichael-sb6uz 2 місяці тому

      Same with me. it doesnt work on my emulator, same emulator as yours. what do you think could be the issue with it

  • @marcoerlwein2165
    @marcoerlwein2165 Рік тому

    Carl, one question, hubConnections work with SignalR on iOS?

    • @carlfranklin7894
      @carlfranklin7894 Рік тому +4

      I don't see why not, although iOS is a completely different beast when it comes to notifications. If your goal is to show notifications, there's a completely different process you need to go through. If you just want some kind of background service, as I showed in Android, it's possible, but you have to jump through hoops to make sure iOS doesn't shut you down. I'm struggling with the process, but I'll do a show on it when I get some answers.

    • @marcoerlwein2165
      @marcoerlwein2165 Рік тому

      @@carlfranklin7894 Hi Carl, when is the video for IOs? sorry for the pressure, but there is not much information for IOS.

  • @cimishpk
    @cimishpk Рік тому

    Excellent presentation Carl, but please make the repository public.

    • @DeveloperExpress
      @DeveloperExpress  Рік тому

      Here's the link... github.com/carlfranklin/mauiandroidfs

    • @cimishpk
      @cimishpk Рік тому

      @@DeveloperExpress Thank you Carl, but something wrong again with GitHub, error code 404 page not found.

    • @carlfranklin7894
      @carlfranklin7894 Рік тому +3

      @@cimishpk Fixed.

    • @cimishpk
      @cimishpk Рік тому

      @@carlfranklin7894 Thank you

    • @jeanhibbert
      @jeanhibbert Рік тому

      thank you Carl! you rock dude!

  • @harrydang5248
    @harrydang5248 Рік тому +1

    Great video Carl, Can you share that code?

    • @carlfranklin7894
      @carlfranklin7894 Рік тому

      Links are in the show notes at thedotnetshow.com but here's the repo link: github.com/carlfranklin/mauiandroidfs

    • @marcoerlwein2165
      @marcoerlwein2165 Рік тому

      @@carlfranklin7894 The repository is set to private, please make it public.

    • @carlfranklin7894
      @carlfranklin7894 Рік тому

      @@marcoerlwein2165 Doh! Sorry. Public now

  • @hamzaougui6751
    @hamzaougui6751 Рік тому

    Amazing tutorial thank you so much .. can please the same tutorial for Maui Blazor IOS ? .. waiting for it please

  • @lukasjacobs2358
    @lukasjacobs2358 Рік тому

    Would have been nice if there actually was something about a background service. I'm aware of the distinction and was actually looking for background service information, not foreground...

    • @iamzoli
      @iamzoli Рік тому

      you can extend the foreground service by implementing Android.Content.BroadcastReceiver that receives SCREEN_OFF event and when it does acquire Android.OS.PowerManager.WakeLock with WakeLockFlags.Partial. then it will run all the time.

    • @kelputoo.
      @kelputoo. 7 місяців тому

      Same, did you found any way to do it?

  • @bruno-id1wh
    @bruno-id1wh 11 місяців тому +1

    This video is exactly what I need for my project, but unfortunately I can't get the boot receiver working - it throws a Permission Denial exception at startup. I thought I must have missed something but it does the same running the code from github. Any ideas please?
    Security exception: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.companyname.mauiandroidfs/crc642c2de4fd9814d752.MainActivity } from null (pid=20066, uid=2000) requires android.permission.RECEIVE_BOOT_COMPLETED
    java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.companyname.mauiandroidfs/crc642c2de4fd9814d752.MainActivity } from null (pid=20066, uid=2000) requires android.permission.RECEIVE_BOOT_COMPLETED

    • @franciscoruiz6332
      @franciscoruiz6332 3 місяці тому

      same here and there is not much information about brocastreceiver to implement in maui