public void ShareQQBox(string actID, string boxID, string title, string desc) { Singleton <ApolloHelper> .GetInstance().m_bShareQQBox = false; if (!MonoSingleton <ShareSys> .GetInstance().IsInstallPlatform()) { return; } Texture2D texture2D = Resources.Load("Share/120", typeof(Texture2D)) as Texture2D; byte[] array = texture2D.EncodeToPNG(); if (array != null) { int num = array.Length; } IApolloSnsService apolloSnsService = IApollo.Instance.GetService(1) as IApolloSnsService; if (Singleton <ApolloHelper> .GetInstance().CurPlatform == ApolloPlatform.QQ) { this.m_bShareQQBox = true; string url = string.Format("http://gamecenter.qq.com/giftbox/release/index/grap.html?actid={0}&_wv=1031&boxid={1}&appid={2}", actID, boxID, ApolloConfig.appID); string thumbImageUrl = "http://image.smoba.qq.com/yywj/share_pic/120.png"; apolloSnsService.SendToQQ(ApolloShareScene.QSession, title, desc, url, thumbImageUrl); } }
public void ShareSendHeart(string openId, string title, string desc, string extInfo) { Singleton <ApolloHelper> .GetInstance().m_bShareQQBox = false; if (MonoSingleton <ShareSys> .GetInstance().IsInstallPlatform()) { byte[] buffer = (Resources.Load("Share/120", typeof(Texture2D)) as Texture2D).EncodeToPNG(); int length = 0; if (buffer != null) { length = buffer.Length; } IApolloSnsService service = IApollo.Instance.GetService(1) as IApolloSnsService; MonoSingleton <ShareSys> .instance.OnShareCallBack(); if (Singleton <ApolloHelper> .GetInstance().CurPlatform == ApolloPlatform.QQ) { ApolloAccountInfo accountInfo = this.GetAccountInfo(false); if (accountInfo != null) { string targetUrl = "http://gamecenter.qq.com/gcjump?appid=1104466820&pf=invite&from=androidqq&plat=qq&originuin=" + accountInfo.OpenId + "&ADTAG=gameobj.msg_heart"; string imgUrl = "http://image.smoba.qq.com/yywj/share_pic/120.png"; service.SendToQQGameFriend(1, openId, title, desc, targetUrl, imgUrl, title, "MSG_HEART_SEND", extInfo); } } else { service.SendToWXGameFriend(openId, title, desc, "9Wste6_dDgZtoVmC6CQTh0jj29kGEp0jrVSYrGWvtZLvSTDN9fUb-_sNjacaGITt", "messageExt", "MSG_heart_send", extInfo); } } }
public ApolloHelper() { this.info = new ApolloInfo(ApolloConfig.QQAppID, ApolloConfig.WXAppID, ApolloConfig.maxMessageBufferSize, string.Empty); IApollo.Instance.Initialize(this.info); IApollo.Instance.SetApolloLogger(ApolloLogPriority.None, null); this.accountService = IApollo.Instance.GetAccountService(); this.payService = null; this.registerInfo = new RegisterInfo(); this.snsService = (IApollo.Instance.GetService(1) as IApolloSnsService); this.reportService = (IApollo.Instance.GetService(3) as IApolloReportService); this.quickLoginService = (IApollo.Instance.GetService(7) as IApolloQuickLoginService); this.m_IsSwitchToLoginPlatform = false; this.m_IsLoginEventHandlerRegistered = false; this.m_IsLoginReturn = false; this.CurPlatform = ApolloPlatform.None; this.m_LastOpenID = null; this.m_LastTriedPlatform = ApolloPlatform.None; this.m_IsLastTriedPlatformSet = false; this.IsLastLaunchFrom3rdAPP = false; if (File.Exists(Application.persistentDataPath + "/customOpenId.txt")) { this.IsNoneModeSupport = true; } else { this.IsNoneModeSupport = false; } HttpDnsPolicy.Init(); }
public void ShareSendHeart(string openId, string title, string desc, string extInfo) { Singleton <ApolloHelper> .GetInstance().m_bShareQQBox = false; if (!MonoSingleton <ShareSys> .GetInstance().IsInstallPlatform()) { return; } Texture2D texture2D = Resources.Load("Share/120", typeof(Texture2D)) as Texture2D; byte[] array = texture2D.EncodeToPNG(); if (array != null) { int num = array.Length; } IApolloSnsService apolloSnsService = IApollo.get_Instance().GetService(1) as IApolloSnsService; MonoSingleton <ShareSys> .get_instance().OnShareCallBack(); if (Singleton <ApolloHelper> .GetInstance().CurPlatform == 2) { ApolloAccountInfo accountInfo = this.GetAccountInfo(false); if (accountInfo != null) { string text = "http://gamecenter.qq.com/gcjump?appid=1104466820&pf=invite&from=androidqq&plat=qq&originuin=" + accountInfo.get_OpenId() + "&ADTAG=gameobj.msg_heart"; string text2 = "http://image.smoba.qq.com/yywj/share_pic/120.png"; apolloSnsService.SendToQQGameFriend(1, openId, title, desc, text, text2, title, "MSG_HEART_SEND", extInfo); } } else { apolloSnsService.SendToWXGameFriend(openId, title, desc, "9Wste6_dDgZtoVmC6CQTh0jj29kGEp0jrVSYrGWvtZLvSTDN9fUb-_sNjacaGITt", "messageExt", "MSG_heart_send", extInfo); } }
public bool GetMySnsInfo(OnRelationNotifyHandle handler) { if (this.GetAccountInfo(false) == null) { Singleton <EventRouter> .GetInstance().BroadCastEvent(EventID.ApolloHelper_Need_Login); return(false); } if (this.snsService == null) { this.snsService = IApollo.Instance.GetService(1) as IApolloSnsService; if (this.snsService == null) { return(false); } } this.snsService.onRelationEvent -= handler; this.snsService.onRelationEvent += handler; switch (Singleton <ApolloHelper> .GetInstance().CurPlatform) { case ApolloPlatform.Wechat: return(this.snsService.QueryMyInfo(ApolloPlatform.Wechat)); case ApolloPlatform.QQ: case ApolloPlatform.WTLogin: return(this.snsService.QueryMyInfo(ApolloPlatform.QQ)); } return(false); }
public bool GetMySnsInfo(OnRelationNotifyHandle handler) { if (this.GetAccountInfo(false) == null) { Singleton <EventRouter> .GetInstance().BroadCastEvent(EventID.ApolloHelper_Need_Login); return(false); } if (this.snsService == null) { this.snsService = (IApollo.get_Instance().GetService(1) as IApolloSnsService); if (this.snsService == null) { return(false); } } this.snsService.remove_onRelationEvent(handler); this.snsService.add_onRelationEvent(handler); switch (Singleton <ApolloHelper> .GetInstance().CurPlatform) { case 1: return(this.snsService.QueryMyInfo(1)); case 2: case 3: return(this.snsService.QueryMyInfo(2)); default: return(false); } }
public ApolloHelper() { IApollo.Instance.Initialize(this.info); IApollo.Instance.SetApolloLogger(ApolloLogPriority.None, null); this.accountService = IApollo.Instance.GetAccountService(); this.payService = null; this.registerInfo = new RegisterInfo(); this.snsService = IApollo.Instance.GetService(1) as IApolloSnsService; this.reportService = IApollo.Instance.GetService(3) as IApolloReportService; this.quickLoginService = IApollo.Instance.GetService(7) as IApolloQuickLoginService; this.m_IsSwitchToLoginPlatform = false; this.m_IsLoginEventHandlerRegistered = false; this.m_IsLoginReturn = false; this.CurPlatform = ApolloPlatform.None; this.m_LastOpenID = null; this.m_LastTriedPlatform = ApolloPlatform.None; this.m_IsLastTriedPlatformSet = false; if (File.Exists(Application.persistentDataPath + "/customOpenId.txt")) { this.IsNoneModeSupport = true; } else { this.IsNoneModeSupport = false; } }
public void ShareRedBox(int shareType, string url, string title, string desc) { if (!MonoSingleton <ShareSys> .GetInstance().IsInstallPlatform()) { return; } Texture2D texture2D = Resources.Load("Share/redbox", typeof(Texture2D)) as Texture2D; byte[] array = texture2D.EncodeToPNG(); int num = 0; if (array != null) { num = array.Length; } IApolloSnsService apolloSnsService = IApollo.get_Instance().GetService(1) as IApolloSnsService; if (Singleton <ApolloHelper> .GetInstance().CurPlatform == 2) { string text = "http://image.smoba.qq.com/yywj/share_pic/redbox.png"; apolloSnsService.SendToQQ(shareType, title, desc, url, text); } else if (Singleton <ApolloHelper> .GetInstance().CurPlatform == 1) { apolloSnsService.SendToWeixinWithUrl(shareType, title, desc, url, "MSG_INVITE", array, num, "message Ext"); } }
public void ShareSendHeartPandroa(int actID, string openId, string title, string desc, string pic_url, string previewText, string gameTag, string extInfo, string mediaId, string messageExt) { Singleton <ApolloHelper> .GetInstance().m_bShareQQBox = false; if (!MonoSingleton <ShareSys> .GetInstance().IsInstallPlatform()) { return; } IApolloSnsService apolloSnsService = IApollo.Instance.GetService(1) as IApolloSnsService; MonoSingleton <ShareSys> .instance.OnShareCallBack(); if (Singleton <ApolloHelper> .GetInstance().CurPlatform == ApolloPlatform.QQ) { ApolloAccountInfo accountInfo = this.GetAccountInfo(false); if (accountInfo != null) { string targetUrl = "http://gamecenter.qq.com/gcjump?appid=1104466820&pf=invite&from=androidqq&plat=qq&originuin=" + accountInfo.OpenId + "&ADTAG=gameobj.msg_heart"; apolloSnsService.SendToQQGameFriend(actID, openId, title, desc, targetUrl, pic_url, previewText, gameTag, extInfo); } } else { apolloSnsService.SendToWXGameFriend(openId, title, desc, mediaId, messageExt, gameTag, extInfo); } }
public void InviteFriendToRoom(string title, string desc, string roomInfo) { Singleton <ApolloHelper> .GetInstance().m_bShareQQBox = false; if (!MonoSingleton <ShareSys> .GetInstance().IsInstallPlatform()) { return; } Texture2D texture2D = Resources.Load("Share/120", typeof(Texture2D)) as Texture2D; byte[] array = null; if (texture2D) { array = texture2D.EncodeToPNG(); } int thumbDataLen = 0; if (array != null) { thumbDataLen = array.Length; } IApolloSnsService apolloSnsService = IApollo.Instance.GetService(1) as IApolloSnsService; if (apolloSnsService == null) { return; } if (Singleton <ApolloHelper> .GetInstance().CurPlatform == ApolloPlatform.QQ) { ApolloAccountInfo accountInfo = this.GetAccountInfo(false); if (accountInfo != null) { string url = string.Concat(new string[] { "http://gamecenter.qq.com/gcjump?appid=1104466820&pf=invite&from=androidqq&plat=qq&originuin=", accountInfo.OpenId, "&ADTAG=gameobj.msg_invite&", ApolloHelper.QQ_SHARE_GAMEDATA, "=", roomInfo }); string thumbImageUrl = "http://image.smoba.qq.com/yywj/share_pic/120.png"; apolloSnsService.SendToQQ(ApolloShareScene.QSession, title, desc, url, thumbImageUrl); } } else { apolloSnsService.SendToWeixin(title, desc, "MSG_INVITE", array, thumbDataLen, roomInfo); } }
public void ShareRecruitFriend(string title, string desc, string roomInfo) { if (!MonoSingleton <ShareSys> .GetInstance().IsInstallPlatform()) { return; } Texture2D texture2D = Resources.Load("Share/120", typeof(Texture2D)) as Texture2D; byte[] array = null; if (texture2D) { array = texture2D.EncodeToPNG(); } int imageDataLen = 0; if (array != null) { imageDataLen = array.Length; } IApolloSnsService apolloSnsService = IApollo.Instance.GetService(1) as IApolloSnsService; if (apolloSnsService == null) { return; } if (Singleton <ApolloHelper> .GetInstance().CurPlatform == ApolloPlatform.QQ) { ApolloAccountInfo accountInfo = this.GetAccountInfo(false); if (accountInfo != null) { string url = "http://youxi.vip.qq.com/m/act/b1068bb755_sgame_104290.html?_wv=1&QQ_SHARE_GAMEDATA=" + roomInfo; string thumbImageUrl = "http://image.smoba.qq.com/yywj/share_pic/120.png"; apolloSnsService.SendToQQ(ApolloShareScene.QSession, title, desc, url, thumbImageUrl); } } else { ApolloAccountInfo accountInfo2 = this.GetAccountInfo(false); if (accountInfo2 != null) { string url2 = string.Format("http://game.weixin.qq.com/cgi-bin/act?actid=4381&messageExt={0}&k=bZML6lvwyQRcCItiE6oDJg&q=0&jsapi_ticket=1#wechat_redirect", roomInfo); apolloSnsService.SendToWeixinWithUrl(ApolloShareScene.Session, title, desc, url2, "MSG_INVITE", array, imageDataLen, roomInfo); } } }
public ApolloHelper() { IApollo.Instance.Initialize(this.info); IApollo.Instance.SetApolloLogger(ApolloLogPriority.None, null); this.accountService = IApollo.Instance.GetAccountService(); this.payService = null; this.registerInfo = new RegisterInfo(); this.snsService = IApollo.Instance.GetService(1) as IApolloSnsService; this.reportService = IApollo.Instance.GetService(3) as IApolloReportService; this.quickLoginService = IApollo.Instance.GetService(7) as IApolloQuickLoginService; this.m_IsSwitchToLoginPlatform = false; this.m_IsLoginEventHandlerRegistered = false; this.m_IsLoginReturn = false; this.m_CurPlatform = ApolloPlatform.None; this.m_LastOpenID = null; this.m_LastTriedPlatform = ApolloPlatform.None; this.m_IsLastTriedPlatformSet = false; }
public void ShareInviteFriend(string openId, string title, string desc, string extInfo) { Singleton <ApolloHelper> .GetInstance().m_bShareQQBox = false; if (!MonoSingleton <ShareSys> .GetInstance().IsInstallPlatform()) { return; } Texture2D texture2D = Resources.Load("Share/120", typeof(Texture2D)) as Texture2D; if (texture2D == null) { DebugHelper.Assert(false, "Texture2D Share/120 == null"); return; } byte[] array = texture2D.EncodeToPNG(); if (array != null) { int num = array.Length; } IApolloSnsService apolloSnsService = IApollo.Instance.GetService(1) as IApolloSnsService; if (apolloSnsService == null) { DebugHelper.Assert(false, "IApollo.Instance.GetService(ApolloServiceType.Sns) == null"); return; } MonoSingleton <ShareSys> .instance.OnShareCallBack(); if (Singleton <ApolloHelper> .GetInstance().CurPlatform == ApolloPlatform.QQ) { ApolloAccountInfo accountInfo = this.GetAccountInfo(false); if (accountInfo != null) { string targetUrl = "http://gamecenter.qq.com/gcjump?appid=1104466820&pf=invite&from=androidqq&plat=qq&originuin=" + accountInfo.OpenId + "&ADTAG=gameobj.msg_invite"; string imgUrl = "http://image.smoba.qq.com/yywj/share_pic/120.png"; apolloSnsService.SendToQQGameFriend(1, openId, title, desc, targetUrl, imgUrl, title, "MSG_INVITE", extInfo); } } else { apolloSnsService.SendToWXGameFriend(openId, title, desc, "9Wste6_dDgZtoVmC6CQTh0jj29kGEp0jrVSYrGWvtZLvSTDN9fUb-_sNjacaGITt", "messageExt", "MSG_INVITE", extInfo); } }
public void InviteQQFriendToRoom(string title, string desc, string roomInfo) { byte[] buffer = (Resources.Load("Share/120", typeof(Texture2D)) as Texture2D).EncodeToPNG(); int length = 0; if (buffer != null) { length = buffer.Length; } IApolloSnsService service = IApollo.Instance.GetService(1) as IApolloSnsService; if (Singleton <ApolloHelper> .GetInstance().CurPlatform == ApolloPlatform.QQ) { ApolloAccountInfo accountInfo = this.GetAccountInfo(false); string url = "http://gamecenter.qq.com/gcjump?appid=1104466820&pf=invite&from=androidqq&plat=qq&originuin=" + accountInfo.OpenId + "&ADTAG=gameobj.msg_invite&gamedata=" + roomInfo; string thumbImageUrl = "http://image.smoba.qq.com/yywj/share_pic/120.png"; service.SendToQQ(ApolloShareScene.QSession, title, desc, url, thumbImageUrl); } }
public void ShareQQBox(string actID, string boxID, string title, string desc) { byte[] buffer = (Resources.Load("Share/120", typeof(Texture2D)) as Texture2D).EncodeToPNG(); int length = 0; if (buffer != null) { length = buffer.Length; } IApolloSnsService service = IApollo.Instance.GetService(1) as IApolloSnsService; if (Singleton <ApolloHelper> .GetInstance().CurPlatform == ApolloPlatform.QQ) { string url = string.Format("http://gamecenter.qq.com/giftbox/release/index/grap.html?actid={0}&_wv=1031&boxid={1}&appid={2}", actID, boxID, ApolloConfig.appID); string thumbImageUrl = "http://image.smoba.qq.com/yywj/share_pic/120.png"; Debug.Log("QQBox apollo targturl " + url); service.SendToQQ(ApolloShareScene.QSession, title, desc, url, thumbImageUrl); } }
public void ShareToFriend(string title, string desc) { Singleton <ApolloHelper> .GetInstance().m_bShareQQBox = false; if (!MonoSingleton <ShareSys> .GetInstance().IsInstallPlatform()) { return; } Texture2D texture2D = Resources.Load("Share/120", typeof(Texture2D)) as Texture2D; if (texture2D == null) { return; } byte[] array = texture2D.EncodeToPNG(); int num = 0; if (array != null) { num = array.Length; } IApolloSnsService apolloSnsService = IApollo.get_Instance().GetService(1) as IApolloSnsService; if (apolloSnsService == null) { return; } if (Singleton <ApolloHelper> .GetInstance().CurPlatform == 2) { ApolloAccountInfo accountInfo = this.GetAccountInfo(false); if (accountInfo != null) { string text = "http://gamecenter.qq.com/gcjump?appid=1104466820&pf=invite&from=androidqq&plat=qq&originuin=" + accountInfo.get_OpenId() + "&ADTAG=gameobj.msg_invite"; string text2 = "http://image.smoba.qq.com/yywj/share_pic/120.png"; apolloSnsService.SendToQQ(2, title, desc, text, text2); } } else { apolloSnsService.SendToWeixin(title, desc, "MSG_INVITE", array, num, "SendToWeixin_extInfo"); } }
public void ShareRecruitFriend(string title, string desc, string roomInfo) { if (!MonoSingleton <ShareSys> .GetInstance().IsInstallPlatform()) { return; } Texture2D texture2D = Resources.Load("Share/120", typeof(Texture2D)) as Texture2D; byte[] array = null; if (texture2D) { array = texture2D.EncodeToPNG(); } int num = 0; if (array != null) { num = array.Length; } IApolloSnsService apolloSnsService = IApollo.get_Instance().GetService(1) as IApolloSnsService; if (apolloSnsService == null) { return; } if (Singleton <ApolloHelper> .GetInstance().CurPlatform == 2) { ApolloAccountInfo accountInfo = this.GetAccountInfo(false); if (accountInfo != null) { string text = "http://youxi.vip.qq.com/m/act/b1068bb755_sgame_104290.html?_wv=1&QQ_SHARE_GAMEDATA=" + roomInfo; string text2 = "http://image.smoba.qq.com/yywj/share_pic/120.png"; apolloSnsService.SendToQQ(2, title, desc, text, text2); } } else { apolloSnsService.SendToWeixin(title, desc, "MSG_INVITE", array, num, roomInfo); } }
public void ShareToFriend(string title, string desc) { byte[] thumbImgData = (Resources.Load("Share/120", typeof(Texture2D)) as Texture2D).EncodeToPNG(); int thumbDataLen = 0; if (thumbImgData != null) { thumbDataLen = thumbImgData.Length; } IApolloSnsService service = IApollo.Instance.GetService(1) as IApolloSnsService; if (Singleton <ApolloHelper> .GetInstance().CurPlatform == ApolloPlatform.QQ) { ApolloAccountInfo accountInfo = this.GetAccountInfo(false); string url = "http://gamecenter.qq.com/gcjump?appid=1104466820&pf=invite&from=androidqq&plat=qq&originuin=" + accountInfo.OpenId + "&ADTAG=gameobj.msg_invite"; string thumbImageUrl = "http://image.smoba.qq.com/yywj/share_pic/120.png"; service.SendToQQ(ApolloShareScene.QSession, title, desc, url, thumbImageUrl); } else { service.SendToWeixin(title, desc, "MSG_INVITE", thumbImgData, thumbDataLen, "SendToWeixin_extInfo"); } }
public void ShareRedBox(int shareType, string url, string title, string desc, Texture2D tex, string imgurl) { if (!MonoSingleton <ShareSys> .GetInstance().IsInstallPlatform()) { return; } byte[] array = tex.EncodeToPNG(); int imageDataLen = 0; if (array != null) { imageDataLen = array.Length; } IApolloSnsService apolloSnsService = IApollo.Instance.GetService(1) as IApolloSnsService; if (Singleton <ApolloHelper> .GetInstance().CurPlatform == ApolloPlatform.QQ) { apolloSnsService.SendToQQ((ApolloShareScene)shareType, title, desc, url, imgurl); } else if (Singleton <ApolloHelper> .GetInstance().CurPlatform == ApolloPlatform.Wechat) { apolloSnsService.SendToWeixinWithUrl((ApolloShareScene)shareType, title, desc, url, "MSG_INVITE", array, imageDataLen, "message Ext"); } }