Skip to content

Conversation

@nelyousfi
Copy link

Why:

Adding a synchronous method to check installed apps on the device. This allows immediate access to the installed apps' status without managing asynchronous states. This is particularly useful in scenarios where showing a loading state would disrupt the UX, such as when populating a share sheets modal with only the installed apps.

How:

  • Introduced a new synchronous function checkInstalledAppsSync that mirrors the functionality of the existing async checkInstalledApps.
  • Both functions accept an array of package names (for Android) or URL schemes (for iOS) and return a Record mapping each identifier to a boolean indicating installation status
  • The sync implementation can be used directly in component render logic, as demonstrated in the example app where it's used for initial state:
const [result, setResult] = useState(checkInstalledAppsSync(packageNames));

@nelyousfi
Copy link
Author

@EndLess728 When you have some time, could you please take a look at this? Feel free to decline if you believe this is not the direction your library should take for any reason.

@EndLess728
Copy link
Owner

Thanks for the PR @nelyousfi . I will surely check it in free time.

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

Successfully merging this pull request may close these issues.

2 participants