How to login to Facebook using Module.Facebook with Titanium Alloy
<p>I am following the instructions listed at 
<a href="http://docs.appcelerator.com/platform/latest/#!/api/Modules.Facebook" rel="nofollow">http://docs.appcelerator.com/platform/latest/#!/api/Modules.Facebook</a></p>

<p>And looking at the examples in the example directory for Arrow
/Users//Library/Application Support/Titanium/modules/commonjs/ti.cloud/3.2.10/example/windows/social/externalLogin.js</p>

<p>I have my Tiapp.xml configured like the instructions show</p>

<pre><code>&lt;ios&gt;
        &lt;plist&gt;
            &lt;dict&gt;
                &lt;key&gt;CFBundleURLTypes&lt;/key&gt;
                &lt;array&gt;
                    &lt;dict&gt;
                        &lt;key&gt;CFBundleURLName&lt;/key&gt;
                        &lt;string&gt;my.org&lt;/string&gt;
                        &lt;!-- Application ID same as the id value in the tiapp.xml file --&gt;
                        &lt;string&gt;my.application.id&lt;/string&gt;
                        &lt;key&gt;CFBundleURLSchemes&lt;/key&gt;
                        &lt;array&gt;
                            &lt;!-- Prefix the Facebook App ID with 'fb' --&gt;
                            &lt;string&gt;my.org&lt;/string&gt;
                            &lt;string&gt;fb(my.facebook.app.id)&lt;/string&gt;
                        &lt;/array&gt;
                    &lt;/dict&gt;
                &lt;/array&gt;
                &lt;key&gt;FacebookAppID&lt;/key&gt;
                &lt;!-- Facebook App ID --&gt;
                &lt;string&gt;(my.facebook.app.id)&lt;/string&gt;
                &lt;key&gt;FacebookDisplayName&lt;/key&gt;
                &lt;!-- Facebook App Name from developer.facebook.com --&gt;
                &lt;string&gt;my.org&lt;/string&gt;
                &lt;key&gt;LSApplicationQueriesSchemes&lt;/key&gt;
                &lt;array&gt;
                    &lt;string&gt;fbapi&lt;/string&gt;
                    &lt;string&gt;fb-messenger-api&lt;/string&gt;
                    &lt;string&gt;fbauth2&lt;/string&gt;
                    &lt;string&gt;fbshareextension&lt;/string&gt;
                &lt;/array&gt;

            &lt;/dict&gt;
        &lt;/plist&gt;
    &lt;/ios&gt;
    &lt;modules&gt;
        &lt;module platform="iphone"&gt;ti.map&lt;/module&gt;
        &lt;module platform="iphone"&gt;facebook&lt;/module&gt;
        &lt;module platform="commonjs"&gt;ti.cloud&lt;/module&gt;
    &lt;/modules&gt;
    &lt;deployment-targets&gt;
        &lt;target device="iphone"&gt;true&lt;/target&gt;
    &lt;/deployment-targets&gt;
    &lt;sdk-version&gt;5.2.0.GA&lt;/sdk-version&gt; 
</code></pre>

<p>my alloy view file looks like</p>

<pre><code>&lt;Alloy&gt;
    &lt;!-- UI Layout for Eventful page --&gt;
    &lt;Window id="social" class="container" navBarHidden="false" size="Ti.UI.FILL" title="" navTintColor="white"  backButtonTitle="Event" barColor="black" onOpen="login"&gt;
        &lt;View backgroundColor="black" &gt;
            &lt;LoginButton id="fbLogin" module="facebook" top="1%" height="7%" permissions="user_events"/&gt;
        &lt;/View&gt;
    &lt;/Window&gt;
&lt;/Alloy&gt;
</code></pre>

<p>my controller .js file looks like</p>

<pre><code>var fb = require('facebook');
fb.readPermissions = ['read_stream','email','user_events'];
fb.appid = (my.facebook.app.id);
fb.forceDialogAuth = true;

function login (evt) {

    fb.addEventListener('login', function(e) {
    if (e.success) {
        alert('Logged in');
    }
    });

    fb.addEventListener('logout', function(e) {
        alert('Logged out');
    });

};
</code></pre>

<p>I get the Facebook Login button as expected 
But when I click on it I just get an Error saying:
<strong>Not Logged In: You are not logged in. Please login and try again.</strong></p>

<p>I am never presented with a screen to enter a username and password
<a href="http://i.stack.imgur.com/DCjHh.png" rel="nofollow">FB Login Button Error</a></p>

<p>Environment is
Appcelerator Studio, build: 4.5.0
Titanium SDK 5.2.0.GA
iPhone 6 Sim / Hardware with iOS 9.2</p>