FacebookSDK.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*
  2. * Copyright 2010-present Facebook.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. // core
  17. #import "FBAccessTokenData.h"
  18. #import "FBAppCall.h"
  19. #import "FBAppEvents.h"
  20. #import "FBCacheDescriptor.h"
  21. #import "FBDialogs.h"
  22. #import "FBError.h"
  23. #import "FBErrorUtility.h"
  24. #import "FBFrictionlessRecipientCache.h"
  25. #import "FBFriendPickerViewController.h"
  26. #import "FBGraphLocation.h"
  27. #import "FBGraphObject.h" // + design summary for graph component-group
  28. #import "FBGraphPlace.h"
  29. #import "FBGraphUser.h"
  30. #import "FBInsights.h"
  31. #import "FBLikeControl.h"
  32. #import "FBLoginView.h"
  33. #import "FBNativeDialogs.h" // deprecated, use FBDialogs.h
  34. #import "FBOpenGraphAction.h"
  35. #import "FBOpenGraphActionShareDialogParams.h"
  36. #import "FBOpenGraphObject.h"
  37. #import "FBPlacePickerViewController.h"
  38. #import "FBProfilePictureView.h"
  39. #import "FBRequest.h"
  40. #import "FBSession.h"
  41. #import "FBSessionTokenCachingStrategy.h"
  42. #import "FBSettings.h"
  43. #import "FBShareDialogParams.h"
  44. #import "FBShareDialogPhotoParams.h"
  45. #import "FBTaggableFriendPickerViewController.h"
  46. #import "FBUserSettingsViewController.h"
  47. #import "FBWebDialogs.h"
  48. #import "NSError+FBError.h"
  49. /*!
  50. @header
  51. @abstract Library header, import this to import all of the public types
  52. in the Facebook SDK
  53. @discussion
  54. ////////////////////////////////////////////////////////////////////////////////
  55. Summary: this header summarizes the structure and goals of the Facebook SDK for iOS.
  56. Goals:
  57. * Leverage and work well with modern features of iOS (e.g. blocks, ARC, etc.)
  58. * Patterned after best of breed iOS frameworks (e.g. naming, pattern-use, etc.)
  59. * Common integration experience is simple & easy to describe
  60. * Factored to enable a growing list of scenarios over time
  61. Notes on approaches:
  62. 1. We use a key scenario to drive prioritization of work for a given update
  63. 2. We are building-atop and refactoring, rather than replacing, existing iOS SDK releases
  64. 3. We use take an incremental approach where we can choose to maintain as little or as much compatibility with the existing SDK needed
  65. a) and so we will be developing to this approach
  66. b) and then at push-time for a release we will decide when/what to break
  67. on a feature by feature basis
  68. 4. Some light but critical infrastructure is needed to support both the goals
  69. and the execution of this change (e.g. a build/package/deploy process)
  70. Design points:
  71. We will move to a more object-oriented approach, in order to facilitate the
  72. addition of a different class of objects, such as controls and visual helpers
  73. (e.g. FBLikeView, FBPersonView), as well as sub-frameworks to enable scenarios
  74. such (e.g. FBOpenGraphEntity, FBLocalEntityCache, etc.)
  75. As we add features, it will no longer be appropriate to host all functionality
  76. in the Facebook class, though it will be maintained for some time for migration
  77. purposes. Instead functionality lives in related collections of classes.
  78. <pre>
  79. @textblock
  80. *------------* *----------* *----------------* *---*
  81. Scenario --> |FBPersonView| |FBLikeView| | FBPlacePicker | | F |
  82. *------------* *----------* *----------------* | a |
  83. *-------------------* *----------* *--------* | c |
  84. Component --> | FBGraphObject | | FBDialog | | FBView | | e |
  85. *-------------------* *----------* *--------* | b |
  86. *---------* *---------* *---------------------* | o |
  87. Core --> |FBSession| |FBRequest| |Utilities (e.g. JSON)| | o |
  88. *---------* *---------* *---------------------* * k *
  89. @/textblock
  90. </pre>
  91. The figure above describes three layers of functionality, with the existing
  92. Facebook on the side as a helper proxy to a subset of the overall SDK. The
  93. layers loosely organize the SDK into *Core Objects* necessary to interface
  94. with Facebook, higher-level *Framework Components* that feel like natural
  95. extensions to existing frameworks such as UIKit and Foundation, but which
  96. surface behavior broadly applicable to Facebook, and finally the
  97. *Scenario Objects*, which provide deeper turn-key capibilities for useful
  98. mobile scenarios.
  99. Use example (low barrier use case):
  100. <pre>
  101. @textblock
  102. // log on to Facebook
  103. [FBSession sessionOpenWithPermissions:nil
  104. completionHandler:^(FBSession *session,
  105. FBSessionState status,
  106. NSError *error) {
  107. if (session.isOpen) {
  108. // request basic information for the user
  109. [FBRequestConnection startWithGraphPath:@"me"
  110. completionHandler:^void(FBRequestConnection *request,
  111. id result,
  112. NSError *error) {
  113. if (!error) {
  114. // get json from result
  115. }
  116. }];
  117. }
  118. }];
  119. @/textblock
  120. </pre>
  121. */
  122. #define FB_IOS_SDK_VERSION_STRING @"3.18"
  123. #define FB_IOS_SDK_TARGET_PLATFORM_VERSION @"v2.1"