Skip to content
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

Provide a way to openApp with custom intent (instead of package name) #94

Open
yaoliupeloton opened this issue May 23, 2019 · 1 comment

Comments

@yaoliupeloton
Copy link

yaoliupeloton commented May 23, 2019

Hello! This library is very helpful, but I wish there could be another way to open an app. Currently the openApp implementation takes a package name and some extras. It would be great if there's an overloaded method to openApp by an intent directly. So JS send an intent string, and the method just build an intent with that string and opens it.

It'll look like this:

    @ReactMethod
    public void openApp(String customizedIntent) {
        Intent sendIntent = new Intent(customizedIntent);
        if (!parseExtras(extras, sendIntent)) {
            promise.resolve(false);
            return;
        }
        
        sendIntent.addCategory(Intent.CATEGORY_LAUNCHER);
            this.reactContext.startActivity(sendIntent);
            promise.resolve(true);
    }

Thank you!

@1uokun

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants