Some memory related cleanup

Summary: Did some review and found a few issues with memory management in the view controllers.

Test Plan: Code review

Reviewers: clang, gregschechte, mmarucheck

Reviewed By: clang

CC: msdkexp@

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

Task ID: 1011836
Updated FBProfilePictureView to use hi-res square image Graph API

Summary:
The Graph API for retrieving hi-res square profile pictures is now on, and this change modifies the FBProfilePictureView to use it.

- For the logic change here, see FBProfilePictureView.m
- Changed the default cropping to square, since with hi-res square, the quality is typically just as good, and non-square is very hard to reason about as someone using the control (aspect ratio is different for every user).
- Removed all but the largest non-square blank profile, and updated the square one to be bigger.  No need to carry the smaller versions as these larger ones scale down fine.
- Updated ProfilePictureSample to include a "none" option that results in showing the blank profile.
- Updated HelloFacebookSample to make both profile picture views square.

Note that when you use this sample or control, some of the square images will still be 50x50.  That's because there's a migration job starting today (7/10) that should take about a week to re-gen larger square profiles for users who haven't updated their profile in more than a year.

Task: #1113853

Test Plan: Samples on iPhone/iPad.  In particular used ProfilePictureSample to run through lots of combinations.

Reviewers: clang, jacl, ayden, mmarucheck

Reviewed By: clang

CC: msdkexp@

Differential Revision: https://phabricator.fb.com/D515828
Fixes typo in docs

Summary: per title

Test Plan: n/a

Reviewers: clang, caabernathy

Reviewed By: caabernathy

CC: msdkexp@

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

Task ID: 1011836
Explicitly account for Retina display in FBProfilePictureView

Summary:
Turns out that the dimensions returned for a view's bounds don't change under Retina display.  (Apparently due to apps breaking all over the place when Retina was introduced.)

So, we need to calculate ourselves when figuring out what size profile picture to request

Test Plan: My box - retina & non-retina, on ProfilePictureViewer

Reviewers: clang, jacl, mmarucheck

Reviewed By: clang

CC: msdkexp@

Differential Revision: https://phabricator.fb.com/D519182
Move the logging static methods in FBSession to public FBSettings class

Summary: Create a new class FBSettings, and move to it the methods loggingBehavior and setLoggingBehaviour from FBSession.

Test Plan: Ran unit tests

Reviewers: clang, jacl, gregschechte, mmarucheck

Reviewed By: gregschechte

CC: yariv, bhiller

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

Task ID: 1146322
Fixes a bug in the pickers

Summary:
Change 94ba6df introduced a regression in the pickers that caused their data
not to display; this fixes that

Test Plan: tried the pickers in scrumptious

Reviewers: clang, ayden

Reviewed By: clang

CC: msdkexp@

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

Task ID: 1193295
Change framework name from FBiOSSDK to FacebookSDK

Summary:
Changed framework name from FBiOSSDK to FacebookSDK in the build scripts and sample apps.
FBiOSSDKResources.bundle was also renamed to FacebookSDKResources.bundle, updated those references.

Test Plan:
- Ran samples
- Ran unit tests

Reviewers: jacl, mmarucheck, gregschechte, clang

Reviewed By: jacl

CC: msdkexp@, platform-diffs@lists, security-diffs@lists, yariv, bhiller, scottg

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

Task ID: 1167996
[ios-sdk] Removed string parameter from [FBSessionTokenCachingStrategy clearToken]

Summary:
The string parameter to this method was intended as an optimization to help implementations find
the token to be deleted. However, since the intention is that only the current token would ever be
deleted, they can store this data internally if they need to optimize for it, without requiring
that all callers pay the tax of passing it in.

Test Plan:
- Ran unit tests
- Ran SwitchUserSample (the only sample that used this method explicitly)

Revert Plan:

Reviewers: jacl, mmarucheck, gregschechte, ayden

Reviewed By: jacl

CC: msdkexp@

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

Task ID: 1188716
[ios-sdk] Remove [NSURLConnection cancel] call from FBURLConnection that caused leak on iOS < 6.0.

Summary:
Occasional memory leaks were observed on iOS 4.x and 5.x, and were tracked to the cancel call in FBURLConnection. It appears
these were leaks in the system framework. Since the call wasn't strictly necessary and led to leaks, removing it.

Test Plan:
- Ran ProfilePicture sample under Instruments, observed no leak

Revert Plan:

Reviewers: jacl, mmarucheck, gregschechte, ayden

Reviewed By: jacl

CC: msdkexp@

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

Task ID: 1132284
Adds global notifications for the basic "active session on" and "active session off" transitions

Summary: For lightweight consumers (usually UX) these notifications can make it easy to track active session changes

Test Plan: testing with follow-on diffs that consume this with various components

Reviewers: clang

Reviewed By: clang

CC: msdkexp@

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

Task ID: 1188698
[ios-sdk] Fix KVO issues with [FBSession isOpen]

Summary:
When isValid was changed to isOpen, the corresponding KVO-related code did not get changed.

- Fixed string constant to be "isOpen" rather than "isValid"
- Removed misleading headerdoc from two macros
- Fixed initialization of changingIsOpen in transitionToState to be correct.

Test Plan:
- Ran new sample (not part of this checkin) and verified that notifications were being sent correctly
in response to changingIsOpen, whereas before they were not.

Revert Plan:

Reviewers: jacl, mmarucheck, gregschechte, ayden

Reviewed By: jacl

CC: msdkexp@

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

Blame Revision: D477005
[ios-sdk] Don't attempt to send requests without a session in picker view controllers.

Summary:
Both picker view controllers would attempt to send requests without a session. Since both of their
request types require a session, this would always fail to produce any results. Added a check to
skip sending a request if no session is specified.

Test Plan:
- Ran Scrumptious
- Ran picker samples

Revert Plan:

Reviewers: jacl, mmarucheck, gregschechte, ayden

Reviewed By: jacl

CC: msdkexp@

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

Task ID: 1175259
[ios-sdk] Renamed FBiOSSDK.pmdoc to FacebookSDK.pmdoc

Summary:
An earlier commit changed the build_distribution.sh script to use the new filename, but the actual file rename
did not get picked up in that commit.

Test Plan:
- Ran build_distribution.sh

Revert Plan:

Reviewers: ayden, jacl

Reviewed By: ayden

CC: msdkexp@

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

Blame Revision: D514982
Rename FBConnect to FacebookSDK

Summary: Renamed FBConnect folder in main project to FacebookSDK. Also moved FBConnect.bundle into the Hackbook folder.

Test Plan: Ran unit tests, hackbook sample

Reviewers: jacl, clang

Reviewed By: jacl

CC: bhiller

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

Task ID: 1188700
[ios-sdk] Add FBUserSettingsViewController and FBViewController classes; pickers derive from FBViewController.

Summary:
FBViewController adds functionality for views which are presented modally, providing optional Done and Cancel
buttons in a title toolbar. Views presented in a navigation controller may have a Done button, but no
Cancel button (since the "back" button serves that purpose).

FBUserSettingsViewController displays the current logged-in state of the user, and allows the user to log out
and log in. The UI for this view controller is not yet final; in particular, it does not look good on iPad.
Waiting for feedback from design before finalizing.

Scrumptious uses FBUserSettingsViewController to let the user log out, but continues to use its custom view for
logging in.

Test Plan:
- Ran Scrumptious
- Ran new test app (not checked in) that exercises the view controllers in both a modal and a navigation context.

Revert Plan:

Reviewers: jacl, mmarucheck, gregschechte, ayden

Reviewed By: jacl

CC: msdkexp@

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

Task ID: 1188684
Rename profile view controller userID to profileID

Summary: Renamed userID to profileID in FBProfilePictureView

Test Plan: Ran unit tests

Reviewers: jacl, clang

Reviewed By: jacl

CC: bhiller, scottg

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

Task ID: 1192590
Adds high-level FBMyData facebook integration object

Summary:
The FBMyData facebook integration object is meant to provide a super
lightweight integration experience for a core set of common needs. Apps
that have heavier weight needs may choose to use FBMyData in addition to
the more fundamental classes such as FBRequest and FBSession. However,
the goal of this class is to provide sufficient functionality that
some classes of application can get away with use of this class alone.
The capabilities are:
* notification of user logged in status
* ability to handle (but not present) UX for connecting/disconnecting
* ability to post a status
* ability to post a photo
* ability to fetch your info (name, fbid, etc.)
* ability to fetch your friends list

This diff also introduces an ultra-lightweight sample called "HiFacebook"

Test Plan: Ran through supported features using HiFacebook

Reviewers: clang, ayden

Reviewed By: clang

CC: msdkexp@, yariv, platform-diffs@lists

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

Task ID: 1188698
Minor doc fixes

Summary: See title

Test Plan: built framework and docs

Reviewers: clang, ayden

Reviewed By: ayden

CC: msdkexp@

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

Task ID: 1132284
[ios-sdk] Fix FBViewController to put its canvas view behind any custom UI.

Summary:
canvasView was in front of UI being loaded from, e.g., a NIB, causing them not to receive UI events. Moved
it to the back so UI elements on top of it get events.

Test Plan:
- Ran Scrumptious, PlacePickerSample, (not committed) ViewControllersSample

Revert Plan:

Reviewers: jacl, mmarucheck, gregschechte, ayden

Reviewed By: jacl

CC: msdkexp@, platform-diffs@lists

Differential Revision: https://phabricator.fb.com/D526653
Fixing the bug in Task #1132271 by making sure that PPViewController updates the view when an empty data set is returned

Summary: Fixing the bug by making sure that PPViewController updates the view when an empty data set is returned

Test Plan: Tested various queries and query scopes on both iPhone and iPad emulators

Reviewers: gregschechte, clang, jacl, mmarucheck

Reviewed By: clang

CC: jbinney

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

Task ID: 1132271