-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[SOLVED] error when invoking start and stop a resource access #6
Comments
Are you passing in the file object or the bookmark id as string? |
as the method signature requires a File object, then i am passing a File object to the await _secureBookmarksInstance.startAccessingSecurityScopedResource(file); method, which in turn, by looking at its implementation code, derives the path from the even if i wanted to pass the bookmark, i couldn't because of the method signature. /// Allows you to access the given file. (which was previously stored
/// as security aware bookmark).
/// You should call [stopAccessingSecurityScopedResource] afterwards.
Future<bool> startAccessingSecurityScopedResource(File file) async {
return await _channel.invokeMethod(
'startAccessingSecurityScopedResource', {'file': file.absolute.path});
}
maybe the problem is on the native side? because the method of obtaining a bookmark, which is identical in signature, successfully returns the bookmark String when i pass it THE SAME look at the bookmark method having an identical signature: /// Create a security aware bookmark for the given [file].
Future<String> bookmark(File file) async {
return await _channel
.invokeMethod('bookmarkData', {'file': file.absolute.path});
} |
Okay the error message is pretty bogus.. it has been a long time since i last looked at it 🤷♂️ |
Turns out, you must resolve the bookmark first to obtain the file object, then you must pass that same resolved file object to the: /// Allows you to access the given file. (which was previously stored
/// as security aware bookmark).
/// You should call [stopAccessingSecurityScopedResource] afterwards.
Future<bool> startAccessingSecurityScopedResource(File file) async {
return await _channel.invokeMethod(
'startAccessingSecurityScopedResource', {'file': file.absolute.path});
} I also think we should update the method signature to accept a Future<bool> startAccessingSecurityScopedResource(FileSystemEntity file) async {
return await _channel.invokeMethod(
'startAccessingSecurityScopedResource', {'file': file.absolute.path});
} This enables passing both |
* resolve #777 See: authpass/macos_secure_bookmarks#6 * fix bug * fix bug * fix bug * mild fix
Thanks for this great plugin. I however get an error whenever i invoke (start or stop) resource access methods prior to using the resource.
i successfully get a bookmark, and i am certain that the file i pass to the
method is not null.
i also made sure to add the following entitlements to both debug and release
.entitlements
the error is:
The text was updated successfully, but these errors were encountered: