本文整理汇总了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);
}
示例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);
}
示例3: _pushEventLoginFinished
protected virtual void _pushEventLoginFinished(UserProfile userProfileJson, bool autoLogin, string payload){}
示例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)));
}
示例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));
}
示例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;
}
示例7: LoginFinishedEvent
public LoginFinishedEvent (UserProfile userProfile, bool autoLogin, string payload):this(userProfile, autoLogin, payload,null)
{
}
示例8: _removeUserProfile
protected virtual void _removeUserProfile(UserProfile userProfile) {
#if UNITY_EDITOR
string key = keyUserProfile(userProfile.Provider);
PlayerPrefs.DeleteKey(key);
#endif
}
示例9: _removeUserProfile
protected override void _removeUserProfile(UserProfile userProfile) {
soomlaProfile_RemoveUserProfile(userProfile.toJSONObject().ToString());
}
示例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);
}
示例11: _storeUserProfile
protected override void _storeUserProfile(UserProfile userProfile, bool notify) {
soomlaProfile_SetStoredUserProfile(userProfile.toJSONObject().ToString(), notify);
}
示例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);
}
示例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);
}
示例14: UserProfileUpdatedEvent
public UserProfileUpdatedEvent(UserProfile userProfile) : this(userProfile, null)
{
}
示例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
}