Ejemplo n.º 1
0
 private static void loadCachedUser()
 {
     if (File.Exists("User Cache.xml"))
     {
         using (Stream stream = new FileStream("User Cache.xml", FileMode.Open))
         {
             stream.Position = 0;
             XmlSerializer serializer = new XmlSerializer(typeof(CachedUser));
             m_CachedUser = serializer.Deserialize(stream) as CachedUser;
         }
     }
 }
Ejemplo n.º 2
0
        internal static User FacebookConnect(string i_UserAccessToken, out CachedUser o_CachedUser)
        {
            if (PingNetwork())
            {
                m_LoginResult = FacebookService.Connect(i_UserAccessToken);

                if (!string.IsNullOrEmpty(m_LoginResult.AccessToken))
                {
                    m_CachedUser = new CachedUser();
                    m_CachedUser.InitializeCachedUser(m_LoginResult.LoggedInUser, m_LoginResult.AccessToken);
                    cacheUser();
                }
            }
            else
            {
                loadCachedUser();
            }

            o_CachedUser = m_CachedUser;
            return(m_LoginResult.LoggedInUser);
        }
Ejemplo n.º 3
0
        public static User FacebookLogin(out CachedUser o_CachedUser)
        {
            if (PingNetwork())
            {
                m_LoginResult = FacebookWrapper.FacebookService.Login(
                    "1450160541956417",
                    "public_profile",
                    "email",
                    "publish_to_groups",
                    "user_birthday",
                    "user_age_range",
                    "user_gender",
                    "user_link",
                    "user_tagged_places",
                    "user_videos",
                    "publish_to_groups",
                    "groups_access_member_info",
                    "user_friends",
                    "user_events",
                    "user_likes",
                    "user_location",
                    "user_photos",
                    "user_posts",
                    "user_hometown");
            }

            if (!string.IsNullOrEmpty(m_LoginResult.AccessToken))
            {
                m_CachedUser = new CachedUser();
                m_CachedUser.InitializeCachedUser(m_LoginResult.LoggedInUser, m_LoginResult.AccessToken);
                cacheUser();
            }

            o_CachedUser = m_CachedUser;
            return(m_LoginResult.LoggedInUser);
        }