Don't display a dialog if the user didn't pick a place from the place picker.

Summary: Don't display a dialog if the user didn't pick a place.

Test Plan:
Click done in the place picker both with a place picked and without to see
if any problems crop up.

Click cancel in the place picker to make sure that it still dismisses the
dialog.

Reviewers: jacl

Reviewed By: jacl

CC: mmachedon

Differential Revision: https://phabricator.fb.com/D576940

Task ID: 1407166
Fix typo so I can close another task.

Summary: Fixing typo.

Test Plan: Check new spelling against the Oxford English Dictionary

Reviewers: jacl

Reviewed By: jacl

Differential Revision: https://phabricator.fb.com/D584998
Fix app requests in Hackbook sample.

Summary: Fix Hackbook sample's app requests to properly parse response on success. Also some minor clean up and simplification.

Test Plan:
Ran sample in simulator, verified app requests show success status.

Revert Plan:

Reviewers: jacl, caabernathy

Reviewed By: jacl

Differential Revision: https://phabricator.fb.com/D585439

Task ID: 1768482
Better handle ios6 system auth in case user un-tosses app from account settings by calling "ACAccountStore renew" when using ios6 system auth and response contains an invalid session.

Summary:
      Also added overload to FBSession closeAndClearToken: to take an NSError*.
      Also tweaked FBSession close to no-op if already closed.
      Also tweaked Scrumptious example to report login errors from FBUserSettingsView.

     This does NOT address the "code 2" errors from when ios6 users toggle the
     slider in their device Facebook settings though those cases do transition
     to "ClosedLoginFailed" so it can be argued clients can code against it.

     This also does NOT seamlessly fix cases where the ios6 auth user has
     removed the post permission from their account settings; though it does
     allow them to logout and log back in to resolve. Further, this scenario
     does surface the "(#200) Requires extended permission: publish_actions" in the
     startForPostWithGraphPath handler so clients can surface it.

Test Plan:
     Tested many cases with scrumptious, but primary issue was:
     1. using io6 system auth, login and post from scrumptious.
     2. remove scrumptious from account settings.
     3. re-open app (if already on announce page, will transition to login)
     4. click login
     5. with fix, user is prompted via ios6 dialog again.
        (without fix), login would flash to announce view then present login.

     Tested the above in both scenarios where step 1 ends in either announce page
      or if user explicitly logged out (i.e., to verify user does not need to
      click login twice). Updated in revision 2 so that user does click login twice, if they had explicitly logged out of the app (the first login will report the error, the second login will re-surface the ios dialog).

     Tested same scenario with wilde-login on device, and also on ios 4.3 simulator
      to verify no changes in those uses cases.

Revert Plan:

Reviewers: jacl, gregschechte

Reviewed By: jacl

CC: clang, ekoneil

Differential Revision: https://phabricator.fb.com/D587553

Task ID: 1764202
Addresses memory leak and symbol clash from pull requests

Summary: Thanks for the pull requests calebshay and lludo

Test Plan: built, unit-test run

Reviewers: clang, chrisp, mmarucheck

Reviewed By: chrisp

CC: gregschechte, ekoneil

Differential Revision: https://phabricator.fb.com/D587973

Task ID: 1731992
Change comment describing FBNativeDialogResultError to more accurately describe its usage.

Summary:
Change comment describing FBNativeDialogResultError to more accurately describe
its usage.

Test Plan:
n/a

Revert Plan:
n/a

Reviewers: jacl, clang

Reviewed By: jacl

Differential Revision: https://phabricator.fb.com/D588893
Add FBConditionalLog statement to better describe system authorization (ios6) failures that may be caused by misconfiguration.

Summary:
Add FBConditionalLog statement to better describe system authorization (ios6)
failures that may be caused by misconfiguration.

This handles the code = 7 case, where error looks like

{NSLocalizedDescription=The Facebook server could not fulfill this access
request: remote_app_id does not match stored id },  code:7

Test Plan:
Changed bundle identifier in scrumptious to something bogus. Tried to log on
and verified log message in console.
Verified no logging when bundle identifier is correct.

Revert Plan:

Reviewers: jacl

Reviewed By: jacl

Differential Revision: https://phabricator.fb.com/D589249
Revert change to FBSession close that would have no-op if state is already closed.

Summary: Revert change to FBSession close that would have no-op if state is already closed.

Test Plan:
Quickly tested scrumptious on 5.1 and 6.0 login/logout/post.

Revert Plan:

Reviewers: jacl

Reviewed By: jacl

Differential Revision: https://phabricator.fb.com/D588757

Task ID: 1764202
Improve FBRequestConnection error handling & iOS 6.0 permission bookkeeping

Summary:
Added a feature to FBRequestConnection to inform iOS 6.0 of permission related
failures. Added code to scrumptious to handle the case where a user explicitly
removes permissions.

Test Plan: Test the new flow via the new features in scrumptious

Reviewers: chrisp, clang

Reviewed By: chrisp

CC: gregschechte

Differential Revision: https://phabricator.fb.com/D589964

Task ID: 1778969
Fix scrumptious state change handler so that failed logins take user back to login screen as opposed to going to the announce view. Also improve the error alert views to translate the error code to a string.

Summary:
Fix scrumptious state change handler so that failed logins take user back to
login screen as opposed to going to the announce view. Also improve the error
alert views to translate the error code to a string.

Test Plan:
Ran scrumptious through various scenarios including successful logins,
 and cancelled logins (both via fast app switch or toggled ios6 app slider)

Revert Plan:

Reviewers: jacl

Reviewed By: jacl

Differential Revision: https://phabricator.fb.com/D589889

Task ID: 1778975
Add alert and comment to describe the case where users disallow re-auth retry in scrumptious.

Summary:
Add alert and comment to describe the case where users disallow re-auth retry
in scrumptious.

Test Plan:
1. login->allow->post->allow.
2. on server, remove post permission
3. in app, try to post again. App should ask for post permissions again
4. disallow, and see the new alert.
5. try to post again and see the new alert (without asking).
6. note slider is off in settings. turn slider back to on
7. try to post again and ios will ask for permissions again.

Revert Plan:

Reviewers: jacl

Reviewed By: jacl

Differential Revision: https://phabricator.fb.com/D590337
Tweak comment in the reauth-revoke->retry->disallow case in scrumptious to hint at developers to customize the message.

Summary:
Tweak comment in the reauth-revoke->retry->disallow case in scrumptious to hint
at developers to customize the message.

Test Plan:
re-ran scrumptious.

Revert Plan:

Reviewers: jacl

Reviewed By: jacl

Differential Revision: https://phabricator.fb.com/D590875
Version bump

Summary: Bumps the version and migration bundle

Test Plan: full test pass

Reviewers: clang, chrisp, mmarucheck

Reviewed By: chrisp

CC: gregschechte, ekoneil

Differential Revision: https://phabricator.fb.com/D590878
Facebook iOS SDK 3.2 (see https://developers.facebook.com/ios/change-log-3.x/)

Summary:

Modified
    FBSession properties accessToken, expirationDate and loginType have been deprecated. Instead use the new accessTokenData property to access this info.
    FBSession methods reauthorize* have been deprecated, instead use the requestNew* methods.
    Improved error handling logic, including handling various iOS 6 cases.
    The Scrumptious sample now uses FBLoginViewfor authentication. The sample has also been modified to show best practices in handling errors during authorization and calling Facebook APIs.
    Samples migrated from the deprecated APIs. The -ObjC linker flag added to all samples.
    Implicit logging added to provide Facebook Insights to events such as launching/dismissing the native share sheet, launching/dismissing the native Login dialog, friend picker usage, and place picker usage. A new advanced setting in the App Dashboard named Mobile SDK Insights, allows you to turn off the implicit logging which is on by default.
    PlacePickerSample sample displays an alert when a place is selected.
    JustRequestSample sample renamed to GraphApiSample.

Added
    FBWebDialog class to provide webview dialogs to replace Facebook dialog API.
    NSError(FBError) category extension to NSError to simplify Facebook error handling.
    FBSession methods requestNewPublishPermissions:defaultAudience:completionHandler: requestNewReadPermissions:completionHandler: for requesting new or additional permissions for the session.
    FBSession method openFromAccessTokenData to support opening from an FBAccessTokenData instance.
    FBSession class method renewSystemCredentials to allow easy refresh of iOS 6 account store.
    FBSession class methods to get and set default URL scheme suffix used in sessions:
        setDefaultUrlSchemeSuffix:
        defaultUrlSchemeSuffix
    FBAccessTokenData class to simplify access token data operations.
    FBSession property accessTokenData used to get the FBAccessTokenData used in the session.
    FBSessionTokenCachingStrategy methods to operate with FBAccessTokenData:
        nullCacheInstance - class method that returns an FBSessionTokenCachingStrategy instance that does not perform any caching. One scenario where this is useful is importing an access token using the openFromAccessTokenData method on an FBSession instance that is not initialized from cache. The nullCacheInstance can be used to create the required FBSession instance.
        cacheFBAccessTokenData: - method used to cache a token represented by FBAccessTokenData.
        fetchFBAccessTokenData - method used to fetch a cached token.
    FBPlacePickerViewController method updateView to allow a place picker refresh without a network roundtrip.
    FBLoginViewDelegate method loginView:handleError: to notify the delegate of communication or authorization errors.
    FBSettings method publishInstall:withHandler: enables defining a handler to process server response when publishing an attributed install for Mobile App Install Ads analytics.
    FBInsights class to provide client-side logging of specialized app analytics that are then available on Facebook Insights. Also provides analytics for Conversion Pixel tracking for ads optimization.
    FBSettings class methods setClientToken and clientToken to enable anonymous Facebook API calls in support of FBInsights logging.

Fixed
    Memory leaks in FBUserSettingsViewController, FBLoginView, and FBSession.
    Incorrect use of publish permissions when read permissions should be used, in FBUserSettingsViewController and FBLoginView.
    FBViewController to initialize ''done'' and''cancel'' buttons properly for non-programmatic init paths.
    FBViewController and FBLoginView documentation.
    A bug in the FBSession handleOpenURL method that no longer passed through errors.
    A bug in the FBSession handleDidBecomeActive method that incorrectly coupled to the active session.
    A bug in FBSession that prevented KVO of the state property.
    How friend picker and place picker selection changed events are triggered when items are deselected. The event was being triggered multiple times in certain scenarios.
    The friend picker to properly handle profiles with no name data.
    A bug in WebView Login dialog reauthorization flow that did not invoke reauthorization handlers.
    Rotation bugs in ProfilePictureSample, FriendPickerSample and FBUserSettingsViewController.
    FriendPickerViewController and PlacePickerViewController can now fetch Retina-sized images.

Reviewers: clang

Reviewed By: clang

Test Plan: Release Testing.
Facebook iOS SDK 3.2.1 (see https://developers.facebook.com/ios/change-log-3.x/)

Summary:

Added
    Support for frictionless application requests in FBWebDialogs

Fixed
    Exception in certain request methods when a handler is nil

Reviewers: gregschechte

Reviewed By: gregschechte

Test Plan: Release Testing.
Facebook iOS SDK 3.5 (see https://developers.facebook.com/ios/change-log-3.x/)

Summary:
    See what's new
     https://developers.facebook.com/ios/features/whats-new-ios-sdk-3.5/
    Or read the announcement at
     https://developers.facebook.com/blog/post/2013/04/18/next-evolution-of-facebook-platform-for-mobile/

Reviewed By: jacl

Test Plan: Release Testing.

@update-submodule: vendor/OCHamcrest
@update-submodule: vendor/OCMock
@update-submodule: vendor/OHHTTPStubs
Facebook iOS SDK 3.5.1

Summary:
    Bug fixes. See https://developers.facebook.com/ios/change-log-3.x/

Reviewed By: jacl

Test Plan: Release Testing.
Facebook iOS SDK 3.5.2

Summary:
     Bug fixes. See https://developers.facebook.com/ios/change-log-3.x/

Reviewed By: jacl

Test Plan: Release Testing.
Facebook iOS SDK 3.5.3

Summary:
     Bug fixes. See https://developers.facebook.com/ios/change-log-3.x/

Reviewed By: jacl

Test Plan: Release Testing.

@update-submodule: vendor/OCMock
Facebook iOS SDK 3.6

Summary:
     see https://developers.facebook.com/ios/change-log-3.x/

    Upgrading from 3.5
     https://developers.facebook.com/docs/tutorial/iossdk/upgrading-from-3.5-to-3.6

Reviewed By: jacl

Test Plan: Release Testing.