Can I access another installed app's logo from my bare Expo React Native application?

Viewed 41

The application I am working on uses React Native Maps and it allows a user to select a preferred navigation app from those installed on the device. I can download images of the various logos from the internet to use with the various buttons on my picker modal, but I would prefer to use the logos the user presses to launch those applications (the images stored on the device -- that one might see in the App Store / Google Play representing those apps). Is it possible to access and use these from my RN application?

1 Answers

If I understand you right you want to access installed app icons from the bundle id?

Android

if that's the case you can get all the installed apps using this library react-native-installed-application and you get the icon from it like this example:

import RNInstalledApplication from 'react-native-installed-application';


   RNInstalledApplication.getApps()
    .then(apps => {
      setData(apps)
    })
    .catch(error => {
      console.log(error);
    });

and you will get the icon as base64 format

IOS [currently not working]:

There's no libraries to archive that currently you can try to modify react-native-installed-apps package to make it work.

import AppList from 'react-native-installed-apps';
 
AppList.getAll((apps) => {
  console.log(apps); // array of objects [{ app: 'AppName.app', appPath: '/path/of/the/app', info: plistInfoObject }]
});
Related