2015-01-06 8 views
1

根據這篇文章: http://techmusingz.wordpress.com/2014/07/03/social-connected-with-sitecore-facebook-2-access-facebook-information/ 我應該得到Sitecore.Social.ProfileMapping.Facebook.config配置屬性導入到SC用戶配置文件: enter image description hereSitecore8社會連接不導入配置Facebook的個人主頁特性

但我得到的是這些:

fb_basicData_id: 100001964217563 
fb_basicData_email: <hidden>@hotmail.com 
fb_basicData_appKey: <hidden> 
fb_basicData_appSecret: <hidden> 
fb_basicData_accessTokenSecret: <hidden> 
fb_lastRenewed: 20150106T013821Z 
fb_fieldsLastRenewed: 20150105T234345Z 

如何獲得其他屬性填充?

+0

我要參加在黑暗中拍攝這個,因爲我還沒有來得及調查Sitecore的8社交功能......有指定的用戶帳戶完成了所有其他領域(如工作,教育等),因爲其中一些領域是可選的。指定用戶帳戶的隱私設置是什麼?它可能已經設置了一些信息,只能提供給朋友而不是所有人等。 –

+0

不幸的是,所有的檢查。個人資料信息在那裏,應該沒有限制。 – ArjanP

回答

3

從版本3.0開始,Social Connected將存儲Sitecore xDB聯繫方面中的社交配置文件字段。這就是爲什麼你沒有他們在用戶配置文件。

要獲取必填字段,您應該使用Social Connected API。特別是,您應該使用SocialProfileManager類的GetSocialProfile方法來獲取特定網絡中用戶的社交資料。然後,您將可以訪問社交個人資料的Fields屬性中的所有社交個人資料字段。例如:

var socialProfileManager = ExecutingContext.Current.IoC.Get<ISocialProfileManager>(); // or create it directly: new SocialProfileManager(); 
var socialProfile = socialProfileManager.GetSocialProfile(「userName」, 「Facebook」); 
var facebookGender = socialProfile.Fields[「fb_gender」]; 
+1

您使用的是什麼版本的Sitecore?我沒有看到ExecutingContext.Current ..你使用你自己的DI容器嗎? 第二種方法返回一個沒有字段的空白配置文件。我檢查了我的配置,安全等,但仍然沒有運氣。 –

+0

我正在使用Sitecore Experience Platform 8 - Update 2. 'ExecutingContext.Current' - 它是Social Connected的一部分,要使用它,您必須引用Sitecore.Social.Infrastructure.dll程序集。 或者,你可以直接創建一個實例:'new SocialProfileManager()' –

+0

@Derek我建議你檢查是否存在XDB中存儲的合適的社交配置文件。爲此,您需要在「聯繫人」集合中找到合適的聯繫人,並檢查是否存在具有相應網絡元素的SocialProfile構面。 –

0

我與Sitecore的同樣的問題掙扎8. 確實從Facebook的基本數據可以從GetCustomProperty功能,但是配置文件數據的其餘部分在以後恢復&下可用SocialProfileManager

要使該類可用,請記住在項目中引用Sitecore.Social.Api.dll和Sitecore.Social.Domain.dll。

的Fe後:

string facebook_email = Sitecore.Context.User.Profile.GetCustomProperty("fb_basicData_email"); 
if (!String.IsNullOrEmpty(facebook_email)) 
{ 
    email.Text = facebook_email; // update UI here 
} 
var socialProfile = new SocialProfileManager(); 
// Do we have an extra profile from the user? 
if (socialProfile.SocialProfileExists(user.Name, "Facebook")) 
{ 
    var facebookProfile = socialProfile.GetSocialProfile(user.Name, "Facebook"); 
    if (facebookProfile.Fields["fb_first_name"] != null) 
    { 
     // do something here 
    } 
}