<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><h1 id="aerogear-social" style="font-weight: normal; color: rgb(17, 17, 17); line-height: 1em; font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; "><p style="margin: 1em 0px; color: rgb(68, 68, 68); font-size: 16px; ">This only shows a facebook example, but i just wanted to get a highlevel discussion going. I have a JS implementation, partial, since i am using it in another project. But it is tailored to my needs.</p><p style="margin: 1em 0px; color: rgb(68, 68, 68); font-size: 16px; "><em>I'm sure i forgot a few things</em></p></h1><h1 id="aerogear-social" style="font-weight: normal; color: rgb(17, 17, 17); line-height: 1em; font-size: 2.5em; font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; ">AeroGear Social</h1><p style="margin: 1em 0px; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; ">Since this can be more that just a "login", it probably needs it's own category instead of being added to Auth.</p><p style="margin: 1em 0px; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; ">Basically, i see AG Social as a common way to access social network api's such as facebook[1], google plus[2], twitter[3], and others.</p><p style="margin: 1em 0px; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; ">It would be a wrapper around the current platform SDK's</p><p style="margin: 1em 0px; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; ">There are a couple a common themes for most if not all the social platforms</p><ol style="margin: 1em 0px; padding: 0px 0px 0px 2em; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; "><li>you need to create an "app" on the respective platform that can act on your behalf</li><li>you need to provide "scopes", which are what information the app can access.</li></ol><p style="margin: 1em 0px; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; ">For example, using the Facebook SDK, you cannot access the users email by default. you need to provide this scope and the user will have to authorize the usage when they log in.</p><p style="margin: 1em 0px; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; ">a quick javascript example of how it could look during creation</p><pre style="font-size: 0.88em; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); border: 1px solid rgb(204, 204, 204); white-space: pre-wrap; word-wrap: break-word; padding: 5px 12px; line-height: 24px; "><code style="font-size: 0.88em; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; border: 0px !important; padding: 0px; ">var AGSocial = AeroGear.Social();

AGSocial.add({
    name: "FB",
    type: "facebook",
    settings: {
        clientId: "1234567890", //the app id provided by the platform
        scopes: "email", //the "extended permissions" we want the user to authorize
        channelFile: "//<a href="http://www.site.com/channel.html">www.site.com/channel.html</a>"  //specific to facebook,  for crossdomain
        ....  //Other platform specific settings or just other settings
    }
});

var facebookSocial = AGSocial.socials.FB;
</code></pre><p style="margin: 1em 0px; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; "><em>while "socials" might be a good name for the "modules", i'm still leaning to "stalkers", but probably not appropriate</em></p><h2 id="proposed-apis-to-begin-with" style="font-weight: normal; color: rgb(17, 17, 17); line-height: 1em; font-size: 2em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: silver; padding-bottom: 5px; font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; position: static; z-index: auto; ">Proposed API's - to Begin with. &nbsp;All names a debateable</h2><p style="margin: 1em 0px; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; "><em>examples below will continue building off the one above</em></p><p style="margin: 1em 0px; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; ">Here are a few of the basic methods that we could start off with</p><h3 id="loadsdk" style="font-weight: normal; color: rgb(17, 17, 17); line-height: 24px; font-size: 1.5em; font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; ">LoadSdk</h3><p style="margin: 1em 0px; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; ">This loads the SDK of the specified platform.</p><p style="margin: 1em 0px; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; ">The SDK's documentation recommends loading the scripts asynchronously. This gives a common way to load and then, if needed, wait for all the "socials" sdk's to load</p><ul style="margin: 1em 0px; padding: 0px 0px 0px 2em; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; "><li>Returns a promise object</li><li><p style="margin: 1em 0px; ">takes loaded callback, probably name it success. also perhaps an error callback</p><pre style="color: rgb(0, 0, 0); font-size: 0.88em; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); border: 1px solid rgb(204, 204, 204); white-space: pre-wrap; word-wrap: break-word; padding: 5px 12px; "><code style="font-size: 0.88em; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; border: 0px !important; padding: 0px; ">facebookSocial.loadSDK({
    success: function() {
         //loaded
    }
});
</code></pre></li></ul><p style="margin: 1em 0px; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; "><em>for JS, i wanted to load the sdk during the Login() method, but popup blockers interfere with this idea</em></p><h3 id="login" style="font-weight: normal; color: rgb(17, 17, 17); line-height: 24px; font-size: 1.5em; font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; ">Login</h3><p style="margin: 1em 0px; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; ">this is probably an obvious one.</p><p style="margin: 1em 0px; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; ">Logs the user in using the specified platform.</p><ul style="margin: 1em 0px; padding: 0px 0px 0px 2em; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; "><li>takes success/error callbacks</li><li><p style="margin: 1em 0px; ">callbacks return the response from the platform.</p><pre style="color: rgb(0, 0, 0); font-size: 0.88em; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); border: 1px solid rgb(204, 204, 204); white-space: pre-wrap; word-wrap: break-word; padding: 5px 12px; "><code style="font-size: 0.88em; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; border: 0px !important; padding: 0px; ">facebookSocial.login({
    success: function( response ) {
        //returns the auth response from the specified platform, when success is determined
    },
    error: function( error ) {
         //returns the auth response from the specified platform, when an error is determined
    }
});
</code></pre></li></ul><h3 id="me" style="font-weight: normal; color: rgb(17, 17, 17); line-height: 24px; font-size: 1.5em; font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; ">Me</h3><p style="margin: 1em 0px; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; ">Gets your profile information.&nbsp;<em>Must be called after a Login</em></p><div style="margin: 1em 0px; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; "><br class="webkit-block-placeholder"></div><ul style="margin: 1em 0px; padding: 0px 0px 0px 2em; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; "><li>takes a list of "fields" to bring back, or return all default( passed on platform ) fields</li><li>success/error callbacks</li><li>success/error callbacks returns response from the server</li></ul><pre style="font-size: 0.88em; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); border: 1px solid rgb(204, 204, 204); white-space: pre-wrap; word-wrap: break-word; padding: 5px 12px; line-height: 24px; "><code style="font-size: 0.88em; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; border: 0px !important; padding: 0px; ">    facebookSocial.me({
        fields: "picture, id,name, email",
        success: function( response ) { ... },
        error: function( error ) { ... }
    });
</code></pre><h3 id="logout" style="font-weight: normal; color: rgb(17, 17, 17); line-height: 24px; font-size: 1.5em; font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; ">Logout</h3><p style="margin: 1em 0px; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; ">also obvious. Logs the user out.</p><ul style="margin: 1em 0px; padding: 0px 0px 0px 2em; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; "><li><p style="margin: 1em 0px; ">possibly success/error callbacks</p><pre style="color: rgb(0, 0, 0); font-size: 0.88em; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); border: 1px solid rgb(204, 204, 204); white-space: pre-wrap; word-wrap: break-word; padding: 5px 12px; "><code style="font-size: 0.88em; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; border: 0px !important; padding: 0px; ">facebookSocial.logout();
</code></pre></li></ul><h2 id="other-possible-apis-to-begin-with" style="font-weight: normal; color: rgb(17, 17, 17); line-height: 1em; font-size: 2em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: silver; padding-bottom: 5px; font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; ">Other Possible API's to begin with</h2><h3 id="friends" style="font-weight: normal; color: rgb(17, 17, 17); line-height: 24px; font-size: 1.5em; font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; ">Friends</h3><p style="margin: 1em 0px; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; ">A common way to get your friends list</p><ul style="margin: 1em 0px; padding: 0px 0px 0px 2em; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; "><li>have various settings based on platform</li><li><p style="margin: 1em 0px; ">success/error callbacks</p><pre style="color: rgb(0, 0, 0); font-size: 0.88em; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); border: 1px solid rgb(204, 204, 204); white-space: pre-wrap; word-wrap: break-word; padding: 5px 12px; "><code style="font-size: 0.88em; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; border: 0px !important; padding: 0px; ">facebookSocial.friends({
    ... //some settings,
    success: function( response ){ ... },
    error: function( error ) { ... }
});
</code></pre></li></ul><h3 id="share" style="font-weight: normal; color: rgb(17, 17, 17); line-height: 24px; font-size: 1.5em; font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; ">Share</h3><p style="margin: 1em 0px; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; ">a common way to "Post" something to whatever platform</p><ul style="margin: 1em 0px; padding: 0px 0px 0px 2em; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; "><li>settings based on platform</li><li>success/errorbacks</li><li><p style="margin: 1em 0px; ">the message you want to share.</p><pre style="color: rgb(0, 0, 0); font-size: 0.88em; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); border: 1px solid rgb(204, 204, 204); white-space: pre-wrap; word-wrap: break-word; padding: 5px 12px; "><code style="font-size: 0.88em; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; border: 0px !important; padding: 0px; ">facebookSocial.share(
    ... //settings,
    message: { "a message to post" },
    success: function( response ) { ... },
    error: function( error ) { ... }
);
</code></pre></li></ul><p style="margin: 1em 0px; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; "><br></p><p style="margin: 1em 0px; color: rgb(68, 68, 68); font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', 'Hiragino Sans GB', STXihei, 微软雅黑, serif; font-size: 16px; line-height: 24px; "><a href="https://developers.facebook.com/" style="color: rgb(11, 0, 128); text-decoration: none; ">[1]</a>&nbsp;<a href="https://developers.google.com/+/" style="color: rgb(11, 0, 128); text-decoration: none; ">[2]</a>&nbsp;<a href="https://dev.twitter.com/" style="color: rgb(11, 0, 128); text-decoration: none; ">[3]</a></p></body></html>