第一次用mob繼承android的第三方登錄,就踩到了個大坑,我是應該高興還是高興。
首先說說集成步驟:
1、準備工作:拷貝各種jar包到libs文件夾下面,拷貝ShareSDK.xml文件到asserts文件夾下面。
2、獲取微信的第三方登錄的AppId和AppSecret,分別替換掉ShareSDK.xml文件的默認數據。
<Wechat
Id="4"
SortId="4"
AppId="wx****************"
AppSecret="53e*****************************"
BypassApproval="false"
Enable="true" />
<WechatMoments
Id="5"
SortId="5"
AppId="wx****************"
AppSecret="53e*****************************"
BypassApproval="false"
Enable="true" />
<WechatFavorite
Id="6"
SortId="6"
AppId="wx****************"
AppSecret="53e*****************************"
Enable="false" />
3、新建包:wxapi,在這個包下面新建類:WXEntryActivity, 這個類是微信客戶端回調activity。不要忘記在 AndroidManifest.xml文件下注冊:
<activity
android:name="com.a.b.wxapi.WXEntryActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:exported="true"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />