Skip to content
This repository has been archived by the owner on Apr 25, 2019. It is now read-only.

5. Common Tips

Ruben Nine edited this page Oct 2, 2015 · 9 revisions
  • The Facebook auth dialog does no longer seem to work in iOS 9.

Starting in iOS 9, all HTTPS requests must have Perfect Forward Secrecy support enabled as part of the new App Transport Security policy (https://developer.apple.com/library/prerelease/ios/technotes/App-Transport-Security-Technote/). However, at the time of this writing, Facebook's OAuth endpoint does not seem to support it, so you must add an exception for facebook.com and its subdomains to your Info.plist:

<dict>
  <key>NSExceptionDomains</key>
  <dict>
    <key>facebook.com</key>
    <dict>
      <key>NSTemporaryExceptionRequiresForwardSecrecy</key>
      <false/>
      <key>NSIncludesSubdomains</key>
      <true/>
    </dict>
  </dict>
</dict>
  • The app builds, but crashes when I try to present the modal. (iOS only)

    It may be that you haven't set your API Key as it's checked the first time it's loaded.

    • Go to Filepicker.io to register an account.

    • Add #import <FPPicker/FPPicker.h> to your app delegate (i.e., typically AppDelegate.m)

    • Add the following code on your app delegate and use the API Key you got after registering:

      + (void)initialize
      {
          (...)
          [FPConfig sharedInstance].APIKey = @"SET_FILEPICKER.IO_APIKEY_HERE";
          (...)
      }
  • I'm using a popover in iPad and the login screens look terrible. (iOS only)

    Our ability to deliver mobile pages is partly dependent on the service itself. Some have no mobile page at all. Others examine the user agent string and return the iPad version, not a popover friendly one. I've had good luck changing my user-agent string for a couple services.

    Add this to your AppDelegate.m:

    /*
     * This makes the login screens look much nicer on iPad
     */
    
    + (void)initialize
    {
        // Set user agent (the only problem is that we can't modify the User-Agent later in the program)
    
        NSDictionary *dictionary = @{
          @"UserAgent":@"Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3"
        };
    
        [[NSUserDefaults standardUserDefaults] registerDefaults:dictionary];
    }
Clone this wiki locally