-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Associating a File type with application #80
Comments
Generally file associations are registered in Info.plist file. There's quite a bit of documentation about this online. However handling the file open notification will require some rust code right now. I haven't tested this particular thing so it's possible that some things won't work. In general you will get a method called ( Create a struct and let it implement the context.get().unwrap().application_delegate_manager.borrow().set_delegate(my_app_delegate); At this point your should get notification when your application was asked to open URLs. After that you might need to use platform channels to let the dart code know that it should open the file. |
I'll try to find some time to make a working example of this. |
Thanks for the tips! But how do we edit the Info.plist file? |
You can copy the Info.plist template from NativeShell, put it somewhere in your project and then reference it in let options = AppBundleOptions {
...
info_plist_template: Some("resources/Info.plist".into()), // assuming you placed it in resources/Info.plist
...
} |
@knopp Can this be made multi-platform like for windows and linux too. |
When you right-click a
.pdf
file and hover over the "Open with" menu on macOS or Windows, a list of applications that can open the file show up. How can we set file associations in a Nativeshell application?The text was updated successfully, but these errors were encountered: