Skip to content

Android: add Intent handling #1563

@ambiso

Description

@ambiso

Currently tauri and frameworks that rely on wry/tao such as dioxus don't seem to support passing data to an android application through e.g. the SEND intent on android. For example I would like to share an URL from my browser with my app, but there's no way to receive the Intent from the native Rust code.

Proposed solution

Receive intents in the WryActivity and call a function in the ndk_glue (in tao). A separate crate, that client code can depend on, should expose an API that allows receiving the intents from Rust.

Alternatives

The obvious drawback of implementing this in wry/tao is feature bloat: receiving intents should maybe not really be a concern of wry.

class extension

This feature possibly could e.g. also be implemented as part of the WRY_WRYACTIVITY_CLASS_EXTENSION envvar; however, since there's also a native component to this, the user would have to setup the build environment for another native library to compile for the target, so that the native code can be notified of intents.

In general it would be nice if there was an easy way to setup your app for receiving intents.

separate activity

the user could create a separate activity altogether, that stores the intent data somewhere, then launches the main activity, which then retrieves the intent data from the storage location.
this would be possibly less flexible, since the original intent jobject would likely be lost.

Additional context

Demo video shows sharing an URL with an android application, and the app receiving and displaying the URL.
demo.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions