Comments (5)
You can copy the Info.plist template from NativeShell, put it somewhere in your project and then reference it in build.rs
:
let options = AppBundleOptions {
...
info_plist_template: Some("resources/Info.plist".into()), // assuming you placed it in resources/Info.plist
...
}
from nativeshell.
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 (application:openFiles:
) or (application:openURLs:
) on your NSApplicationDelegate
. NativeShell exposes NSApplicationDelegate
to rust, so you don't need to write any objc bindings.
Create a struct and let it implement the ApplicationDelegate
trait. In the trait, override application_open_urls
method. Then register your delegate
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.
from nativeshell.
I'll try to find some time to make a working example of this.
from nativeshell.
Thanks for the tips! But how do we edit the Info.plist file?
from nativeshell.
@knopp Can this be made multi-platform like for windows and linux too.
from nativeshell.
Related Issues (20)
- Crashes on multiple monitors in Windows HOT 4
- Is there any way to lower the minimum supported version of macOS HOT 1
- way to run existing flutter code HOT 4
- How to specify libflutter location
- Frameless windows are not resizable on macOS
- Fails to build on apple silicon with Flutter 3.0.0 HOT 2
- The Flutter Attach to Process gets stuck on Waiting... HOT 3
- Invalid read causes segmentation fault HOT 3
- std::rc::Weak<ContextImpl>` cannot be sent between threads safely
- std::rc::Weak<ContextImpl>` cannot be sent between threads safely
- MenuItem clash with flutter widget of the same name HOT 1
- Getting an error when trying to run the examples HOT 2
- Build Error on MacOS 13.2.1 - cargo run or cargo run --release unable to build and run the flutter app for example provided
- Issues with native plugin `media_kit` HOT 2
- Latest SharedPreferences not working HOT 1
- Jitter when resizing on Windows when frame is `WindowFrame.noTitle` HOT 1
- Unable to build sample project HOT 2
- [super_context_menu] Change/Remove Progress Indicator for DeferredMenuElement
- Calling dart from rust side?
- Support current stable version of Flutter
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nativeshell.