本文介绍了如何对接Miracle Games SDK的社区接口
该接口由MiracleGames统一管理,若需要开启社区功能,需要提前联系MG工作人员协助开通
社区功能的前提是账户必须登陆成功,所以通常是在登陆成功的逻辑中,加入社交功能调用代码。
public MainPage()
{
this.InitializeComponent();
Loaded += (sender, args) =>
{
var auth = await MiracleGames.AuthenticationManager.AuthenticateAsync();//开启登录
if (auth.ReturnValue)//登录成功.
{
//var uid = MiracleGames.AuthenticationManager.UserInfo.Id;
//var token = MiracleGames.AuthenticationManager.UserInfo.Token;
//Show user center bubble.
MiracleGames.BubbleManager.ShowBubble();//开启社区功能
}
};
}
社区和积分墙的事件回调功能,可直接在程序中注册委托事件来实现。
MiracleGames.BubbleManager.BubbleIntegralWallRewardsChanged += BubbleManager_BubbleIntegralWallRewardsChanged;//积分墙程序安装奖励回调
private void BubbleManager_BubbleIntegralWallRewardsChanged(object sender, string e)
{
throw new NotImplementedException();
}
MiracleGames.BubbleManager.BubbleIntegralWallFirePwChangeEvents += BubbleManager_BubbleIntegralWallFirePwChangeEvents;//积分墙任务完成奖励回调
private void BubbleManager_BubbleIntegralWallFirePwChangeEvents(object sender, string e)
{
throw new NotImplementedException();
}
MiracleGames.BubbleManager.BubbleOpenCloseEvent += BubbleManager_BubbleOpenCloseEvent;//气泡开启关闭回调
private void BubbleManager_BubbleOpenCloseEvent(object sender, bool e)
{
ShowFullScreenInterstitialAd();
throw new NotImplementedException();
}