Fixes property name in FBOpenGraphAction

Summary: The message property was misnamed, and this fixes it

Test Plan: build, unit tests

Reviewers: clang, gregschechte, mingfli, mmarucheck

Reviewed By: mmarucheck

CC: msdkexp@, platform-diffs@lists

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

Task ID: 1400561
Clear cached requests and pictures when session is closeAndClear-ed

Summary:
When FBSession.closeAndClearTokenInformation() is called, we can go ahead and clear out some of the cached data.
Cached requests will have the session's accessToken in the url query params - which can be used as a filter
Stuff from akamai (images) does not have the same. So we just clear all to err on the side of safety w.r.t. privacy

Test Plan:
Manual testing of Scrumptious with lots of NSLogging.
Multiple login/logouts with different users.

Reviewers: jacl, clang

Reviewed By: jacl

CC: msdkexp@

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

Task ID: 1129032

Conflicts:
	src/FBSDKVersion-generated.h
Adds global migration bundle support

Summary:
Adds support for global migration bundles, which means -
1) By default all requests pass a migration bundle
2) For internal requests (pickers, etc.) the migration bundle is not changeable
3) For app owned requests, the bundle can be removed, or changed from the default

Test Plan:
Manual testing debugging the server to confirm bundles trigger the right code on the
server in the following situations -
1) no bundle
2) an existing bundle
3) a non existing bundle
4) a bundle with all expired migrations
5) bundle parameter with empty value (e.g. migration_bundle=)

Reviewers: clang, mmarucheck

Reviewed By: mmarucheck

CC: gregschechte, ekoneil, msdkexp@

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

Task ID: 1464508

Conflicts:
	src/FBSDKVersion.h
iOS 6.0 login support w/samples

Summary:
Adds login support for iOS 6.0, including but not limited to --
 * renaming of permissions to denote read requirement where applicable
 * addition of arguments, overloads and enums to support audience selection
 * update of samples that post, to defer publish permissions until action is taken
 * core iOS 6.0 authorization support in FBSession

Test Plan:
Mainly manual testing of impacted samples, including full matrix of login and
permission upgrade, with and without iOS integrated auth, as well as adding
and removing iOS integrated auth part-way through the test process.

Reviewers: mmarucheck, clang, caabernathy

Reviewed By: mmarucheck

CC: msdkexp@, ekoneil, leil

Differential Revision: https://phabricator.fb.com/D577229
acquire the iOS6 advertisingIdentifier, if not opted out, and send it during publish.

Summary: Apple has added a new API in iOS6, and we should use it when available.

Test Plan:
run a publish in all 4 scenarios of iOS5/6 device X all sample applications.
Verify the the build never fails.
make sure to delete the apps on the phone before/after each test.
Only on ios6 should the advertiser_id value be set when publishing to facebook.

Reviewers: jacl, clang

Reviewed By: jacl

CC: vijaye, teck, calvin, msdkexp@, neko-dev@, suhas

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

Conflicts:
	src/facebook-ios-sdk.xcodeproj/project.pbxproj
Bucketizes the permissions developer model by read and publish

Summary:
This change establishes the developer model that supports the direction of
dissallowing permission requests to users that present both read and publish
permissions in a single request gesture. The specific changes are:
* Adds read and publish versions of permissions properties to certain controls
* Adds read and publish versions of open and reauthorize methods on FBSession
* Deprecates methods and properties that take unspecified collections of permissions
* Updates samples

Note - in order to unblock docs work, we are pushing this with a known build break in
one of the samples. Will fix the sample shortly.

Test Plan: Tested impacted scenarios via samples

Reviewers: clang, mmarucheck, gregschechte

Reviewed By: mmarucheck

CC: chrisp, ekoneil

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

Task ID: 1731992

Conflicts:
	samples/HelloFacebookSample/HelloFacebookSample/HFViewController.m
Revert "acquire the iOS6 advertisingIdentifier, if not opted out, and send it during publish."

Summary:
This reverts commit 4b156bc87f08633999c361d145676f7256830bc8.

Conflicts:
	samples/Hackbook/Hackbook.xcodeproj/project.pbxproj
	samples/ProfilePictureSample/ProfilePictureSample.xcodeproj/project.pbxproj
	src/facebook-ios-sdk.xcodeproj/project.pbxproj

Test Plan: verify that the build works and tests pass.

Reviewers: jacl

Reviewed By: jacl

CC: msdkexp@

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

Conflicts:
	src/facebook-ios-sdk.xcodeproj/project.pbxproj
[ios-sdk] Fix Scrumptious to handle session invalidation better; don't try to re-close FBSession if it is already closed.

Summary:
Depending on when Scrumptious encountered an invalid session state change, it was not always correctly
presenting its login view.

[FBSession closeAndClearTokenInformation] should not transition state if the session is already closed.

Test Plan:
- Ran Scrumptious on iOS6 simulator and device

Revert Plan:

Reviewers: jacl

Reviewed By: jacl

CC: msdkexp@

Differential Revision: https://phabricator.fb.com/D580143
[ios-sdk] Fix small permission bug in FBSession; remove duplicate copies of launch images in some samples.

Summary:
FBSession was adding "email" to iOS 6 permissions even when not necessary.

Two copies of the launch images ended up being added to three of the samples. This confuses Xcode in some instances,
plus is just plain redundant. Removing the duplicates.

Test Plan:
- Built and ran the three samples on an iOS device

Revert Plan:

Reviewers: jacl

Reviewed By: jacl

CC: msdkexp@

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

Conflicts:
	samples/BooleanOGSample/BooleanOGSample.xcodeproj/project.pbxproj
	samples/FriendPickerSample/FriendPickerSample.xcodeproj/project.pbxproj
	samples/HelloFacebookSample/HelloFacebookSample.xcodeproj/project.pbxproj
[ios-sdk] When using iOS integrated auth, ensure basic info permission is part of read permissions.

Summary:
iOS integrated auth requires at least one permission to be specified, so if read permissions
are being requested, ensure basic info ("email") is among them.

Test Plan:
- Ran unit tests
- Ran Scrumptious with iOS 6 integrated auth

Revert Plan:

Reviewers: jacl

Reviewed By: jacl

CC: msdkexp@

Differential Revision: https://phabricator.fb.com/D582163
Add FBSession handleDidBecomeActive to better handle scenarios where users decline or do not complete app-switch authorizations.

Summary:
Add FBSession handleDidBecomeActive to better handle scenarios where users
decline or do not complete app-switch authorizations. Consumers should call
this method from their application delegate's 'applicationDidBecomeActive:'
in a similar way as the 'handleOpenUrl:'.

This method uses new internal state to clean up any incomplete (re)
authorizations and takes into account the new iOS 6 system authorization.

Test Plan:
I. Ran unit tests in sdk core.
II. Scrumptious testing
 (Test Matrix) For:
1) ios6 device with system authorization
2) ios6 device w/o system authorization but with facebook app login
3) ios6 simulator using safari login fallback

 performed:
a) login->accept auth; post->accept auth; verify post.
b) login->decline/ignore; re-open app->login again; verify app state.
c) after login; post->decline/ignore auth; verify app state;
   post again->accept auth; verify post.

III. Verified SessionLoginSample

Revert Plan:

Reviewers: jacl, clang

Reviewed By: jacl

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

Task ID: 1752513
[ios-sdk] Bump version numbers, fix headerdoc warning.

Summary:
Version numbers need to reflect 3.1 rather than 3.0.

Parameter rename in headerdoc.

Test Plan:
- Built distribution, saw 3.1

Revert Plan:

Reviewers: jacl

Reviewed By: jacl

CC: msdkexp@

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

Conflicts:
	src/FBSession.h
Improves timing of location request in scrumptious

Summary: Waits until the user is logged on before asking for location access

Test Plan: Ran the sample with both integrated and downlevel auth, confirmed request is in the right spot

Reviewers: clang

Reviewed By: clang

CC: msdkexp@

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

Task ID: 1731992
Fix Hackbook graph api usage

Summary:
Hackbook adopts the migration bundle of the SDK in general, meaning it gets updated profile picture viewer semantics, and thus receives an array rather than just a URL.

Modify the accessor to dive in and get the URL when the 'details' isn't a string.

Test Plan: Ran Hackbook

Reviewers: jacl, chrisp, clang, mmarucheck, ayden, karthiks, mingfli, caabernathy

Reviewed By: jacl

CC: msdkexp@

Differential Revision: https://phabricator.fb.com/D582510
[ios-sdk] Added FBNativeDialogs class.

Summary:
FBNativeDialogs class provides access to the iOS 6 native sharing dialog in a manner that provides consistency with
any FBSession that the app may have opened (to ensure the OS notion of current user matches the app notion of
same).

Test Plan: Revert Plan:

Reviewers: jacl

Reviewed By: jacl

CC: msdkexp@, gregschechte

Differential Revision: https://phabricator.fb.com/D582883
Establishes a loginType property on FBSession

Summary:
The meat of the change adding a property tracking login type
the supported types are - none, system, app, web, inline web,
and test account

Test Plan: n/a

Reviewers: clang

Reviewed By: clang

CC: msdkexp@, gregschechte

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

Task ID: 1731992
[ios-sdk] Implemented FBNativeDialogs support for iOS 6 share dialog.

Summary:
Fleshed out the implementation, including error handling. Added Social.framework to sample
applications.

Test Plan:
- Ran modified HelloFacebook sample that calls new API.

Revert Plan:

Reviewers: jacl

Reviewed By: jacl

CC: msdkexp@, caabernathy

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

Conflicts:
	samples/Scrumptious/Scrumptious.xcodeproj/project.pbxproj
	samples/SessionLoginSample/SessionLoginSample.xcodeproj/project.pbxproj
Support limited "custom logging" from the iOS SDK

Summary: Add support for very specific event logging in the iOS SDK.  Single events, now from FriendPicker launch and PlacePicker launch, get sent to the server.  Underlying support for apps that are not FB auth'd as well.

Test Plan: Tested via HelloFacebook

Reviewers: jacl, clang

Reviewed By: jacl

CC: msdkexp@

Differential Revision: https://phabricator.fb.com/D583180
Update Hello Facebook to work with FBNativeDialogs

Summary: Adds native sharing support for message and photo buttons

Test Plan: Ran through combinations of logged in, logged out, etc.

Reviewers: clang, gregschechte, mingfli, caabernathy

Reviewed By: mingfli

CC: msdkexp@

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

Task ID: 1731992

Conflicts:
	samples/HelloFacebookSample/HelloFacebookSample/HFViewController.m
Add custom Insights logging for Share Sheet launch, cancel, and post

Summary: Now that FBNativeDialogs is in, extend the Custom Insights logging introduced earlier tonight to Share Sheet operations.

Test Plan: Tested by invoking the share sheet and watching things go.  Hit what I think Jason described as a bug with loginType that's causing the share sheet display to fail, but worked around it for the testing.

Reviewers: jacl, clang

Reviewed By: jacl

CC: msdkexp@

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