tauri-apps / tao

The TAO of cross-platform windowing. A library in Rust built for Tauri.
Apache License 2.0
1.63k stars 191 forks source link

feat(iOS): added custom URL schemes handling in the `AppDelegate` class #969

Closed CampioneDev closed 2 months ago

CampioneDev commented 2 months ago

Until now, only "associated domains" were handled, using the application_continue function, implementing this Swift method from the UIApplicationDelegate class.

For custom URL schemes, I added a new application_open_url function that implements the signature of this other Swift method.

The code of the pre-existing application_continue function has been moved into a separate handle_deep_link function so the new application_open_url function can call it as well.
For now, I believe it's appropriate to use the same Event::Opened event in both situations. Since the scheme is part of the URL, a listener can differentiate between them if needed.

Tauri: this change works automatically with the "Deep Linking" plugin without further modifications.
Custom URL schemes in mobile apps are essential, for example, when dealing with OAuth redirect URLs.

CampioneDev commented 2 months ago

Thanks!

(BTW This is my first PR and contribution to OSS ever... I hope everything's ok, and sorry for the force-pushed mess)

github-actions[bot] commented 2 months ago

Package Changes Through 373e133c62c67656529806e382a366b28abc2ae8

There are 1 changes which include tao with patch

Planned Package Versions The following package releases are the planned based on the context of changes in this pull request. | package | current | next | |----|----|----| | tao | 0.30.0 | 0.30.1 |

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

FabianLars commented 2 months ago

I also requested @lucasfernog's review because of his involvement in deep links and as the author of https://github.com/tauri-apps/tao/pull/752

lucasfernog commented 2 months ago

Thanks!

(BTW This is my first PR and contribution to OSS ever... I hope everything's ok, and sorry for the force-pushed mess)

your first OSS contribution is a objc-in-rust PR? omg that's impressive

lucasfernog commented 2 months ago

my first contribution was a dumb issue like "hey you need to fix this typo" people almost deleted my GitHub account 😂 😂

lucasfernog commented 2 months ago

I'll force merge this one but would be great if you could setup commit signing in the future (even for your own personal usage!)