SharedSDK集成微信、QQ、微博

第一步:将下面的脚本添加到您的根模块build.gradle中:

buildscript {
    repositories {
        jcenter()
    }
    
    dependencies {
        // 注册MobSDK
        classpath "com.mob.sdk:MobSDK:2018.0319.1724"
    }
}

第二步:在使用相应模块的build.gradle中,添加MobSDK插件和扩展,如:

apply plugin: 'com.mob.sdk'

MobSDK {
    appKey "替换为mob官方申请的appkey"
    appSecret "替换为mob官方申请的appkey对应的appSecret"
    ShareSDK {
        devInfo {
            SinaWeibo {
                appKey "568898243"
                appSecret "38a4f8204cc784f81f9f0daaf31e02e3"
                callbackUri "http://www.sharesdk.cn"
                shareByAppClient true
            }
            Wechat {
                appId "wx4868b35061f87885"
                appSecret "64020361b8ec4c99936c0e3999a9f249"
                userName "gh_afb25ac019c9"
                path "pages/index/index.html?id=1"
                withShareTicket true
                miniprogramType 2
                bypassApproval false
            }
            QQ {
                appId "100371282"
                appKey "aed9b0303e3ed1e27bae87c33761161d"
                shareByAppClient true
                bypassApproval false
            }
        }
    }
}
 

猜你喜欢

转载自blog.csdn.net/kingmax54212008/article/details/82875951
今日推荐