Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. iOS
  4. iOS Background process

iOS Background process

Scheduled Pinned Locked Moved iOS
questioncsharpiosmobilecom
4 Posts 3 Posters 14 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Super Lloyd
    wrote on last edited by
    #1

    I finally got my app running behind the lock screen by registering to location manager events (and setting appropriate permission)! Yeah! Now I have an other problem! In my location changed handler I write to a file (basically I save the time + location) However when I do that, after about 30 seconds under the lock screen, I got this exception: Access to the path "/var/mobile/Containers/Data/Application/10213914-67DC-4A0F-B20A-38A3AF03F186/Documents/.config/JsonSettings_AllMeasurements.json" is denied.

    at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00351] in /Users/builder/data/lanes/3412/3cf8aaed/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.IO/FileStream.cs:290
    at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean isAsync, Boolean anonymous) [0x00000] in /Users/builder/data/lanes/3412/3cf8aaed/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.IO/FileStream.cs:157
    at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access) [0x00000] in /Users/builder/data/lanes/3412/3cf8aaed/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.IO/FileStream.cs:92

    Any clues what is going on? And how to get passed that problem? Thanks!

    A new .NET Serializer All in one Menu-Ribbon Bar Taking over the world since 1371!

    B U 2 Replies Last reply
    0
    • S Super Lloyd

      I finally got my app running behind the lock screen by registering to location manager events (and setting appropriate permission)! Yeah! Now I have an other problem! In my location changed handler I write to a file (basically I save the time + location) However when I do that, after about 30 seconds under the lock screen, I got this exception: Access to the path "/var/mobile/Containers/Data/Application/10213914-67DC-4A0F-B20A-38A3AF03F186/Documents/.config/JsonSettings_AllMeasurements.json" is denied.

      at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00351] in /Users/builder/data/lanes/3412/3cf8aaed/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.IO/FileStream.cs:290
      at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean isAsync, Boolean anonymous) [0x00000] in /Users/builder/data/lanes/3412/3cf8aaed/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.IO/FileStream.cs:157
      at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access) [0x00000] in /Users/builder/data/lanes/3412/3cf8aaed/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.IO/FileStream.cs:92

      Any clues what is going on? And how to get passed that problem? Thanks!

      A new .NET Serializer All in one Menu-Ribbon Bar Taking over the world since 1371!

      B Offline
      B Offline
      Bloom Aman
      wrote on last edited by
      #2

      I also had a problem

      SHOW

      S 1 Reply Last reply
      0
      • B Bloom Aman

        I also had a problem

        SHOW

        S Offline
        S Offline
        Super Lloyd
        wrote on last edited by
        #3

        Hi Bloom! It turns out you can't open a file under the lock screen, this is a *security* feature. However you can open it before that and keep the handle to the already opened stream, it works. In my case, what I am really doing is using a permanently open single SQLite connection and it's all working now. I also wrote a method AsyncAcquire() that makes sure only one method at a time is using the connection.

        A new .NET Serializer All in one Menu-Ribbon Bar Taking over the world since 1371!

        1 Reply Last reply
        0
        • S Super Lloyd

          I finally got my app running behind the lock screen by registering to location manager events (and setting appropriate permission)! Yeah! Now I have an other problem! In my location changed handler I write to a file (basically I save the time + location) However when I do that, after about 30 seconds under the lock screen, I got this exception: Access to the path "/var/mobile/Containers/Data/Application/10213914-67DC-4A0F-B20A-38A3AF03F186/Documents/.config/JsonSettings_AllMeasurements.json" is denied.

          at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00351] in /Users/builder/data/lanes/3412/3cf8aaed/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.IO/FileStream.cs:290
          at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean isAsync, Boolean anonymous) [0x00000] in /Users/builder/data/lanes/3412/3cf8aaed/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.IO/FileStream.cs:157
          at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access) [0x00000] in /Users/builder/data/lanes/3412/3cf8aaed/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.IO/FileStream.cs:92

          Any clues what is going on? And how to get passed that problem? Thanks!

          A new .NET Serializer All in one Menu-Ribbon Bar Taking over the world since 1371!

          U Offline
          U Offline
          User 12684768
          wrote on last edited by
          #4

          Sariya Blog : Unique Indian Women's Ethnic Wear Like Sarees, Salwar Kameez, Lehenga & More...Sariya[^]

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups