How can i check app installed in react native code

﹥>﹥吖頭↗ 提交于 2019-12-10 11:12:57

问题


i tried to check other app install in my react native project, I'm used module like: https://www.npmjs.com/package/react-native-check-app-install But always got this error: Cannot read property 'pkgName' of undefined Here is my code:

    AppInstalledChecker
    .isAppInstalledAndroid('com.skype.raider') 
    .then((isInstalled) => {
        // isInstalled is true if the app is installed or false if not 
         console.log('App Skype status: ', isInstalled);
    });

Anyone can suggest me one way so check app install in react native (both: iOS/android)


回答1:


install this

https://github.com/KjellConnelly/react-native-shared-group-preferences

and

async check() {
    try {
        await SharedGroupPreferences.isAppInstalledAndroid("com.farsitel.bazaar")
        // IF IS INSTALL
    } catch (e) {
        // IF IS NOT INSTALL
    }
}


来源:https://stackoverflow.com/questions/44005242/how-can-i-check-app-installed-in-react-native-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!