如何通过社交网络登录用户并检索个人资料详细信息

时间:2016-05-17 20:52:41

标签: login facebook-login social-networking google-login

我们开发具有登录,注册和仪表板页面的混合移动应用程序。

在登录页面用户通过多种社交网络登录应用,例如 Facebook,Twitter,google 。并为用户检索个人资料信息

任何人请指导/建议我如何逐步处理上述要求。如果有样品代码申请,请提供给我。

我开发的样本项目也是我发布的代码请找到它并指导我下一步我们要做什么

i create facebook sdk in facebook developer site

<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="UTF-8">
        <title>LoginSN</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
        <!--
            <link rel="shortcut icon" href="images/favicon.png">
            <link rel="apple-touch-icon" href="images/apple-touch-icon.png"> 
        -->
        <link href="jqueryMobile/jquery.mobile-1.4.5.css" rel="stylesheet">
        <link rel="stylesheet" href="css/main.css">
        <script>window.$ = window.jQuery = WLJQ;</script>
        <script src="jqueryMobile/jquery.mobile-1.4.5.js"></script>
        <script>
            window.fbAsyncInit = function() {
                FB.init({
                    appId : '821578904640078',
                    xfbml : true,
                    version : 'v2.6'
                });
            };

            (function(d, s, id) {
                var js, fjs = d.getElementsByTagName(s)[0];
                if (d.getElementById(id)) {
                    return;
                }
                js = d.createElement(s);
                js.id = id;
                js.src = "//connect.facebook.net/en_US/sdk.js";
                fjs.parentNode.insertBefore(js, fjs);
            }(document, 'script', 'facebook-jssdk'));
        </script>

    </head>


    <body style="display: none;">

        <div data-role="page" id="loginPage">
            <div data-role="content" style="padding: 15px">
                <label for="text">User Name:</label><input type="text" name="text" id="unL">
                <label for="text">Password:</label><input type="password" name="text" id="pwdL">
                <a href="#dashboardPage" data-role="button" id="buttonLn">LOGIN</a>
                <a href="#registrationPage" data-role="button" id="buttonRe">REGISRASTION</a>
                <a href="#" data-role="button" id="buttonF">via Facebook Login</a>
                <a href="#" data-role="button" id="buttonG">via Google Login</a>
                <a href="#" data-role="button" id="buttonT">via Twitter Login</a>
            </div>
        </div>

        <div data-role="page" id="registrationPage">
            <div data-role="content" style="padding: 15px">
                <label for="text">Name:</label><input type="text" name="text" id="unR">
                <label for="text">DOB:</label><input type="date" name="text" id="pwdR">
                <label for="text">Contact No:</label><input type="number" name="text" id="pwdR">
                <label for="text">Email ID:</label><input type="email" name="text" id="pwdR">
                <label for="text">User Name:</label><input type="text" name="text" id="unR">
                <label for="text">Password:</label><input type="password" name="text" id="pwdR"> 
                <a href="#loginPage" data-role="button" id="buttonR">Registered</a>
    </div>
        </div>

        <div data-role="page" id="dashboardPage">
            <div data-role="content" style="padding: 15px">

            </div>
        </div>

        <script src="js/initOptions.js"></script>
        <script src="js/main.js"></script>
        <script src="js/messages.js"></script>

    </body>

</html>

0 个答案:

没有答案