Skip to content
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.

Added packageExists #136

Merged
merged 1 commit into from
Nov 3, 2021

Conversation

jdgjsag67251
Copy link
Contributor

Use case

We would like to know if we are able to start a specific intent before actually calling it. The solution I came up with was checking if the package that exposes the intent is available on the system.

Example

const packageName = 'com.android.contacts';

window.plugins.intentShim.packageExists(packageName, (exists) => {
    if (exists) {
        console.log(`${packageName} exists!`);
    } else {
        console.log(`${packageName} does not exist...`);
    }
});

@darryncampbell
Copy link
Owner

Reviewed and all looks good, thank you for your contribution.

@darryncampbell darryncampbell merged commit 2a180b3 into darryncampbell:master Nov 3, 2021
darryncampbell added a commit that referenced this pull request Nov 3, 2021
@darryncampbell
Copy link
Owner

Posted to npm as 2.2.0

@jdgjsag67251 jdgjsag67251 deleted the package-exists branch November 3, 2021 16:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants