Skip to content

请问如何判断是否安装安卓QQ,现在是调用API就直接崩溃 #78

Description

@cq0702

请问如何判断是否安装安卓QQ,现在是调用API就直接崩溃,就算加了try catch也不行,直接崩溃

Activity

  1. cq0702 commented on Feb 3, 2018

    @cq0702
    Author

    解决了,修改源码,增加方法
    export function isQQInstalledAction() {
    return QQAPI.isQQInstalled().then((res)=>{
    () => waitForResponse("QQAuthorizeResponse")
    })
    }
    然后在js里使用
    QQAPI.isQQInstalledAction().then((res)=>{
    QQAPI.shareToQQ(qqshareInfo).then((res)=>{
    // console.log('--shareToQQ--res:',res)
    }).catch((err)=>{
    // console.log('--shareToQQ--err:',err)
    })
    }).catch((err)=>{
    Alert.alert(
    '提示',
    '您还没有安装QQ客户端,请安装QQ后再试'
    )
    })

  2. yam963 commented on Jun 26, 2018

    @yam963

    QQAPI.isQQInstalled()
    .then(install=>{
    console.log('安装QQ'+install)
    })
    .catch(unInstall=>{
    console.log('没有安装QQ'+unInstall)
    })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions