Permalink
Browse files

[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
  • Loading branch information...
1 parent 28fd0a0 commit 530bdc3071cb20a6022e5ab1c6dfb68d4c147531 @clang13 clang13 committed Sep 25, 2012
View
4 samples/BooleanOGSample/BooleanOGSample.xcodeproj/project.pbxproj
@@ -24,6 +24,7 @@
84070D421540AA2B00E39703 /* BOGSecondViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 84070D401540AA2B00E39703 /* BOGSecondViewController_iPhone.xib */; };
84070D451540AA2B00E39703 /* BOGSecondViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 84070D431540AA2B00E39703 /* BOGSecondViewController_iPad.xib */; };
84605AB615A77C9300197AA7 /* Accounts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84605AB515A77C9300197AA7 /* Accounts.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+ 85A928C716114684008699F1 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 85A928C616114684008699F1 /* Social.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
85AFB4CA158F9B8B000AF7F5 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB4C6158F9B8B000AF7F5 /* Icon-72.png */; };
85AFB4CB158F9B8B000AF7F5 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB4C7158F9B8B000AF7F5 /* Icon-72@2x.png */; };
85AFB4CC158F9B8B000AF7F5 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB4C8158F9B8B000AF7F5 /* Icon.png */; };
@@ -61,6 +62,7 @@
84070D441540AA2B00E39703 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/BOGSecondViewController_iPad.xib; sourceTree = "<group>"; };
8409694E1545D10B00479AD9 /* OGProtocols.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OGProtocols.h; sourceTree = "<group>"; };
84605AB515A77C9300197AA7 /* Accounts.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accounts.framework; path = System/Library/Frameworks/Accounts.framework; sourceTree = SDKROOT; };
+ 85A928C616114684008699F1 /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; };
85AFB4C6158F9B8B000AF7F5 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = "<group>"; };
85AFB4C7158F9B8B000AF7F5 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72@2x.png"; sourceTree = "<group>"; };
85AFB4C8158F9B8B000AF7F5 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
@@ -78,6 +80,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 85A928C716114684008699F1 /* Social.framework in Frameworks */,
84605AB615A77C9300197AA7 /* Accounts.framework in Frameworks */,
84070D1B1540AA2B00E39703 /* UIKit.framework in Frameworks */,
84070D1D1540AA2B00E39703 /* Foundation.framework in Frameworks */,
@@ -92,6 +95,7 @@
84070D0B1540AA2B00E39703 = {
isa = PBXGroup;
children = (
+ 85A928C616114684008699F1 /* Social.framework */,
84070D201540AA2B00E39703 /* BooleanOGSample */,
84070D191540AA2B00E39703 /* Frameworks */,
84070D171540AA2B00E39703 /* Products */,
View
4 samples/FriendPickerSample/FriendPickerSample.xcodeproj/project.pbxproj
@@ -8,6 +8,7 @@
/* Begin PBXBuildFile section */
84605AB315A77C2700197AA7 /* Accounts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84605AB215A77C2700197AA7 /* Accounts.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+ 85A928B91611462C008699F1 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 85A928B81611462C008699F1 /* Social.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
85AFB4D7158F9C1D000AF7F5 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB4D3158F9C1D000AF7F5 /* Icon-72.png */; };
85AFB4D8158F9C1D000AF7F5 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB4D4158F9C1D000AF7F5 /* Icon-72@2x.png */; };
85AFB4D9158F9C1D000AF7F5 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB4D5158F9C1D000AF7F5 /* Icon.png */; };
@@ -30,6 +31,7 @@
/* Begin PBXFileReference section */
84605AB215A77C2700197AA7 /* Accounts.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accounts.framework; path = System/Library/Frameworks/Accounts.framework; sourceTree = SDKROOT; };
+ 85A928B81611462C008699F1 /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; };
85AFB4D3158F9C1D000AF7F5 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = "<group>"; };
85AFB4D4158F9C1D000AF7F5 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72@2x.png"; sourceTree = "<group>"; };
85AFB4D5158F9C1D000AF7F5 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
@@ -60,6 +62,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 85A928B91611462C008699F1 /* Social.framework in Frameworks */,
84605AB315A77C2700197AA7 /* Accounts.framework in Frameworks */,
E2D6B81315413A570050835F /* UIKit.framework in Frameworks */,
E2D6B81515413A570050835F /* Foundation.framework in Frameworks */,
@@ -74,6 +77,7 @@
E2D6B80315413A560050835F = {
isa = PBXGroup;
children = (
+ 85A928B81611462C008699F1 /* Social.framework */,
E2D6B81815413A570050835F /* FriendPickerSample */,
E2D6B81115413A570050835F /* Frameworks */,
E2D6B80F15413A570050835F /* Products */,
View
6 samples/Hackbook/Hackbook.xcodeproj/project.pbxproj
@@ -25,7 +25,7 @@
30EA73FC13F5D590003DC0D2 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 30EA73FB13F5D590003DC0D2 /* CoreLocation.framework */; };
30ED588C14358F8A00A226C3 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 30ED588B14358F8A00A226C3 /* Default@2x.png */; };
84750AA0160A259400C1A13D /* Accounts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84750A9F160A259400C1A13D /* Accounts.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
- 84750AA3160A259E00C1A13D /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84750AA2160A259E00C1A13D /* AdSupport.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+ 85A928C016114663008699F1 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 85A928BF16114663008699F1 /* Social.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
85AFB4E4158F9C5B000AF7F5 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB4E0158F9C5B000AF7F5 /* Icon-72.png */; };
85AFB4E5158F9C5B000AF7F5 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB4E1158F9C5B000AF7F5 /* Icon-72@2x.png */; };
85AFB4E6158F9C5B000AF7F5 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB4E2158F9C5B000AF7F5 /* Icon.png */; };
@@ -62,7 +62,7 @@
30EA73FB13F5D590003DC0D2 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
30ED588B14358F8A00A226C3 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
84750A9F160A259400C1A13D /* Accounts.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accounts.framework; path = System/Library/Frameworks/Accounts.framework; sourceTree = SDKROOT; };
- 84750AA2160A259E00C1A13D /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; };
+ 85A928BF16114663008699F1 /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; };
85AFB4E0158F9C5B000AF7F5 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = "<group>"; };
85AFB4E1158F9C5B000AF7F5 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72@2x.png"; sourceTree = "<group>"; };
85AFB4E2158F9C5B000AF7F5 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
@@ -97,6 +97,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 85A928C016114663008699F1 /* Social.framework in Frameworks */,
84750AA0160A259400C1A13D /* Accounts.framework in Frameworks */,
30EA73FC13F5D590003DC0D2 /* CoreLocation.framework in Frameworks */,
30EA735E13F5D21B003DC0D2 /* UIKit.framework in Frameworks */,
@@ -120,6 +121,7 @@
30EA734E13F5D21B003DC0D2 = {
isa = PBXGroup;
children = (
+ 85A928BF16114663008699F1 /* Social.framework */,
30EA73CC13F5D50D003DC0D2 /* FBConnect */,
30EA736313F5D21B003DC0D2 /* Hackbook */,
30EA735C13F5D21B003DC0D2 /* Frameworks */,
View
4 samples/HelloFacebookSample/HelloFacebookSample.xcodeproj/project.pbxproj
@@ -18,6 +18,7 @@
5F6AF1A71532A37B00DDBD75 /* HFViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5F6AF1A51532A37B00DDBD75 /* HFViewController_iPad.xib */; };
5FC4959815C21151007EE54E /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5FC4959715C21151007EE54E /* CoreLocation.framework */; };
8458462715A63635008A1F16 /* Accounts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8458462615A63635008A1F16 /* Accounts.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+ 85A928A31611305A008699F1 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 85A928A21611305A008699F1 /* Social.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
85AFB50C158F9D78000AF7F5 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB508158F9D78000AF7F5 /* Icon-72.png */; };
85AFB50D158F9D78000AF7F5 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB509158F9D78000AF7F5 /* Icon-72@2x.png */; };
85AFB50E158F9D78000AF7F5 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB50A158F9D78000AF7F5 /* Icon.png */; };
@@ -46,6 +47,7 @@
5F6AF1A61532A37B00DDBD75 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/HFViewController_iPad.xib; sourceTree = "<group>"; };
5FC4959715C21151007EE54E /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
8458462615A63635008A1F16 /* Accounts.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accounts.framework; path = System/Library/Frameworks/Accounts.framework; sourceTree = SDKROOT; };
+ 85A928A21611305A008699F1 /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; };
85AFB508158F9D78000AF7F5 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = "<group>"; };
85AFB509158F9D78000AF7F5 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72@2x.png"; sourceTree = "<group>"; };
85AFB50A158F9D78000AF7F5 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
@@ -62,6 +64,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 85A928A31611305A008699F1 /* Social.framework in Frameworks */,
8458462715A63635008A1F16 /* Accounts.framework in Frameworks */,
5F6AF18E1532A37B00DDBD75 /* UIKit.framework in Frameworks */,
5F6AF1901532A37B00DDBD75 /* Foundation.framework in Frameworks */,
@@ -77,6 +80,7 @@
5F6AF17E1532A37B00DDBD75 = {
isa = PBXGroup;
children = (
+ 85A928A21611305A008699F1 /* Social.framework */,
5F6AF1931532A37B00DDBD75 /* HelloFacebookSample */,
5F6AF18C1532A37B00DDBD75 /* Frameworks */,
5F6AF18A1532A37B00DDBD75 /* Products */,
View
4 samples/JustRequestSample/JustRequestSample.xcodeproj/project.pbxproj
@@ -8,6 +8,7 @@
/* Begin PBXBuildFile section */
84605AB015A77B8600197AA7 /* Accounts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84605AAF15A77B8600197AA7 /* Accounts.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+ 85A928CE161146AC008699F1 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 85A928CD161146AC008699F1 /* Social.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
85AFB4FF158F9D32000AF7F5 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB4FB158F9D32000AF7F5 /* Icon-72.png */; };
85AFB500158F9D32000AF7F5 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB4FC158F9D32000AF7F5 /* Icon-72@2x.png */; };
85AFB501158F9D32000AF7F5 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB4FD158F9D32000AF7F5 /* Icon.png */; };
@@ -29,6 +30,7 @@
/* Begin PBXFileReference section */
84605AAF15A77B8600197AA7 /* Accounts.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accounts.framework; path = System/Library/Frameworks/Accounts.framework; sourceTree = SDKROOT; };
+ 85A928CD161146AC008699F1 /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; };
85AFB4FB158F9D32000AF7F5 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = "<group>"; };
85AFB4FC158F9D32000AF7F5 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72@2x.png"; sourceTree = "<group>"; };
85AFB4FD158F9D32000AF7F5 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
@@ -58,6 +60,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 85A928CE161146AC008699F1 /* Social.framework in Frameworks */,
84605AB015A77B8600197AA7 /* Accounts.framework in Frameworks */,
E2511742152BB6FE00CB342A /* UIKit.framework in Frameworks */,
E2511744152BB6FE00CB342A /* Foundation.framework in Frameworks */,
@@ -72,6 +75,7 @@
E2511732152BB6FE00CB342A = {
isa = PBXGroup;
children = (
+ 85A928CD161146AC008699F1 /* Social.framework */,
E2511747152BB6FE00CB342A /* JustRequestSample */,
E2511740152BB6FE00CB342A /* Frameworks */,
E251173E152BB6FE00CB342A /* Products */,
View
4 samples/PlacePickerSample/PlacePickerSample.xcodeproj/project.pbxproj
@@ -8,6 +8,7 @@
/* Begin PBXBuildFile section */
84605AAA15A777A800197AA7 /* Accounts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84605AA915A777A800197AA7 /* Accounts.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+ 85A928D5161146C7008699F1 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 85A928D4161146C7008699F1 /* Social.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
85AFB515158FA0A6000AF7F5 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB511158FA0A6000AF7F5 /* Icon-72.png */; };
85AFB516158FA0A6000AF7F5 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB512158FA0A6000AF7F5 /* Icon-72@2x.png */; };
85AFB517158FA0A6000AF7F5 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB513158FA0A6000AF7F5 /* Icon.png */; };
@@ -31,6 +32,7 @@
/* Begin PBXFileReference section */
84605AA915A777A800197AA7 /* Accounts.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accounts.framework; path = System/Library/Frameworks/Accounts.framework; sourceTree = SDKROOT; };
+ 85A928D4161146C7008699F1 /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; };
85AFB511158FA0A6000AF7F5 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = "<group>"; };
85AFB512158FA0A6000AF7F5 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72@2x.png"; sourceTree = "<group>"; };
85AFB513158FA0A6000AF7F5 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
@@ -62,6 +64,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 85A928D5161146C7008699F1 /* Social.framework in Frameworks */,
84605AAA15A777A800197AA7 /* Accounts.framework in Frameworks */,
B9AF4C37152E449300E9BA6C /* CoreLocation.framework in Frameworks */,
B9AF4BA9152E43EE00E9BA6C /* UIKit.framework in Frameworks */,
@@ -77,6 +80,7 @@
B9AF4B99152E43EE00E9BA6C = {
isa = PBXGroup;
children = (
+ 85A928D4161146C7008699F1 /* Social.framework */,
B9AF4BAE152E43EE00E9BA6C /* PlacePickerSample */,
B9AF4BA7152E43EE00E9BA6C /* Frameworks */,
B9AF4BA5152E43EE00E9BA6C /* Products */,
View
4 samples/ProfilePictureSample/ProfilePictureSample.xcodeproj/project.pbxproj
@@ -8,6 +8,7 @@
/* Begin PBXBuildFile section */
847BBEAA160B88E8004EC7CB /* Accounts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 847BBEA9160B88E8004EC7CB /* Accounts.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+ 85A928DC161146E2008699F1 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 85A928DB161146E2008699F1 /* Social.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
85AFB522158FA1C4000AF7F5 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB51E158FA1C4000AF7F5 /* Icon-72.png */; };
85AFB523158FA1C4000AF7F5 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB51F158FA1C4000AF7F5 /* Icon-72@2x.png */; };
85AFB524158FA1C4000AF7F5 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB520158FA1C4000AF7F5 /* Icon.png */; };
@@ -30,6 +31,7 @@
/* Begin PBXFileReference section */
847BBEA9160B88E8004EC7CB /* Accounts.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accounts.framework; path = System/Library/Frameworks/Accounts.framework; sourceTree = SDKROOT; };
+ 85A928DB161146E2008699F1 /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; };
85AFB51E158FA1C4000AF7F5 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = "<group>"; };
85AFB51F158FA1C4000AF7F5 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72@2x.png"; sourceTree = "<group>"; };
85AFB520158FA1C4000AF7F5 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
@@ -60,6 +62,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 85A928DC161146E2008699F1 /* Social.framework in Frameworks */,
847BBEAA160B88E8004EC7CB /* Accounts.framework in Frameworks */,
B98686BD151D0B3700616412 /* UIKit.framework in Frameworks */,
B98686BF151D0B3700616412 /* Foundation.framework in Frameworks */,
@@ -74,6 +77,7 @@
B98686AD151D0B3700616412 = {
isa = PBXGroup;
children = (
+ 85A928DB161146E2008699F1 /* Social.framework */,
847BBEA9160B88E8004EC7CB /* Accounts.framework */,
B98686C2151D0B3700616412 /* ProfilePictureSample */,
B98686BB151D0B3700616412 /* Frameworks */,
View
4 samples/Scrumptious/Scrumptious.xcodeproj/project.pbxproj
@@ -18,6 +18,7 @@
856DC21B1577F105001FA6A6 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 856DC2181577F105001FA6A6 /* Icon.png */; };
856DC21C1577F105001FA6A6 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 856DC2191577F105001FA6A6 /* Icon@2x.png */; };
8592BE3D15816CCC00056680 /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8592BE3C15816CCC00056680 /* AddressBook.framework */; };
+ 85A928E316114706008699F1 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 85A928E216114706008699F1 /* Social.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
85C69DCA1602B411008AD9A0 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85C69DC71602B411008AD9A0 /* Default-568h@2x.png */; };
85C69DCB1602B411008AD9A0 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 85C69DC81602B411008AD9A0 /* Default.png */; };
85C69DCC1602B411008AD9A0 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85C69DC91602B411008AD9A0 /* Default@2x.png */; };
@@ -53,6 +54,7 @@
856DC2191577F105001FA6A6 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon@2x.png"; path = "../Icon@2x.png"; sourceTree = "<group>"; };
8592BE3C15816CCC00056680 /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; };
85954AE1155889A200FABA9A /* SCProtocols.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SCProtocols.h; sourceTree = "<group>"; };
+ 85A928E216114706008699F1 /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; };
85C69DC71602B411008AD9A0 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "scrumptious/Default-568h@2x.png"; sourceTree = SOURCE_ROOT; };
85C69DC81602B411008AD9A0 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = scrumptious/Default.png; sourceTree = SOURCE_ROOT; };
85C69DC91602B411008AD9A0 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "scrumptious/Default@2x.png"; sourceTree = SOURCE_ROOT; };
@@ -86,6 +88,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 85A928E316114706008699F1 /* Social.framework in Frameworks */,
84A5DA9615A68A3D00FE54AF /* Accounts.framework in Frameworks */,
B9C1C35915129F0E008FA5D1 /* CoreLocation.framework in Frameworks */,
B9CD0A74150EA4DD00560A93 /* UIKit.framework in Frameworks */,
@@ -102,6 +105,7 @@
B9CD0A64150EA4DD00560A93 = {
isa = PBXGroup;
children = (
+ 85A928E216114706008699F1 /* Social.framework */,
B9CD0A79150EA4DD00560A93 /* Scrumptious */,
B9CD0A72150EA4DD00560A93 /* Frameworks */,
B9CD0A70150EA4DD00560A93 /* Products */,
View
4 samples/SessionLoginSample/SessionLoginSample.xcodeproj/project.pbxproj
@@ -21,6 +21,7 @@
84E7AF46158FAB2F006009C7 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 84E7AF42158FAB2F006009C7 /* Icon-72@2x.png */; };
84E7AF47158FAB2F006009C7 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 84E7AF43158FAB2F006009C7 /* Icon.png */; };
84E7AF48158FAB2F006009C7 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 84E7AF44158FAB2F006009C7 /* Icon@2x.png */; };
+ 85A928EA1611471C008699F1 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 85A928E91611471C008699F1 /* Social.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
85C69DB41602B33C008AD9A0 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85C69DB11602B33C008AD9A0 /* Default-568h@2x.png */; };
85C69DB51602B33C008AD9A0 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 85C69DB21602B33C008AD9A0 /* Default.png */; };
85C69DB61602B33C008AD9A0 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85C69DB31602B33C008AD9A0 /* Default@2x.png */; };
@@ -47,6 +48,7 @@
84E7AF42158FAB2F006009C7 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72@2x.png"; sourceTree = "<group>"; };
84E7AF43158FAB2F006009C7 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
84E7AF44158FAB2F006009C7 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon@2x.png"; sourceTree = "<group>"; };
+ 85A928E91611471C008699F1 /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; };
85C69DB11602B33C008AD9A0 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
85C69DB21602B33C008AD9A0 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
85C69DB31602B33C008AD9A0 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
@@ -58,6 +60,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 85A928EA1611471C008699F1 /* Social.framework in Frameworks */,
84A5DA9E15A68D1500FE54AF /* Accounts.framework in Frameworks */,
84C757BD152A38770070DD9C /* UIKit.framework in Frameworks */,
84C757BF152A38770070DD9C /* Foundation.framework in Frameworks */,
@@ -72,6 +75,7 @@
84C757AD152A38770070DD9C = {
isa = PBXGroup;
children = (
+ 85A928E91611471C008699F1 /* Social.framework */,
84C757C2152A38770070DD9C /* SessionLoginSample */,
84C757BB152A38770070DD9C /* Frameworks */,
84C757B9152A38770070DD9C /* Products */,
View
4 samples/SwitchUserSample/SwitchUserSample.xcodeproj/project.pbxproj
@@ -24,6 +24,7 @@
856DB08B1534B792006F6A33 /* SUSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 856DB0891534B792006F6A33 /* SUSettingsViewController.m */; };
856DB08C1534B792006F6A33 /* SUSettingsViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 856DB08A1534B792006F6A33 /* SUSettingsViewController_iPhone.xib */; };
856DB08E1534B7A0006F6A33 /* SUSettingsViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 856DB08D1534B7A0006F6A33 /* SUSettingsViewController_iPad.xib */; };
+ 85A928F116114738008699F1 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 85A928F016114738008699F1 /* Social.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
85AFB52F158FA20E000AF7F5 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB52B158FA20E000AF7F5 /* Icon-72.png */; };
85AFB530158FA20E000AF7F5 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB52C158FA20E000AF7F5 /* Icon-72@2x.png */; };
85AFB531158FA20E000AF7F5 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB52D158FA20E000AF7F5 /* Icon.png */; };
@@ -61,6 +62,7 @@
856DB0891534B792006F6A33 /* SUSettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUSettingsViewController.m; sourceTree = "<group>"; };
856DB08A1534B792006F6A33 /* SUSettingsViewController_iPhone.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SUSettingsViewController_iPhone.xib; sourceTree = "<group>"; };
856DB08D1534B7A0006F6A33 /* SUSettingsViewController_iPad.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SUSettingsViewController_iPad.xib; sourceTree = "<group>"; };
+ 85A928F016114738008699F1 /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; };
85AFB52B158FA20E000AF7F5 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = "<group>"; };
85AFB52C158FA20E000AF7F5 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72@2x.png"; sourceTree = "<group>"; };
85AFB52D158FA20E000AF7F5 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
@@ -81,6 +83,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 85A928F116114738008699F1 /* Social.framework in Frameworks */,
84605AAD15A77AFB00197AA7 /* Accounts.framework in Frameworks */,
856DB04E153393C3006F6A33 /* UIKit.framework in Frameworks */,
856DB050153393C3006F6A33 /* Foundation.framework in Frameworks */,
@@ -95,6 +98,7 @@
856DB03E153393C3006F6A33 = {
isa = PBXGroup;
children = (
+ 85A928F016114738008699F1 /* Social.framework */,
856DB053153393C3006F6A33 /* SwitchUserSample */,
856DB04C153393C3006F6A33 /* Frameworks */,
856DB04A153393C3006F6A33 /* Products */,
View
11 src/FBError.h
@@ -74,6 +74,8 @@ typedef enum FBErrorCode {
/// endpoints that return image/jpg, etc. should be accessed using NSURLRequest
FBErrorNonTextMimeTypeReturned,
+ /// An error occurred while trying to display a native dialog
+ FBErrorNativeDialog,
} FBErrorCode;
/*!
@@ -98,6 +100,15 @@ extern NSString *const FBErrorReauthorizeFailedReasonSessionClosed;
extern NSString *const FBErrorReauthorizeFailedReasonUserCancelled;
extern NSString *const FBErrorReauthorizeFailedReasonWrongUser;
+/// The key to retrieve the reason for a native dialog error
+extern NSString *const FBErrorNativeDialogReasonKey;
+
+/// indicates that a native dialog is not supported in the current OS
+extern NSString *const FBErrorNativeDialogNotSupported;
+/// indicates that a native dialog can't be displayed because it is not appropriate for the current session
+extern NSString *const FBErrorNativeDialogInvalidForSession;
+/// indicates that a native dialog can't be displayed for some other reason
+extern NSString *const FBErrorNativeDialogCantBeDisplayed;
// Exception strings raised by the Facebook SDK
View
5 src/FBError.m
@@ -29,3 +29,8 @@
NSString *const FBErrorReauthorizeFailedReasonWrongUser = @"com.facebook.sdk:ErrorReauthorizeFailedReasonWrongUser";
NSString *const FBInvalidOperationException = @"com.facebook.sdk:InvalidOperationException";
+
+NSString *const FBErrorNativeDialogReasonKey = @"com.facebook.sdk:NativeDialogReasonKey";
+NSString *const FBErrorNativeDialogNotSupported = @"com.facebook.sdk:NativeDialogNotSupported";
+NSString *const FBErrorNativeDialogInvalidForSession = @"NativeDialogInvalidForSession";
+NSString *const FBErrorNativeDialogCantBeDisplayed = @"NativeDialogCantBeDisplayed";
View
104 src/FBNativeDialogs.h
@@ -19,28 +19,132 @@
@class FBSession;
+/*!
+ @typedef FBNativeDialogResult enum
+
+ @abstract
+ Passed to a handler to indicate the result of a dialog being displayed to the user.
+*/
typedef enum {
+ /*! Indicates that the dialog action completed successfully. */
FBNativeDialogResultSucceeded,
+ /*! Indicates that the dialog action was cancelled (either by the user or the system). */
FBNativeDialogResultCancelled,
+ /*! Indicates that the dialog action resulted in an error. */
FBNativeDialogResultError
} FBNativeDialogResult;
+/*!
+ @typedef
+
+ @abstract Defines a handler that will be called in response to the native share dialog
+ being displayed.
+ */
typedef void (^FBShareDialogHandler)(FBNativeDialogResult result, NSError *error);
+/*!
+ @class FBNativeDialogs
+
+ @abstract
+ Provides methods to display native (i.e., non-Web-based) dialogs to the user.
+ Currently the iOS 6 sharing dialog is supported.
+*/
@interface FBNativeDialogs : NSObject
+/*!
+ @abstract
+ Presents a dialog that allows the user to share a status update that may include
+ text, images, or URLs. This dialog is only available on iOS 6.0 and above. The
+ current active session returned by [FBSession activeSession] will be used to determine
+ whether the dialog will be displayed. If a session is active, it must be open and the
+ login method used to authenticate the user must be native iOS 6.0 authentication.
+ If no session active, then whether the call succeeds or not will depend on
+ whether Facebook integration has been configured.
+
+ @param viewController The view controller which will present the dialog.
+
+ @param initialText The text which will initially be populated in the dialog. The user
+ will have the opportunity to edit this text before posting it. May be nil.
+
+ @param image A UIImage that will be attached to the status update. May be nil.
+
+ @param url An NSURL that will be attached to the status update. May be nil.
+
+ @param handler A handler that will be called when the dialog is dismissed, or if an error
+ occurs. May be nil.
+
+ @return YES if the dialog was presented, NO if not (in the case of a NO result, the handler
+ will still be called, with an error indicating the reason the dialog was not displayed)
+ */
+ (BOOL)presentShareDialogModallyFrom:(UIViewController*)viewController
initialText:(NSString*)initialText
image:(UIImage*)image
url:(NSURL*)url
handler:(FBShareDialogHandler)handler;
+/*!
+ @abstract
+ Presents a dialog that allows the user to share a status update that may include
+ text, images, or URLs. This dialog is only available on iOS 6.0 and above. The
+ current active session returned by [FBSession activeSession] will be used to determine
+ whether the dialog will be displayed. If a session is active, it must be open and the
+ login method used to authenticate the user must be native iOS 6.0 authentication.
+ If no session active, then whether the call succeeds or not will depend on
+ whether Facebook integration has been configured.
+
+ @param viewController The view controller which will present the dialog.
+
+ @param initialText The text which will initially be populated in the dialog. The user
+ will have the opportunity to edit this text before posting it. May be nil.
+
+ @param images An array of UIImages that will be attached to the status update. May
+ be nil.
+
+ @param urls An array of NSURLs that will be attached to the status update. May be nil.
+
+ @param handler A handler that will be called when the dialog is dismissed, or if an error
+ occurs. May be nil.
+
+ @return YES if the dialog was presented, NO if not (in the case of a NO result, the handler
+ will still be called, with an error indicating the reason the dialog was not displayed)
+ */
+ (BOOL)presentShareDialogModallyFrom:(UIViewController*)viewController
initialText:(NSString*)initialText
images:(NSArray*)images
urls:(NSArray*)urls
handler:(FBShareDialogHandler)handler;
+/*!
+ @abstract
+ Presents a dialog that allows the user to share a status update that may include
+ text, images, or URLs. This dialog is only available on iOS 6.0 and above. An
+ <FBSession> may be specified, or nil may be passed to indicate that the current
+ active session should be used. If a session is specified (whether explicitly or by
+ virtue of being the active session), it must be open and the login method used to
+ authenticate the user must be native iOS 6.0 authentication. If no session is specified
+ (and there is no active session), then whether the call succeeds or not will depend on
+ whether Facebook integration has been configured.
+
+ @param viewController The view controller which will present the dialog.
+
+ @param session The <FBSession> to use to determine whether or not the user has been
+ authenticated with iOS native authentication. If nil, then [FBSession activeSession]
+ will be checked. See discussion above for the implications of nil or non-nil session.
+
+ @param initialText The text which will initially be populated in the dialog. The user
+ will have the opportunity to edit this text before posting it. May be nil.
+
+ @param images An array of UIImages that will be attached to the status update. May
+ be nil.
+
+ @param urls An array of NSURLs that will be attached to the status update. May be nil.
+
+ @param handler A handler that will be called when the dialog is dismissed, or if an error
+ occurs. May be nil.
+
+ @return YES if the dialog was presented, NO if not (in the case of a NO result, the handler
+ will still be called, with an error indicating the reason the dialog was not displayed)
+ */
+ (BOOL)presentShareDialogModallyFrom:(UIViewController*)viewController
session:(FBSession*)session
initialText:(NSString*)initialText
View
37 src/FBNativeDialogs.m
@@ -16,8 +16,15 @@
#import "FBNativeDialogs.h"
#import "FBSession.h"
+#import "FBError.h"
#import "Social/Social.h"
+@interface FBNativeDialogs ()
+
++ (NSError*)createError:(NSString*)reason;
+
+@end
+
@implementation FBNativeDialogs
+ (BOOL)presentShareDialogModallyFrom:(UIViewController*)viewController
@@ -58,30 +65,38 @@ + (BOOL)presentShareDialogModallyFrom:(UIViewController*)viewController
handler:(FBShareDialogHandler)handler {
// Can we even call the iOS API?
- Class composeViewControllerClass = NSClassFromString(@"SLComposeViewController");
+ Class composeViewControllerClass = [SLComposeViewController class];
if (composeViewControllerClass == nil ||
[composeViewControllerClass isAvailableForServiceType:SLServiceTypeFacebook] == NO) {
- // TODO call handler with error
+ if (handler) {
+ handler(FBNativeDialogResultError, [self createError:FBErrorNativeDialogNotSupported]);
+ }
return NO;
}
- if (session != nil) {
+ if (session == nil) {
// No session provided -- do we have an activeSession? We must either have a session that
// was authenticated with native auth, or no session at all (in which case the app is
// running unTOSed and we will rely on the OS to authenticate/TOS the user).
session = [FBSession activeSession];
}
if (session != nil) {
- // TODO: check that session is integrated auth and open, return NO otherwise
- if (!session.isOpen) {
- // TODO call handler with error
+ // If we have an open session and it's not native auth, fail. If the session is
+ // not open, attempting to put up the dialog will prompt the user to configure
+ // their account.
+ if (session.isOpen && session.loginType != FBSessionLoginTypeSystemAccount) {
+ if (handler) {
+ handler(FBNativeDialogResultError, [self createError:FBErrorNativeDialogInvalidForSession]);
+ }
return NO;
}
}
SLComposeViewController *composeViewController = [composeViewControllerClass composeViewControllerForServiceType:SLServiceTypeFacebook];
if (composeViewController == nil) {
- // TODO call handler with error
+ if (handler) {
+ handler(FBNativeDialogResultError, [self createError:FBErrorNativeDialogCantBeDisplayed]);
+ }
return NO;
}
@@ -109,4 +124,12 @@ + (BOOL)presentShareDialogModallyFrom:(UIViewController*)viewController
return YES;
}
++ (NSError*)createError:(NSString*)reason {
+ NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:reason, FBErrorNativeDialogReasonKey, nil];
+ NSError *error = [NSError errorWithDomain:FacebookSDKDomain
+ code:FBErrorNativeDialog
+ userInfo:userInfo];
+ return error;
+}
+
@end
View
1 src/FacebookSDK.h
@@ -41,6 +41,7 @@
#import "FBPlacePickerViewController.h"
#import "FBFriendPickerViewController.h"
#import "FBCacheDescriptor.h"
+#import "FBNativeDialogs.h"
/*!
@header
View
1 src/facebook-ios-sdk.xcodeproj/project.pbxproj
@@ -360,6 +360,7 @@
0867D69AFE84028FC02AAC07 /* Frameworks */ = {
isa = PBXGroup;
children = (
+ 85A928981611272D008699F1 /* Social.framework */,
845857A116096ED000CC89E5 /* Accounts.framework */,
85A928981611272D008699F1 /* Social.framework */,
B9CC137215266B9000443948 /* QuartzCore.framework */,

0 comments on commit 530bdc3

Please sign in to comment.