/// <summary> /// 邀请好友 /// </summary> private void OnInviteClick() { var hallProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.HALL_PROXY) as HallProxy; string inviteUrl = string.Format("{0}?{1}={2}", GlobalData.ShareUrl, StartUpParam.ROOMID, hallProxy.HallInfo.RoomCode); string title = string.Format("房间号:{0} 全民麻将", hallProxy.HallInfo.RoomCode); string desc = string.Format("我在(全民约牌吧)开了{0}局,{1}风的4人房间,快来一起玩吧!", hallProxy.HallInfo.CompetitionRound.GetHashCode(), hallProxy.HallInfo.CompetitionRule == GameRule.NOT_WORD ? "无" : "有"); if (GlobalData.sdkPlatform == SDKPlatform.ANDROID) { AndroidSdkInterface.WeiXinShare(inviteUrl, title, desc, false); } else if (GlobalData.sdkPlatform == SDKPlatform.IOS) { IOSSdkInterface.WeiXinShare(inviteUrl, title, desc, false); } }
public override void OnRegister() { base.OnRegister(); this.View.ButtonAddListening(this.View.CloseButton, () => { UIManager.Instance.HideUI(UIViewID.SHARE_VIEW); }); this.View.ButtonAddListening(this.View.FriendButton, () => { if (GlobalData.sdkPlatform == SDKPlatform.ANDROID) { string title = "江西景德镇翻精软四粒"; string desc = "快来翻精软四粒吧"; AndroidSdkInterface.WeiXinShare(GlobalData.ShareUrl, title, desc, false); } else if (GlobalData.sdkPlatform == SDKPlatform.IOS) { string title = "江西景德镇翻精软四粒"; string desc = "快来翻精软四粒吧"; IOSSdkInterface.WeiXinShare(GlobalData.ShareUrl, title, desc, false); } }); this.View.ButtonAddListening(this.View.CommunityButton, () => { if (GlobalData.sdkPlatform == SDKPlatform.ANDROID) { string title = "江西景德镇翻精软四粒"; string desc = "快来翻精软四粒吧"; AndroidSdkInterface.WeiXinShare(GlobalData.ShareUrl, title, desc, true); } else if (GlobalData.sdkPlatform == SDKPlatform.IOS) { string title = "江西景德镇翻精软四粒"; string desc = "快来翻精软四粒吧"; IOSSdkInterface.WeiXinShare(GlobalData.ShareUrl, title, desc, true); } }); }