【问题标题】:Titanium Facebook Module 5.1.0 crashes at authorizationTitanium Facebook Module 5.1.0 在授权时崩溃
【发布时间】:2016-07-19 19:27:02
【问题描述】:

我在尝试授权 Facebook 模块时遇到 Facebook 模块崩溃。我一直在查看代码,但似乎找不到错误。我关注Appcelerator guide 有人看到任何错误吗?提前致谢。

来自控制台的错误

[ERROR] :  The application has crashed with an uncaught exception 'InvalidOperationException'.
[ERROR] :  Reason:
[ERROR] :  fbauth2 is missing from your Info.plist under LSApplicationQueriesSchemes and is required for iOS 9.0

这是我 index.js 中的 facebook 代码

var fb = require('facebook');
 fb.setLoginBehavior(fb.LOGIN_BEHAVIOR_NATIVE);
 fb.permissions = ["public_profile","email"];
 fb.authorize();

这是 Tiapp.xml 的 ios 部分

 <ios>
    <enable-launch-screen-storyboard>true</enable-launch-screen-storyboard>
    <default-background-color>#3AB6ED</default-background-color>
    <plist>
        <dict>
            <key>CFBundleURLTypes</key>
            <array>
                <dict>
                    <key>CFBundleURLSchemes</key>
                    <array>
                        <string>fb55458225139xxxx</string>
                    </array>
                </dict>
            </array>
            <key>FacebookAppID</key>
            <string>55458225139xxxx</string>
            <key>FacebookDisplayName</key>
            <string>Fluid - Borrow it</string>
            <key>UISupportedInterfaceOrientations~iphone</key>
            <array>
                <string>UIInterfaceOrientationPortrait</string>
            </array>
            <key>UISupportedInterfaceOrientations~ipad</key>
            <array>
                <string>UIInterfaceOrientationPortrait</string>
            </array>
            <key>UIRequiresPersistentWiFi</key>
            <false/>
            <key>UIPrerenderedIcon</key>
            <false/>
            <key>UIStatusBarHidden</key>
            <false/>
            <key>UIStatusBarStyle</key>
            <string>UIStatusBarStyleLightContent</string>
            <key>NSLocationWhenInUseUsageDescription</key>
            <string>
                Using the user location to determine the neighborhood they are in to lend and borrow items.
            </string>
            <key>NSAppTransportSecurity</key>
            <dict>
                <key>NSAllowsArbitraryLoads</key>
                <true/>
                <key>NSExceptionDomains</key>
                <dict>
                    <key>facebook.com</key>
                        <dict>
                            <key>NSIncludesSubdomains</key> 
                            <true/>        
                            <key>NSExceptionRequiresForwardSecrecy</key> 
                            <false/>
                        </dict>
                    <key>fbcdn.net</key>
                        <dict>
                            <key>NSIncludesSubdomains</key> 
                            <true/>
                            <key>NSExceptionRequiresForwardSecrecy</key>  
                            <false/>
                        </dict>
                    <key>akamaihd.net</key>
                        <dict>
                            <key>NSIncludesSubdomains</key> 
                            <true/>
                            <key>NSExceptionRequiresForwardSecrecy</key> 
                            <false/>
                        </dict>
                </dict>
            </dict>
        </dict>
    </plist>
</ios>

【问题讨论】:

    标签: facebook titanium titanium-mobile appcelerator-titanium titanium-modules


    【解决方案1】:

    这显然是缺失的。文档也不是很清楚是否需要授权。

    <key>LSApplicationQueriesSchemes</key>
    <array>
        <string>fbapi</string>
        <string>fb-messenger-api</string>
        <string>fbauth2</string>
        <string>fbshareextension</string>
    </array>
    

    【讨论】:

      【解决方案2】:

      您的 tiapp.xml 中缺少 LSApplicationQueriesSchemes。 文档说明了这些字符串:

      <key>LSApplicationQueriesSchemes</key>
      <array>
          <string>fbapi</string>
          <string>fb-messenger-api</string>
          <string>fbauth2</string>
          <string>fbshareextension</string>
      </array>
      

      但如果您在某些设备上仍然遇到记录/接收用户数据的问题,请尝试添加所有字符串(如 Facebook SDK 建议的那样):

      <string>fbapi</string>
      <string>fbapi20130214</string>
      <string>fbapi20130410</string>
      <string>fbapi20130702</string>
      <string>fbapi20131010</string>
      <string>fbapi20131219</string>
      <string>fbapi20140410</string>
      <string>fbapi20140116</string>
      <string>fbapi20150313</string>
      <string>fbapi20150629</string>
      <string>fbapi20160328</string>
      <string>fbauth</string>
      <string>fbauth2</string>
      <string>fb-messenger-api20140430</string>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2012-09-18
        • 2016-08-09
        • 2017-05-06
        • 2011-05-18
        • 2016-12-03
        • 2014-11-15
        • 2011-10-13
        相关资源
        最近更新 更多