Getting Facebook iOS SDK to work?

MattHarringtonMattHarrington USMember, University

I want to add Facebook login to an iOS app, and I figure the Facebook iOS SDK is the best way. I'm using version 4.9.1.0 on iOS 9.2.1.

I'm trying to get the "FacebookiOSSample" project to work. I added my Facebook app ID to AppDelegate.cs:

string appId = "1234567890";
string appName = "MyApp";

and to Info.plist:

<key>CFBundleURLTypes</key>
<array>
  <dict>
  <key>CFBundleURLSchemes</key>
  <array>
    <string>fb1234567890</string>
  </array>
  </dict>
</array>
<key>FacebookAppID</key>
<string>1234567890</string>
<key>FacebookDisplayName</key>
<string>MyApp</string>

The app attempts to open Safari instead of the locally installed Facebook app. I have not changed this code in MainViewController.cs:

loginButton = new LoginButton (new CGRect (48, 0, 218, 46)) {
    LoginBehavior = LoginBehavior.Native
};

How can I get the app to open the Facebook app instead of Safari?

Thanks,
Matt

Answers

Sign In or Register to comment.