• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Profile.UserProfile类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Soomla.Profile.UserProfile的典型用法代码示例。如果您正苦于以下问题:C# UserProfile类的具体用法?C# UserProfile怎么用?C# UserProfile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



UserProfile类属于Soomla.Profile命名空间,在下文中一共展示了UserProfile类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: _pushEventLoginFinished

		protected override void _pushEventLoginFinished(UserProfile userProfile, bool autoLogin, string payload) { 
			if (SoomlaProfile.IsProviderNativelyImplemented(userProfile.Provider)) return;
			AndroidJNI.PushLocalFrame(100);
			using(AndroidJavaClass jniSoomlaProfile = new AndroidJavaClass("com.soomla.profile.unity.ProfileEventHandler")) {
				ProfileJNIHandler.CallStaticVoid(jniSoomlaProfile, "pushEventLoginFinished", userProfile.toJSONObject().print(), autoLogin, payload);
			}
			AndroidJNI.PopLocalFrame(IntPtr.Zero);
		}
开发者ID:trananh1992,项目名称:unity3d-profile,代码行数:8,代码来源:ProfileEventPusherAndroid.cs


示例2: StoreUserProfile

		/// <summary>
		/// Stores the given user profile in the relevant provider (contained internally in the UserProfile).
		///
		/// NOTE: This operation requires a successful login.
		/// </summary>
		/// <param name="userProfile">User profile to store.</param>
		/// <param name="notify">If set to <c>true</c>, notify.</param>
		public static void StoreUserProfile (UserProfile userProfile, bool notify = false) {
			instance._storeUserProfile (userProfile, notify);
		}
开发者ID:IgorPushkar,项目名称:FlappyBirdClone,代码行数:10,代码来源:SoomlaProfile.cs


示例3: _pushEventLoginFinished

			protected virtual void _pushEventLoginFinished(UserProfile userProfileJson, bool autoLogin, string payload){}
开发者ID:trananh1992,项目名称:unity3d-profile,代码行数:1,代码来源:ProfileEvents.cs


示例4: onLoginFinished

		/// <summary>
		/// Handles an <c>onLoginFinished</c> event
		/// </summary>
		/// <param name="message">Will contain a JSON representation of a <c>UserProfile</c> and payload</param>
		public void onLoginFinished(String message)
		{
			SoomlaUtils.LogDebug(TAG, "SOOMLA/UNITY onLoginFinished");

			JSONObject eventJson = new JSONObject(message);

			UserProfile userProfile = new UserProfile (eventJson ["userProfile"]);

			bool autoLogin = eventJson["autoLogin"].b;

			JSONObject payloadJSON = new JSONObject(eventJson ["payload"].str);

			//give a reward
			Reward reward = Reward.GetReward(ProfilePayload.GetRewardId(payloadJSON));
			if (reward !=null)
				reward.Give();

			ProfileEvents.OnLoginFinished(userProfile, autoLogin, ProfilePayload.GetUserPayload(payloadJSON));
			//ProfileEvents.OnLoginFinished(new LoginFinishedEvent(userProfile, autoLogin, ProfilePayload.GetUserPayload(payloadJSON)));
		}
开发者ID:trananh1992,项目名称:unity3d-profile,代码行数:24,代码来源:ProfileEvents.cs


示例5: onUserProfileUpdated

		/// <summary>
		/// Handles an <c>onUserProfileUpdated</c> event
		/// </summary>
		/// <param name="message">Will contain a JSON representation of a <c>UserProfile</c></param>
		public void onUserProfileUpdated(String message)
		{
			SoomlaUtils.LogDebug(TAG, "SOOMLA/UNITY onUserProfileUpdated");

			JSONObject eventJson = new JSONObject(message);
			UserProfile userProfile = new UserProfile (eventJson ["userProfile"]);

			ProfileEvents.OnUserProfileUpdated (userProfile);
			//ProfileEvents.OnUserProfileUpdated (new UserProfileUpdatedEvent(userProfile));
		}
开发者ID:trananh1992,项目名称:unity3d-profile,代码行数:14,代码来源:ProfileEvents.cs


示例6: UserProfileFromFBJson

        private static UserProfile UserProfileFromFBJson(JSONObject fbJsonObject)
        {
            JSONObject soomlaJsonObject = new JSONObject ();
            soomlaJsonObject.AddField(PJSONConsts.UP_PROVIDER, Provider.FACEBOOK.ToString ());
            soomlaJsonObject.AddField(PJSONConsts.UP_PROFILEID, fbJsonObject["id"].str);
            string name = fbJsonObject ["name"].str;
            soomlaJsonObject.AddField(PJSONConsts.UP_USERNAME, name);
            string email = fbJsonObject ["email"] != null ? fbJsonObject ["email"].str : null;
            if (email == null) {
                email = Regex.Replace(name, @"\s+", ".") + "@facebook.com";
            }
            soomlaJsonObject.AddField(PJSONConsts.UP_EMAIL, email);
            soomlaJsonObject.AddField(PJSONConsts.UP_FIRSTNAME, fbJsonObject["first_name"].str);
            soomlaJsonObject.AddField(PJSONConsts.UP_LASTNAME, fbJsonObject["last_name"].str);
            soomlaJsonObject.AddField(PJSONConsts.UP_AVATAR, fbJsonObject["picture"]["data"]["url"].str);
            UserProfile userProfile = new UserProfile (soomlaJsonObject);

            return userProfile;
        }
开发者ID:jhorikawa,项目名称:unity3d-profile,代码行数:19,代码来源:FBSocialProvider.cs


示例7: LoginFinishedEvent

		public LoginFinishedEvent (UserProfile userProfile, bool autoLogin, string payload):this(userProfile, autoLogin, payload,null)
		{

		}
开发者ID:trananh1992,项目名称:unity3d-profile,代码行数:4,代码来源:LoginFinishedEvent.cs


示例8: _removeUserProfile

		protected virtual void _removeUserProfile(UserProfile userProfile) {
			#if UNITY_EDITOR
			string key = keyUserProfile(userProfile.Provider);
			PlayerPrefs.DeleteKey(key);
			#endif
		}
开发者ID:IgorPushkar,项目名称:FlappyBirdClone,代码行数:6,代码来源:SoomlaProfile.cs


示例9: _removeUserProfile

		protected override void _removeUserProfile(UserProfile userProfile) {
			soomlaProfile_RemoveUserProfile(userProfile.toJSONObject().ToString());
		}
开发者ID:IgorPushkar,项目名称:FlappyBirdClone,代码行数:3,代码来源:SoomlaProfileIOS.cs


示例10: _pushEventLoginFinished

 protected override void _pushEventLoginFinished(UserProfile userProfile, bool autoLogin, string payload)
 {
     if (SoomlaProfile.IsProviderNativelyImplemented(userProfile.Provider)) return;
     soomlaProfile_PushEventLoginFinished(userProfile.toJSONObject().print(), autoLogin, payload);
 }
开发者ID:thirunar,项目名称:Soomla-Social-Sharing,代码行数:5,代码来源:ProfileEventPusherIOS.cs


示例11: _storeUserProfile

		protected override void _storeUserProfile(UserProfile userProfile, bool notify) {
			soomlaProfile_SetStoredUserProfile(userProfile.toJSONObject().ToString(), notify);
		}
开发者ID:IgorPushkar,项目名称:FlappyBirdClone,代码行数:3,代码来源:SoomlaProfileIOS.cs


示例12: _removeUserProfile

		protected override void _removeUserProfile(UserProfile userProfile) {
			AndroidJNI.PushLocalFrame(100);
			using(AndroidJavaClass jniSoomlaProfile = new AndroidJavaClass("com.soomla.profile.unity.UnitySoomlaProfile")) {
				ProfileJNIHandler.CallStaticVoid(jniSoomlaProfile, "removeUserProfile",
				                                 userProfile.toJSONObject().ToString());
			}
			AndroidJNI.PopLocalFrame(IntPtr.Zero);
		}
开发者ID:drapermovies,项目名称:MansionGamingGitHub,代码行数:8,代码来源:SoomlaProfileAndroid.cs


示例13: RemoveUserProfile

		/// <summary>
		/// Removes the given user profile in the relevant provider (contained internally in the UserProfile).
		///
		/// NOTE: This operation requires a successful login.
		/// </summary>
		/// <param name="userProfile">User profile to store.</param>
		public static void RemoveUserProfile (UserProfile userProfile) {
			instance._removeUserProfile (userProfile);
		}
开发者ID:IgorPushkar,项目名称:FlappyBirdClone,代码行数:9,代码来源:SoomlaProfile.cs


示例14: UserProfileUpdatedEvent

		public UserProfileUpdatedEvent(UserProfile userProfile) : this(userProfile, null)
        {

		}
开发者ID:trananh1992,项目名称:unity3d-profile,代码行数:4,代码来源:UserProfileUpdatedEvent.cs


示例15: _storeUserProfile

		protected virtual void _storeUserProfile(UserProfile userProfile, bool notify) {
			#if UNITY_EDITOR
			string key = keyUserProfile(userProfile.Provider);
			string val = userProfile.toJSONObject().ToString();
			SoomlaUtils.LogDebug(TAG, "key/val:" + key + "/" + val);
			PlayerPrefs.SetString(key, val);

			if (notify) {
				ProfileEvents.OnUserProfileUpdated(userProfile);
			}
			#endif
		}
开发者ID:IgorPushkar,项目名称:FlappyBirdClone,代码行数:12,代码来源:SoomlaProfile.cs


示例16: UserProfileFromFBJson

		private static UserProfile UserProfileFromFBJson(JSONObject fbJsonObject, FBSocialProvider provider) {
			JSONObject soomlaJsonObject = new JSONObject ();
			soomlaJsonObject.AddField(PJSONConsts.UP_PROVIDER, Provider.FACEBOOK.ToString ());
			soomlaJsonObject.AddField(PJSONConsts.UP_PROFILEID, fbJsonObject["id"].str);
			string name = fbJsonObject ["name"].str;
			soomlaJsonObject.AddField(PJSONConsts.UP_USERNAME, name);
			string email = fbJsonObject ["email"] != null ? fbJsonObject ["email"].str : null;
			if (email == null) {
				email = Regex.Replace(name, @"\s+", ".") + "@facebook.com";
			}
			soomlaJsonObject.AddField(PJSONConsts.UP_EMAIL, email);
			soomlaJsonObject.AddField(PJSONConsts.UP_FIRSTNAME, fbJsonObject["first_name"].str);
			soomlaJsonObject.AddField(PJSONConsts.UP_LASTNAME, fbJsonObject["last_name"].str);
			soomlaJsonObject.AddField(PJSONConsts.UP_AVATAR, fbJsonObject["picture"]["data"]["url"].str);
			if (fbJsonObject["gender"] != null) {
				soomlaJsonObject.AddField(PJSONConsts.UP_GENDER, fbJsonObject["gender"].str);
			}
			if (fbJsonObject["languages"] != null && fbJsonObject["languages"].Count > 0 
			    && fbJsonObject["languages"][0] != null && fbJsonObject["languages"][0]["name"] != null) {
				soomlaJsonObject.AddField(PJSONConsts.UP_LANGUAGE, fbJsonObject["languages"][0]["name"].str);
			}
			if (fbJsonObject["location"] != null && fbJsonObject["location"]["name"] != null) {
				soomlaJsonObject.AddField(PJSONConsts.UP_LOCATION, fbJsonObject["location"]["name"].str);
			}

			if (provider != null) { //let us to know if method called during own profile receiving
				Dictionary<String, JSONObject> extraDict = new Dictionary<String, JSONObject>();
				extraDict.Add("access_token", JSONObject.StringObject(AccessToken.CurrentAccessToken.TokenString));
				JSONObject permissionsObject = JSONObject.Create(JSONObject.Type.ARRAY);
				foreach (String permission in provider.permissions) {
					permissionsObject.Add(permission);
				}
				extraDict.Add("permissions", permissionsObject);
				extraDict.Add("expiration_date", new JSONObject((AccessToken.CurrentAccessToken.ExpirationTime - new DateTime(1970, 1, 1)).TotalSeconds));
				soomlaJsonObject.AddField(PJSONConsts.UP_EXTRA, new JSONObject(extraDict));
			}

			UserProfile userProfile = new UserProfile(soomlaJsonObject);
			
			return userProfile;
		}
开发者ID:IgorPushkar,项目名称:FlappyBirdClone,代码行数:41,代码来源:FBSocialProvider.cs


示例17: Score

		public Score(JSONObject jsonSC) {
			this.Leaderboard = new Leaderboard(jsonSC[PJSONConsts.UP_LEADERBOARD]);
			this.Player = new UserProfile(jsonSC[PJSONConsts.UP_USER_PROFILE]);
			this.Rank = (long)jsonSC[PJSONConsts.UP_SCORE_RANK].n;
			this.Value = (long)jsonSC[PJSONConsts.UP_SCORE_VALUE].n;
		}
开发者ID:trananh1992,项目名称:unity3d-profile,代码行数:6,代码来源:Score.cs



注:本文中的Soomla.Profile.UserProfile类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Util.FastBitmap类代码示例发布时间:2022-05-26
下一篇:
C# Profile.Provider类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap