當前位置: 首頁>>代碼示例>>C#>>正文


C# Profile.UserProfile類代碼示例

本文整理匯總了C#中Soomla.Profile.UserProfile的典型用法代碼示例。如果您正苦於以下問題:C# UserProfile類的具體用法?C# UserProfile怎麽用?C# UserProfile使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


UserProfile類屬於Soomla.Profile命名空間,在下文中一共展示了UserProfile類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的Soomla.Profile.UserProfile類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。