iOS Background process
-
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:92Any 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!
-
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:92Any 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!
I also had a problem
SHOW
-
I also had a problem
SHOW
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!
-
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:92Any 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!