GameFrameX.ShareSDK is the ShareSDK component for the GameFrameX framework.
Initialize SDKAuthorizeGet User InfoShare ContentShow Share MenuShow Share ViewGet TokenRemove Authorize
- SinaWeibo
- TencentWeibo
- DouBan
- QZone
- Renren
- Kaixin
- Pengyou
- Evernote
- Foursquare
- GooglePlus
- Tumblr
- SMS
- Copy
- WeChatMoments
- Instapaper
- YouDaoNote
- Flickr
- Dropbox
- VKontakte
- WeChatFavorites
- YiXinSession
- YiXinTimeline
- YiXinFav
- MingDao
- Line
- KakaoTalk
- KakaoStory
- FacebookMessenger
- Telegram
- Bluetooth
- AliSocial
- AliSocialMoments
- Dingding
- Youtube
- MeiPai
- CMCC
- ESurfing
- FacebookAccount
- Douyin
- WeWork
- Oasis
- KuaiShou
- TikTok
- Littleredbook
- Apple
- SnapChat
- WatermelonVideo
-
Mount the Component Mount the
ShareSDKcomponent on theGameEntrygame entry object. -
Set Parameters Set the
AppKeyandAppSecreton theShareSDKcomponent. -
Call Methods
// Get the ShareSDK component var shareSdkComponent = GameEntry.GetComponent<ShareSDK>(); // Initialize shareSdkComponent.InitSDK("Your AppKey", "Your AppSecret"); // Authorize shareSdkComponent.Authorize(PlatformType.WeChat); // Get User Info shareSdkComponent.GetUserInfo(PlatformType.WeChat); // Share Content ShareContent content = new ShareContent(); content.SetText("this is a test string."); content.SetImageUrl("http://ww3.sinaimg.cn/mw690/be159dedgw1evgxdt9h3fj218g0xctod.jpg"); content.SetTitle("test title"); content.SetTitleUrl("http://www.mob.com"); content.SetSite("Mob-ShareSDK"); content.SetSiteUrl("http://www.mob.com"); content.SetUrl("http://www.mob.com"); content.SetComment("test description"); content.SetMusicUrl("http://mp3.mwap8.com/destdir/Music/2009/20090601/ZuiXuanMinZuFeng20090601119.mp3"); content.SetShareType(ContentType.Image); shareSdkComponent.ShareContent(PlatformType.WeChat, content);
Add the following configuration to the application node of the AndroidManifest.xml file:
<activity
android:name="com.mob.tools.MobUIShell"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:configChanges="keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="stateHidden|adjustResize" >
<intent-filter>
<data android:scheme="tencent100371282" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>Add the following library references to the build.gradle file:
implementation 'com.google.android.gms:play-services-games-v2:+'
implementation 'com.google.android.gms:play-services-auth:19.0.0'