diff --git a/FacebookSDK.framework/FacebookSDK b/FacebookSDK.framework/FacebookSDK new file mode 120000 index 0000000..77d5d31 --- /dev/null +++ b/FacebookSDK.framework/FacebookSDK @@ -0,0 +1 @@ +./Versions/A/FacebookSDK \ No newline at end of file diff --git a/FacebookSDK.framework/Headers b/FacebookSDK.framework/Headers new file mode 120000 index 0000000..b0cc393 --- /dev/null +++ b/FacebookSDK.framework/Headers @@ -0,0 +1 @@ +./Versions/A/Headers \ No newline at end of file diff --git a/FacebookSDK.framework/Resources b/FacebookSDK.framework/Resources new file mode 120000 index 0000000..3afb717 --- /dev/null +++ b/FacebookSDK.framework/Resources @@ -0,0 +1 @@ +./Versions/A/Resources \ No newline at end of file diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAccessTokenData.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAccessTokenData.h new file mode 100755 index 0000000..9ab0c28 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAccessTokenData.h @@ -0,0 +1,140 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSession.h" + +/*! + @class FBAccessTokenData + + @abstract Represents an access token used for the Facebook login flow + and includes associated metadata such as expiration date and permissions. + You should use factory methods (createToken...) to construct instances + and should be treated as immutable. + + @discussion For more information, see + https://developers.facebook.com/docs/concepts/login/access-tokens-and-types/. + */ +@interface FBAccessTokenData : NSObject + +/*! + @method + + @abstract Creates an FBAccessTokenData from an App Link provided by the Facebook application + or nil if the url is not valid. + + @param url The url provided. + @param appID needed in order to verify URL format. + @param urlSchemeSuffix needed in order to verify URL format. + + */ ++ (FBAccessTokenData *)createTokenFromFacebookURL:(NSURL *)url appID:(NSString *)appID urlSchemeSuffix:(NSString *)urlSchemeSuffix; + +/*! + @method + + @abstract Creates an FBAccessTokenData from a dictionary or returns nil if required data is missing. + @param dictionary the dictionary with FBSessionTokenCachingStrategy keys. + */ ++ (FBAccessTokenData *)createTokenFromDictionary:(NSDictionary *)dictionary; + +/*! + @method + + @abstract Creates an FBAccessTokenData from existing information or returns nil if required data is missing. + + @param accessToken The token string. If nil or empty, this method will return nil. + @param permissions The permissions set. A value of nil indicates basic permissions. + @param expirationDate The expiration date. A value of nil defaults to `[NSDate distantFuture]`. + @param loginType The login source of the token. + @param refreshDate The date that token was last refreshed. A value of nil defaults to `[NSDate date]`. + */ ++ (FBAccessTokenData *)createTokenFromString:(NSString *)accessToken + permissions:(NSArray *)permissions + expirationDate:(NSDate *)expirationDate + loginType:(FBSessionLoginType)loginType + refreshDate:(NSDate *)refreshDate; + +/*! + @method + + @abstract Creates an FBAccessTokenData from existing information or returns nil if required data is missing. + + @param accessToken The token string. If nil or empty, this method will return nil. + @param permissions The permissions set. A value of nil indicates basic permissions. + @param expirationDate The expiration date. A value of nil defaults to `[NSDate distantFuture]`. + @param loginType The login source of the token. + @param refreshDate The date that token was last refreshed. A value of nil defaults to `[NSDate date]`. + @param permissionsRefreshDate The date the permissions were last refreshed. A value of nil defaults to `[NSDate distantPast]`. + */ ++ (FBAccessTokenData *)createTokenFromString:(NSString *)accessToken + permissions:(NSArray *)permissions + expirationDate:(NSDate *)expirationDate + loginType:(FBSessionLoginType)loginType + refreshDate:(NSDate *)refreshDate + permissionsRefreshDate:(NSDate *)permissionsRefreshDate; + +/*! + @method + + @abstract Returns a dictionary representation of this instance. + + @discussion This is provided for backwards compatibility with previous + access token related APIs that used a NSDictionary (see `FBSessionTokenCachingStrategy`). + */ +- (NSMutableDictionary *)dictionary; + +/*! + @method + + @abstract Returns a Boolean value that indicates whether a given object is an FBAccessTokenData object and exactly equal the receiver. + + @param accessTokenData the data to compare to the receiver. + */ +- (BOOL)isEqualToAccessTokenData:(FBAccessTokenData *)accessTokenData; + +/*! + @abstract returns the access token NSString. + */ +@property (readonly, nonatomic, copy) NSString *accessToken; + +/*! + @abstract returns the permissions associated with the access token. + */ +@property (readonly, nonatomic, copy) NSArray *permissions; + +/*! + @abstract returns the expiration date of the access token. + */ +@property (readonly, nonatomic, copy) NSDate *expirationDate; + +/*! + @abstract returns the login type associated with the token. + */ +@property (readonly, nonatomic) FBSessionLoginType loginType; + +/*! + @abstract returns the date the token was last refreshed. + */ +@property (readonly, nonatomic, copy) NSDate *refreshDate; + +/*! + @abstract returns the date the permissions were last refreshed. + */ +@property (readonly, nonatomic, copy) NSDate *permissionsRefreshDate; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppCall.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppCall.h new file mode 100755 index 0000000..e741bad --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppCall.h @@ -0,0 +1,232 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBAccessTokenData.h" +#import "FBAppLinkData.h" +#import "FBDialogsData.h" +#import "FBSession.h" + +@class FBAppCall; + +/*! + @typedef FBAppCallHandler + + @abstract + A block that is passed to performAppCall to register for a callback with the results + of that AppCall + + @discussion + Pass a block of this type when calling performAppCall. This will be called on the UI + thread, once the AppCall completes. + + @param call The `FBAppCall` that was completed. + + */ +typedef void (^FBAppCallHandler)(FBAppCall *call); + +/*! + @typedef FBAppLinkFallbackHandler + + @abstract + See `+openDeferredAppLink`. + */ +typedef void (^FBAppLinkFallbackHandler)(NSError *error); + +/*! + @class FBAppCall + + @abstract + The FBAppCall object is used to encapsulate state when the app performs an + action that requires switching over to the native Facebook app, or when the app + receives an App Link. + + @discussion + - Each FBAppCall instance will have a unique ID + - This object is passed into an FBAppCallHandler for context + - dialogData will be present if this AppCall is for a Native Dialog + - appLinkData will be present if this AppCall is for an App Link + - accessTokenData will be present if this AppCall contains an access token. + */ +@interface FBAppCall : NSObject + +/*! @abstract The ID of this FBAppCall instance */ +@property (nonatomic, readonly) NSString *ID; + +/*! @abstract Error that occurred in processing this AppCall */ +@property (nonatomic, readonly) NSError *error; + +/*! @abstract Data related to a Dialog AppCall */ +@property (nonatomic, readonly) FBDialogsData *dialogData; + +/*! @abstract Data for native app link */ +@property (nonatomic, readonly) FBAppLinkData *appLinkData; + +/*! @abstract Access Token that was returned in this AppCall */ +@property (nonatomic, readonly) FBAccessTokenData *accessTokenData; + +/*! + @abstract + Returns an FBAppCall instance from a url, if applicable. Otherwise, returns nil. + + @param url The url. + + @return an FBAppCall instance if the url is valid; nil otherwise. + + @discussion This is typically used for App Link URLs. + */ ++ (FBAppCall *)appCallFromURL:(NSURL *)url; + +/*! + @abstract + Compares the receiving FBAppCall to the passed in FBAppCall + + @param appCall the other FBAppCall to compare to. + + @return YES if the AppCalls can be considered to be the same; NO if otherwise. + */ +- (BOOL)isEqualToAppCall:(FBAppCall *)appCall; + +/*! + @abstract + Call this method from the [UIApplicationDelegate application:openURL:sourceApplication:annotation:] method + of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction + with the native Facebook app or as part of SSO authorization flow. + + @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param sourceApplication The sourceApplication as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @return YES if the url was intended for the Facebook SDK, NO if not. + */ ++ (BOOL)handleOpenURL:(NSURL *)url + sourceApplication:(NSString *)sourceApplication; + +/*! + @abstract + Call this method from the [UIApplicationDelegate application:openURL:sourceApplication:annotation:] method + of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction + with the native Facebook app or as part of SSO authorization flow. + + @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param sourceApplication The sourceApplication as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param handler Optional handler that gives the app the opportunity to do some further processing on urls + that the SDK could not completely process. A fallback handler is not a requirement for such a url to be considered + handled. The fallback handler, if specified, is only ever called sychronously, before the method returns. + + @return YES if the url was intended for the Facebook SDK, NO if not. + */ ++ (BOOL)handleOpenURL:(NSURL *)url + sourceApplication:(NSString *)sourceApplication + fallbackHandler:(FBAppCallHandler)handler; + +/*! + @abstract + Call this method from the [UIApplicationDelegate application:openURL:sourceApplication:annotation:] method + of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction + with the native Facebook app or as part of SSO authorization flow. + + @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param sourceApplication The sourceApplication as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param session If this url is being sent back to this app as part of SSO authorization flow, then pass in the + session that was being opened. A nil value defaults to FBSession.activeSession + + @return YES if the url was intended for the Facebook SDK, NO if not. + */ ++ (BOOL)handleOpenURL:(NSURL *)url + sourceApplication:(NSString *)sourceApplication + withSession:(FBSession *)session; + +/*! + @abstract + Call this method from the [UIApplicationDelegate application:openURL:sourceApplication:annotation:] method + of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction + with the native Facebook app or as part of SSO authorization flow. + + @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param sourceApplication The sourceApplication as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param session If this url is being sent back to this app as part of SSO authorization flow, then pass in the + session that was being opened. A nil value defaults to FBSession.activeSession + + @param handler Optional handler that gives the app the opportunity to do some further processing on urls + that the SDK could not completely process. A fallback handler is not a requirement for such a url to be considered + handled. The fallback handler, if specified, is only ever called sychronously, before the method returns. + + @return YES if the url was intended for the Facebook SDK, NO if not. + */ ++ (BOOL)handleOpenURL:(NSURL *)url + sourceApplication:(NSString *)sourceApplication + withSession:(FBSession *)session + fallbackHandler:(FBAppCallHandler)handler; + +/*! + @abstract + Call this method when the application's applicationDidBecomeActive: is invoked. + This ensures proper state management of any pending FBAppCalls or pending login flow for the + FBSession.activeSession. If any pending FBAppCalls are found, their registered callbacks + will be invoked with appropriate state + */ ++ (void)handleDidBecomeActive; + +/*! + @abstract + Call this method when the application's applicationDidBecomeActive: is invoked. + This ensures proper state management of any pending FBAppCalls or a pending open for the + passed in FBSession. If any pending FBAppCalls are found, their registered callbacks will + be invoked with appropriate state + + @param session Session that is currently being used. Any pending calls to open will be cancelled. + If no session is provided, then the activeSession (if present) is used. + */ ++ (void)handleDidBecomeActiveWithSession:(FBSession *)session; + +/*! + @abstract + Call this method from the main thread to fetch deferred applink data. This may require + a network round trip. If successful, [+UIApplication openURL:] is invoked with the link + data. Otherwise, the fallbackHandler will be dispatched to the main thread. + + @param fallbackHandler the handler to be invoked if applink data could not be opened. + + @discussion the fallbackHandler may contain an NSError instance to capture any errors. In the + common case where there simply was no app link data, the NSError instance will be nil. + + This method should only be called from a location that occurs after any launching URL has + been processed (e.g., you should call this method from your application delegate's applicationDidBecomeActive:) + to avoid duplicate invocations of openURL:. + + If you must call this from the delegate's didFinishLaunchingWithOptions: you should + only do so if the application is not being launched by a URL. For example, + + if (launchOptions[UIApplicationLaunchOptionsURLKey] == nil) { + [FBAppCall openDeferredAppLink:^(NSError *error) { + // .... + } + } + */ ++ (void)openDeferredAppLink:(FBAppLinkFallbackHandler)fallbackHandler; + +@end + + + diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppEvents.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppEvents.h new file mode 100755 index 0000000..d4cb649 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppEvents.h @@ -0,0 +1,452 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSDKMacros.h" +#import "FBSession.h" + +/*! + + @typedef NS_ENUM (NSUInteger, FBAppEventsFlushBehavior) + + @abstract + Control when sends log events to the server + + @discussion + + */ +typedef NS_ENUM(NSUInteger, FBAppEventsFlushBehavior) { + + /*! Flush automatically: periodically (once a minute or every 100 logged events) and always at app reactivation. */ + FBAppEventsFlushBehaviorAuto = 0, + + /*! Only flush when the `flush` method is called. When an app is moved to background/terminated, the + events are persisted and re-established at activation, but they will only be written with an + explicit call to `flush`. */ + FBAppEventsFlushBehaviorExplicitOnly, + +}; + +/* + * Constant used by NSNotificationCenter for results of flushing AppEvents event logs + */ + +/*! NSNotificationCenter name indicating a result of a failed log flush attempt */ +FBSDK_EXTERN NSString *const FBAppEventsLoggingResultNotification; + + +// Predefined event names for logging events common to many apps. Logging occurs through the `logEvent` family of methods on `FBAppEvents`. +// Common event parameters are provided in the `FBAppEventsParameterNames*` constants. + +// General purpose + +/*! Log this event when an app is being activated, typically in the AppDelegate's applicationDidBecomeActive. */ +FBSDK_EXTERN NSString *const FBAppEventNameActivatedApp; + +/*! Log this event when a user has completed registration with the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameCompletedRegistration; + +/*! Log this event when a user has viewed a form of content in the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameViewedContent; + +/*! Log this event when a user has performed a search within the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameSearched; + +/*! Log this event when the user has rated an item in the app. The valueToSum passed to logEvent should be the numeric rating. */ +FBSDK_EXTERN NSString *const FBAppEventNameRated; + +/*! Log this event when the user has completed a tutorial in the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameCompletedTutorial; + +// Ecommerce related + +/*! Log this event when the user has added an item to their cart. The valueToSum passed to logEvent should be the item's price. */ +FBSDK_EXTERN NSString *const FBAppEventNameAddedToCart; + +/*! Log this event when the user has added an item to their wishlist. The valueToSum passed to logEvent should be the item's price. */ +FBSDK_EXTERN NSString *const FBAppEventNameAddedToWishlist; + +/*! Log this event when the user has entered the checkout process. The valueToSum passed to logEvent should be the total price in the cart. */ +FBSDK_EXTERN NSString *const FBAppEventNameInitiatedCheckout; + +/*! Log this event when the user has entered their payment info. */ +FBSDK_EXTERN NSString *const FBAppEventNameAddedPaymentInfo; + +/*! Log this event when the user has completed a purchase. The `[FBAppEvents logPurchase]` method is a shortcut for logging this event. */ +FBSDK_EXTERN NSString *const FBAppEventNamePurchased; + +// Gaming related + +/*! Log this event when the user has achieved a level in the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameAchievedLevel; + +/*! Log this event when the user has unlocked an achievement in the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameUnlockedAchievement; + +/*! Log this event when the user has spent app credits. The valueToSum passed to logEvent should be the number of credits spent. */ +FBSDK_EXTERN NSString *const FBAppEventNameSpentCredits; + + + +// Predefined event name parameters for common additional information to accompany events logged through the `logEvent` family +// of methods on `FBAppEvents`. Common event names are provided in the `FBAppEventName*` constants. + +/*! Parameter key used to specify currency used with logged event. E.g. "USD", "EUR", "GBP". See ISO-4217 for specific values. One reference for these is . */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameCurrency; + +/*! Parameter key used to specify method user has used to register for the app, e.g., "Facebook", "email", "Twitter", etc */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameRegistrationMethod; + +/*! Parameter key used to specify a generic content type/family for the logged event, e.g. "music", "photo", "video". Options to use will vary based upon what the app is all about. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameContentType; + +/*! Parameter key used to specify an ID for the specific piece of content being logged about. Could be an EAN, article identifier, etc., depending on the nature of the app. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameContentID; + +/*! Parameter key used to specify the string provided by the user for a search operation. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameSearchString; + +/*! Parameter key used to specify whether the activity being logged about was successful or not. `FBAppEventParameterValueYes` and `FBAppEventParameterValueNo` are good canonical values to use for this parameter. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameSuccess; + +/*! Parameter key used to specify the maximum rating available for the `FBAppEventNameRate` event. E.g., "5" or "10". */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameMaxRatingValue; + +/*! Parameter key used to specify whether payment info is available for the `FBAppEventNameInitiatedCheckout` event. `FBAppEventParameterValueYes` and `FBAppEventParameterValueNo` are good canonical values to use for this parameter. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNamePaymentInfoAvailable; + +/*! Parameter key used to specify how many items are being processed for an `FBAppEventNameInitiatedCheckout` or `FBAppEventNamePurchased` event. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameNumItems; + +/*! Parameter key used to specify the level achieved in a `FBAppEventNameAchieved` event. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameLevel; + +/*! Parameter key used to specify a description appropriate to the event being logged. E.g., the name of the achievement unlocked in the `FBAppEventNameAchievementUnlocked` event. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameDescription; + + + +// Predefined values to assign to event parameters that accompany events logged through the `logEvent` family +// of methods on `FBAppEvents`. Common event parameters are provided in the `FBAppEventParameterName*` constants. + +/*! Yes-valued parameter value to be used with parameter keys that need a Yes/No value */ +FBSDK_EXTERN NSString *const FBAppEventParameterValueYes; + +/*! No-valued parameter value to be used with parameter keys that need a Yes/No value */ +FBSDK_EXTERN NSString *const FBAppEventParameterValueNo; + + +/*! + + @class FBAppEvents + + @abstract + Client-side event logging for specialized application analytics available through Facebook App Insights + and for use with Facebook Ads conversion tracking and optimization. + + @discussion + The `FBAppEvents` static class has a few related roles: + + + Logging predefined and application-defined events to Facebook App Insights with a + numeric value to sum across a large number of events, and an optional set of key/value + parameters that define "segments" for this event (e.g., 'purchaserStatus' : 'frequent', or + 'gamerLevel' : 'intermediate') + + + Logging events to later be used for ads optimization around lifetime value. + + + Methods that control the way in which events are flushed out to the Facebook servers. + + Here are some important characteristics of the logging mechanism provided by `FBAppEvents`: + + + Events are not sent immediately when logged. They're cached and flushed out to the Facebook servers + in a number of situations: + - when an event count threshold is passed (currently 100 logged events). + - when a time threshold is passed (currently 60 seconds). + - when an app has gone to background and is then brought back to the foreground. + + + Events will be accumulated when the app is in a disconnected state, and sent when the connection is + restored and one of the above 'flush' conditions are met. + + + The `FBAppEvents` class in thread-safe in that events may be logged from any of the app's threads. + + + The developer can set the `flushBehavior` on `FBAppEvents` to force the flushing of events to only + occur on an explicit call to the `flush` method. + + + The developer can turn on console debug output for event logging and flushing to the server by using + the `FBLoggingBehaviorAppEvents` value in `[FBSettings setLoggingBehavior:]`. + + Some things to note when logging events: + + + There is a limit on the number of unique event names an app can use, on the order of 300. + + There is a limit to the number of unique parameter names in the provided parameters that can + be used per event, on the order of 25. This is not just for an individual call, but for all + invocations for that eventName. + + Event names and parameter names (the keys in the NSDictionary) must be between 2 and 40 characters, and + must consist of alphanumeric characters, _, -, or spaces. + + The length of each parameter value can be no more than on the order of 100 characters. + + */ +@interface FBAppEvents : NSObject + +/* + * Basic event logging + */ + +/*! + + @method + + @abstract + Log an event with just an eventName. + + @param eventName The name of the event to record. Limitations on number of events and name length + are given in the `FBAppEvents` documentation. + + */ ++ (void)logEvent:(NSString *)eventName; + +/*! + + @method + + @abstract + Log an event with an eventName and a numeric value to be aggregated with other events of this name. + + @param eventName The name of the event to record. Limitations on number of events and name length + are given in the `FBAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. + + @param valueToSum Amount to be aggregated into all events of this eventName, and App Insights will report + the cumulative and average value of this amount. + */ ++ (void)logEvent:(NSString *)eventName + valueToSum:(double)valueToSum; + + +/*! + + @method + + @abstract + Log an event with an eventName and a set of key/value pairs in the parameters dictionary. + Parameter limitations are described above. + + @param eventName The name of the event to record. Limitations on number of events and name construction + are given in the `FBAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBAppEvents` documentation. Commonly used parameter names + are provided in `FBAppEventParameterName*` constants. + */ ++ (void)logEvent:(NSString *)eventName + parameters:(NSDictionary *)parameters; + +/*! + + @method + + @abstract + Log an event with an eventName, a numeric value to be aggregated with other events of this name, + and a set of key/value pairs in the parameters dictionary. + + @param eventName The name of the event to record. Limitations on number of events and name construction + are given in the `FBAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. + + @param valueToSum Amount to be aggregated into all events of this eventName, and App Insights will report + the cumulative and average value of this amount. + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBAppEvents` documentation. Commonly used parameter names + are provided in `FBAppEventParameterName*` constants. + + */ ++ (void)logEvent:(NSString *)eventName + valueToSum:(double)valueToSum + parameters:(NSDictionary *)parameters; + + +/*! + + @method + + @abstract + Log an event with an eventName, a numeric value to be aggregated with other events of this name, + and a set of key/value pairs in the parameters dictionary. Providing session lets the developer + target a particular . If nil is provided, then `[FBSession activeSession]` will be used. + + @param eventName The name of the event to record. Limitations on number of events and name construction + are given in the `FBAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. + + @param valueToSum Amount to be aggregated into all events of this eventName, and App Insights will report + the cumulative and average value of this amount. Note that this is an NSNumber, and a value of `nil` denotes + that this event doesn't have a value associated with it for summation. + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBAppEvents` documentation. Commonly used parameter names + are provided in `FBAppEventParameterName*` constants. + + @param session to direct the event logging to, and thus be logged with whatever user (if any) + is associated with that . + */ ++ (void)logEvent:(NSString *)eventName + valueToSum:(NSNumber *)valueToSum + parameters:(NSDictionary *)parameters + session:(FBSession *)session; + + +/* + * Purchase logging + */ + +/*! + + @method + + @abstract + Log a purchase of the specified amount, in the specified currency. + + @param purchaseAmount Purchase amount to be logged, as expressed in the specified currency. This value + will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346). + + @param currency Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for + specific values. One reference for these is . + + @discussion This event immediately triggers a flush of the `FBAppEvents` event queue, unless the `flushBehavior` is set + to `FBAppEventsFlushBehaviorExplicitOnly`. + + */ ++ (void)logPurchase:(double)purchaseAmount + currency:(NSString *)currency; + +/*! + + @method + + @abstract + Log a purchase of the specified amount, in the specified currency, also providing a set of + additional characteristics describing the purchase. + + @param purchaseAmount Purchase amount to be logged, as expressed in the specified currency.This value + will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346). + + @param currency Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for + specific values. One reference for these is . + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBAppEvents` documentation. Commonly used parameter names + are provided in `FBAppEventParameterName*` constants. + + @discussion This event immediately triggers a flush of the `FBAppEvents` event queue, unless the `flushBehavior` is set + to `FBAppEventsFlushBehaviorExplicitOnly`. + + */ ++ (void)logPurchase:(double)purchaseAmount + currency:(NSString *)currency + parameters:(NSDictionary *)parameters; + +/*! + + @method + + @abstract + Log a purchase of the specified amount, in the specified currency, also providing a set of + additional characteristics describing the purchase, as well as an to log to. + + @param purchaseAmount Purchase amount to be logged, as expressed in the specified currency.This value + will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346). + + @param currency Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for + specific values. One reference for these is . + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBAppEvents` documentation. Commonly used parameter names + are provided in `FBAppEventParameterName*` constants. + + @param session to direct the event logging to, and thus be logged with whatever user (if any) + is associated with that . A value of `nil` will use `[FBSession activeSession]`. + + @discussion This event immediately triggers a flush of the `FBAppEvents` event queue, unless the `flushBehavior` is set + to `FBAppEventsFlushBehaviorExplicitOnly`. + + */ ++ (void)logPurchase:(double)purchaseAmount + currency:(NSString *)currency + parameters:(NSDictionary *)parameters + session:(FBSession *)session; + +/*! + @method + + @abstract This method has been replaced by [FBSettings limitEventAndDataUsage] */ ++ (BOOL)limitEventUsage __attribute__ ((deprecated("use [FBSettings limitEventAndDataUsage] instead"))); + +/*! + @method + + @abstract This method has been replaced by [FBSettings setLimitEventUsage] */ ++ (void)setLimitEventUsage:(BOOL)limitEventUsage __attribute__ ((deprecated("use [FBSettings setLimitEventAndDataUsage] instead"))); + +/*! + + @method + + @abstract + Notifies the events system that the app has launched & logs an activatedApp event. Should typically be placed in the app delegates' `applicationDidBecomeActive:` method. + */ ++ (void)activateApp; + +/* + * Control over event batching/flushing + */ + +/*! + + @method + + @abstract + Get the current event flushing behavior specifying when events are sent back to Facebook servers. + */ ++ (FBAppEventsFlushBehavior)flushBehavior; + +/*! + + @method + + @abstract + Set the current event flushing behavior specifying when events are sent back to Facebook servers. + + @param flushBehavior The desired `FBAppEventsFlushBehavior` to be used. + */ ++ (void)setFlushBehavior:(FBAppEventsFlushBehavior)flushBehavior; + + +/*! + + @method + + @abstract + Explicitly kick off flushing of events to Facebook. This is an asynchronous method, but it does initiate an immediate + kick off. Server failures will be reported through the NotificationCenter with notification ID `FBAppEventsLoggingResultNotification`. + */ ++ (void)flush; + + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppLinkData.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppLinkData.h new file mode 100755 index 0000000..dfdcd2e --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppLinkData.h @@ -0,0 +1,51 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/*! + @abstract This class contains information that represents an App Link from Facebook. + */ +@interface FBAppLinkData : NSObject + +/*! @abstract The target */ +@property (readonly) NSURL *targetURL; + +/*! @abstract List of the types of actions for this target */ +@property (readonly) NSArray *actionTypes; + +/*! @abstract List of the ids of the actions for this target */ +@property (readonly) NSArray *actionIDs; + +/*! @abstract Reference breadcrumb provided during creation of story */ +@property (readonly) NSString *ref; + +/*! @abstract User Agent string set by the referer */ +@property (readonly) NSString *userAgent; + +/*! @abstract Referer data is a JSON object set by the referer with referer-specific content */ +@property (readonly) NSDictionary *refererData; + +/*! @abstract Full set of query parameters for this app link */ +@property (readonly) NSDictionary *originalQueryParameters; + +/*! @abstract Original url from which applinkData was extracted */ +@property (readonly) NSURL *originalURL; + +/*! @abstract Addtional arguments supplied with the App Link data. */ +@property (readonly) NSDictionary *arguments; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppLinkResolver.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppLinkResolver.h new file mode 100755 index 0000000..570be4a --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppLinkResolver.h @@ -0,0 +1,51 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import + +/*! + @class FBAppLinkResolver + + @abstract + Provides an implementation of the BFAppLinkResolving protocol that uses the Facebook app link + index to resolve App Links given a URL. It also provides an additional helper method that can resolve + multiple App Links in a single call. + + @discussion + Usage of this type requires a client token. See `[FBSettings setClientToken:]`. + */ +@interface FBAppLinkResolver : NSObject + +/*! + @abstract Asynchronously resolves App Link data for multiple URLs. + + @param urls An array of NSURLs to resolve into App Links. + @returns A BFTask that will return dictionary mapping input NSURLs to their + corresponding BFAppLink. + + @discussion + You should set the client token before making this call. See `[FBSettings setClientToken:]` + */ +- (BFTask *)appLinksFromURLsInBackground:(NSArray *)urls; + +/*! + @abstract Allocates and initializes a new instance of FBAppLinkResolver. + */ ++ (instancetype)resolver; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBCacheDescriptor.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBCacheDescriptor.h new file mode 100755 index 0000000..2cea86e --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBCacheDescriptor.h @@ -0,0 +1,43 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSession.h" + +/*! + @class + + @abstract + Base class from which CacheDescriptors derive, provides a method to fetch data for later use + + @discussion + Cache descriptors allow your application to specify the arguments that will be + later used with another object, such as the FBFriendPickerViewController. By using a cache descriptor + instance, an application can choose to fetch data ahead of the point in time where the data is needed. + */ +@interface FBCacheDescriptor : NSObject + +/*! + @method + @abstract + Fetches and caches the data described by the cache descriptor instance, for the given session. + + @param session the to use for fetching data + */ +- (void)prefetchAndCacheForSession:(FBSession *)session; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBColor.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBColor.h new file mode 100755 index 0000000..2c461f1 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBColor.h @@ -0,0 +1,20 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +UIColor *FBUIColorWithRGBA(uint8_t r, uint8_t g, uint8_t b, CGFloat a); +UIColor *FBUIColorWithRGB(uint8_t r, uint8_t g, uint8_t b); diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBConnect.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBConnect.h new file mode 100755 index 0000000..2d688e9 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBConnect.h @@ -0,0 +1,21 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#include "FBDialog.h" +#include "FBLoginDialog.h" +#include "FBRequest.h" +#include "Facebook.h" diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialog.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialog.h new file mode 100755 index 0000000..d44a138 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialog.h @@ -0,0 +1,165 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +@protocol FBDialogDelegate; +@class FBFrictionlessRequestSettings; + +/** + * Do not use this interface directly, instead, use dialog in Facebook.h + * + * Facebook dialog interface for start the facebook webView UIServer Dialog. + */ + +@interface FBDialog : UIView { + id _delegate; + NSMutableDictionary *_params; + NSString *_serverURL; + NSURL *_loadingURL; + UIWebView *_webView; + UIActivityIndicatorView *_spinner; + UIButton *_closeButton; + UIInterfaceOrientation _orientation; + BOOL _showingKeyboard; + BOOL _isViewInvisible; + FBFrictionlessRequestSettings *_frictionlessSettings; + + // Ensures that UI elements behind the dialog are disabled. + UIView *_modalBackgroundView; +} + +/** + * The delegate. + */ +@property (nonatomic, assign) id delegate; + +/** + * The parameters. + */ +@property (nonatomic, retain) NSMutableDictionary *params; + +- (NSString *)getStringFromUrl:(NSString *)url needle:(NSString *)needle; + +- (id) initWithURL:(NSString *)loadingURL + params:(NSMutableDictionary *)params + isViewInvisible:(BOOL)isViewInvisible + frictionlessSettings:(FBFrictionlessRequestSettings *)frictionlessSettings + delegate:(id)delegate; + +/** + * Displays the view with an animation. + * + * The view will be added to the top of the current key window. + */ +- (void)show; + +/** + * Displays the first page of the dialog. + * + * Do not ever call this directly. It is intended to be overriden by subclasses. + */ +- (void)load; + +/** + * Displays a URL in the dialog. + */ +- (void)loadURL:(NSString *)url + get:(NSDictionary *)getParams; + +/** + * Hides the view and notifies delegates of success or cancellation. + */ +- (void)dismissWithSuccess:(BOOL)success animated:(BOOL)animated; + +/** + * Hides the view and notifies delegates of an error. + */ +- (void)dismissWithError:(NSError *)error animated:(BOOL)animated; + +/** + * Subclasses may override to perform actions just prior to showing the dialog. + */ +- (void)dialogWillAppear; + +/** + * Subclasses may override to perform actions just after the dialog is hidden. + */ +- (void)dialogWillDisappear; + +/** + * Subclasses should override to process data returned from the server in a 'fbconnect' url. + * + * Implementations must call dismissWithSuccess:YES at some point to hide the dialog. + */ +- (void)dialogDidSucceed:(NSURL *)url; + +/** + * Subclasses should override to process data returned from the server in a 'fbconnect' url. + * + * Implementations must call dismissWithSuccess:YES at some point to hide the dialog. + */ +- (void)dialogDidCancel:(NSURL *)url; +@end + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +/* + *Your application should implement this delegate + */ +@protocol FBDialogDelegate + +@optional + +/** + * Called when the dialog succeeds and is about to be dismissed. + */ +- (void)dialogDidComplete:(FBDialog *)dialog; + +/** + * Called when the dialog succeeds with a returning url. + */ +- (void)dialogCompleteWithUrl:(NSURL *)url; + +/** + * Called when the dialog get canceled by the user. + */ +- (void)dialogDidNotCompleteWithUrl:(NSURL *)url; + +/** + * Called when the dialog is cancelled and is about to be dismissed. + */ +- (void)dialogDidNotComplete:(FBDialog *)dialog; + +/** + * Called when dialog failed to load due to an error. + */ +- (void)dialog:(FBDialog *)dialog didFailWithError:(NSError *)error; + +/** + * Asks if a link touched by a user should be opened in an external browser. + * + * If a user touches a link, the default behavior is to open the link in the Safari browser, + * which will cause your app to quit. You may want to prevent this from happening, open the link + * in your own internal browser, or perhaps warn the user that they are about to leave your app. + * If so, implement this method on your delegate and return NO. If you warn the user, you + * should hold onto the URL and once you have received their acknowledgement open the URL yourself + * using [[UIApplication sharedApplication] openURL:]. + */ +- (BOOL)dialog:(FBDialog *)dialog shouldOpenURLInExternalBrowser:(NSURL *)url; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogs.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogs.h new file mode 100755 index 0000000..cb93d6d --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogs.h @@ -0,0 +1,996 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBAppCall.h" +#import "FBLinkShareParams.h" +#import "FBOpenGraphActionParams.h" +#import "FBPhotoParams.h" + +@class FBSession; +@protocol FBOpenGraphAction; + +/*! + @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. */ + FBOSIntegratedShareDialogResultSucceeded = 0, + /*! Indicates that the dialog action was cancelled (either by the user or the system). */ + FBOSIntegratedShareDialogResultCancelled = 1, + /*! Indicates that the dialog could not be shown (because not on ios6 or ios6 auth was not used). */ + FBOSIntegratedShareDialogResultError = 2 +} FBOSIntegratedShareDialogResult; + +/*! + @typedef + + @abstract Defines a handler that will be called in response to the native share dialog + being displayed. + */ +typedef void (^FBOSIntegratedShareDialogHandler)(FBOSIntegratedShareDialogResult result, NSError *error); + +/*! + @typedef FBDialogAppCallCompletionHandler + + @abstract + A block that when passed to a method in FBDialogs is called back + with the results of the AppCall for that dialog. + + @discussion + This will be called on the UI thread, once the AppCall completes. + + @param call The `FBAppCall` that was completed. + + @param results The results of the AppCall for the dialog. This parameters is present + purely for convenience, and is the exact same value as call.dialogData.results. + + @param error The `NSError` representing any error that occurred. This parameters is + present purely for convenience, and is the exact same value as call.error. + + */ +typedef void (^FBDialogAppCallCompletionHandler)( + FBAppCall *call, + NSDictionary *results, + NSError *error); + +/*! + @class FBDialogs + + @abstract + Provides methods to display native (i.e., non-Web-based) dialogs to the user. + + @discussion + If you are building an app with a urlSchemeSuffix, you should also set the appropriate + plist entry. See `[FBSettings defaultUrlSchemeSuffix]`. + */ +@interface FBDialogs : NSObject + +#pragma mark - OSIntegratedShareDialog + +/*! + @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)presentOSIntegratedShareDialogModallyFrom:(UIViewController *)viewController + initialText:(NSString *)initialText + image:(UIImage *)image + url:(NSURL *)url + handler:(FBOSIntegratedShareDialogHandler)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)presentOSIntegratedShareDialogModallyFrom:(UIViewController *)viewController + initialText:(NSString *)initialText + images:(NSArray *)images + urls:(NSArray *)urls + handler:(FBOSIntegratedShareDialogHandler)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 + 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 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)presentOSIntegratedShareDialogModallyFrom:(UIViewController *)viewController + session:(FBSession *)session + initialText:(NSString *)initialText + images:(NSArray *)images + urls:(NSArray *)urls + handler:(FBOSIntegratedShareDialogHandler)handler; + +/*! + @abstract + Determines whether a call to presentShareDialogModallyFrom: will successfully present + a dialog. This is useful for applications that need to modify the available UI controls + depending on whether the dialog is available on the current platform and for the current + user. + + @param session The 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. + + @return YES if the dialog would be presented for the session, and NO if not + */ ++ (BOOL)canPresentOSIntegratedShareDialogWithSession:(FBSession *)session; + +#pragma mark - Native Share Dialog + +/*! + @abstract + Determines whether a call to presentShareDialogWithOpenGraphActionParams:clientState:handler: + will successfully present a dialog in the Facebook application. This is useful for applications + that need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @param params The parameters for the FB share dialog. + + @return YES if the dialog would be presented, and NO if not + + @discussion A return value of YES here indicates that the corresponding + presentShareDialogWithOpenGraphActionParams method will return a non-nil FBAppCall for + the same params. And vice versa. +*/ ++ (BOOL)canPresentShareDialogWithOpenGraphActionParams:(FBOpenGraphActionParams *)params; + +/*! + @abstract + Determines whether a call to presentShareDialogWithTarget: will successfully + present a dialog in the Facebook application. This is useful for applications that + need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @param params The parameters for the FB share dialog. + + @return YES if the dialog would be presented, and NO if not + + @discussion A return value of YES here indicates that the corresponding + presentShareDialogWithParams method will return a non-nil FBAppCall for the same + params. And vice versa. +*/ ++ (BOOL)canPresentShareDialogWithParams:(FBLinkShareParams *)params; + +/*! + @abstract + Determines whether a call to presentShareDialogWithPhotoParams: will successfully + present a dialog in the Facebook application. This is useful for applications that + need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @return YES if the dialog would be presented, and NO if not + + @discussion A return value of YES here indicates that the corresponding + presentShareDialogWithPhotoParams method will return a non-nil FBAppCall. +*/ ++ (BOOL)canPresentShareDialogWithPhotos; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share a status + update that may include text, images, or URLs. No session is required, and the app + does not need to be authorized to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the FB share dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithParams:(FBLinkShareParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithLink:(NSURL *)link + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param name The name, or title associated with the link. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithLink:(NSURL *)link + name:(NSString *)name + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param name The name, or title associated with the link. May be nil. + + @param caption The caption to be used with the link. May be nil. + + @param description The description associated with the link. May be nil. + + @param picture The link to a thumbnail to associate with the link. May be nil. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithLink:(NSURL *)link + name:(NSString *)name + caption:(NSString *)caption + description:(NSString *)description + picture:(NSURL *)picture + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the FB share dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithPhotoParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithPhotoParams:(FBPhotoParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param photos An NSArray containing UIImages to be shared. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithPhotoParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithPhotos:(NSArray *)photos + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param photos An NSArray containing UIImages to be shared. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithPhotoParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithPhotos:(NSArray *)photos + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to publish an Open + Graph action. No session is required, and the app does not need to be authorized to call + this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the Open Graph action dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithOpenGraphActionParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithOpenGraphActionParams:(FBOpenGraphActionParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to publish the + supplied Open Graph action. No session is required, and the app does not need to be + authorized to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param action The Open Graph action to be published. May not be nil. + + @param actionType the fully-specified Open Graph action type of the action (e.g., + my_app_namespace:my_action). + + @param previewPropertyName the name of the property on the action that represents the + primary Open Graph object associated with the action; this object will be displayed in the + preview portion of the share dialog. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithOpenGraphActionParams method is also returning YES for the same params. + */+ (FBAppCall *)presentShareDialogWithOpenGraphAction:(id)action + actionType:(NSString *)actionType + previewPropertyName:(NSString *)previewPropertyName + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to publish the + supplied Open Graph action. No session is required, and the app does not need to be + authorized to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param action The Open Graph action to be published. May not be nil. + + @param actionType the fully-specified Open Graph action type of the action (e.g., + my_app_namespace:my_action). + + @param previewPropertyName the name of the property on the action that represents the + primary Open Graph object associated with the action; this object will be displayed in the + preview portion of the share dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithOpenGraphActionParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithOpenGraphAction:(id)action + actionType:(NSString *)actionType + previewPropertyName:(NSString *)previewPropertyName + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +#pragma mark - Message Dialog + +/*! + @abstract + Determines whether a call to `presentMessageDialogWithOpenGraphActionParams:...` will + successfully present a dialog in the Facebook Messenger app. This is useful for applications + that need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @param params the dialog parameters + + @return YES if the dialog would be presented, and NO if not +*/ ++ (BOOL)canPresentMessageDialogWithOpenGraphActionParams:(FBOpenGraphActionParams *)params; + +/*! + @abstract + Determines whether a call to `presentMessageDialogWithParams:...` will successfully + present a dialog in the Facebook Messenger app. This is useful for applications that + need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @param params the dialog parameters + + @return YES if the dialog would be presented, and NO if not +*/ ++ (BOOL)canPresentMessageDialogWithParams:(FBLinkShareParams *)params; + +/*! + @abstract + Determines whether a call to `presentMessageDialogWithPhotos:...` will successfully + present a dialog in the Facebook Messenger app. This is useful for applications that + need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @return YES if the dialog would be presented, and NO if not +*/ ++ (BOOL)canPresentMessageDialogWithPhotos; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to publish an Open + Graph action. No session is required, and the app does not need to be authorized to call + this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the Open Graph action dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + `canPresentMessageDialogWithOpenGraphActionParams:` method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithOpenGraphActionParams:(FBOpenGraphActionParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to publish the + supplied Open Graph action. No session is required, and the app does not need to be + authorized to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param action The Open Graph action to be published. May not be nil. + + @param actionType the fully-specified Open Graph action type of the action (e.g., + my_app_namespace:my_action). + + @param previewPropertyName the name of the property on the action that represents the + primary Open Graph object associated with the action; this object will be displayed in the + preview portion of the share dialog. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentMessageDialogWithOpenGraphActionParams method is also returning YES for the same params. + */+ (FBAppCall *)presentMessageDialogWithOpenGraphAction:(id)action + actionType:(NSString *)actionType + previewPropertyName:(NSString *)previewPropertyName + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to publish the + supplied Open Graph action. No session is required, and the app does not need to be + authorized to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param action The Open Graph action to be published. May not be nil. + + @param actionType the fully-specified Open Graph action type of the action (e.g., + my_app_namespace:my_action). + + @param previewPropertyName the name of the property on the action that represents the + primary Open Graph object associated with the action; this object will be displayed in the + preview portion of the share dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentMessageDialogWithOpenGraphActionParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithOpenGraphAction:(id)action + actionType:(NSString *)actionType + previewPropertyName:(NSString *)previewPropertyName + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to send the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the Message Dialog + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + `canPresentMessageDialogWithPhotos` method is also returning YES. + */ ++ (FBAppCall *)presentMessageDialogWithPhotoParams:(FBPhotoParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to send the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param photos An NSArray containing UIImages to be shared. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + `canPresentMessageDialogWithPhotos` method is also returning YES. + */ ++ (FBAppCall *)presentMessageDialogWithPhotos:(NSArray *)photos + handler:(FBDialogAppCallCompletionHandler)handler; +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to send the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param photos An NSArray containing UIImages to be shared. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + `canPresentMessageDialogWithPhotos` method is also returning YES. +*/ ++ (FBAppCall *)presentMessageDialogWithPhotos:(NSArray *)photos + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to share a status + update that may include text, images, or URLs. No session is required, and the app + does not need to be authorized to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the Message Dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + `canPresentMessageDialogWithParams:` method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithParams:(FBLinkShareParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentMessageDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithLink:(NSURL *)link + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param name The name, or title associated with the link. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentMessageDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithLink:(NSURL *)link + name:(NSString *)name + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param name The name, or title associated with the link. May be nil. + + @param caption The caption to be used with the link. May be nil. + + @param description The description associated with the link. May be nil. + + @param picture The link to a thumbnail to associate with the link. May be nil. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentMessageDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithLink:(NSURL *)link + name:(NSString *)name + caption:(NSString *)caption + description:(NSString *)description + picture:(NSURL *)picture + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogsData.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogsData.h new file mode 100755 index 0000000..bffbc46 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogsData.h @@ -0,0 +1,35 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/*! + @abstract + This class encapsulates state and data related to the presentation and completion + of a dialog. + */ +@interface FBDialogsData : NSObject + +/*! @abstract The method being performed */ +@property (nonatomic, readonly) NSString *method; +/*! @abstract The arguments being passed to the entity that will show the dialog */ +@property (nonatomic, readonly) NSDictionary *arguments; +/*! @abstract Client JSON state that is passed through to the completion handler for context */ +@property (nonatomic, readonly) NSDictionary *clientState; +/*! @abstract Results of this FBAppCall that are only set before calling an FBAppCallHandler */ +@property (nonatomic, readonly) NSDictionary *results; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogsParams.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogsParams.h new file mode 100755 index 0000000..9197de5 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogsParams.h @@ -0,0 +1,28 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/*! + @class FBDialogsParams + + @abstract + This object is used as a base class for parameters passed to native dialogs that + open in the Facebook app. + */ +@interface FBDialogsParams : NSObject + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBError.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBError.h new file mode 100755 index 0000000..a2716e2 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBError.h @@ -0,0 +1,389 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSDKMacros.h" + +/*! + The NSError domain of all errors returned by the Facebook SDK. +*/ +FBSDK_EXTERN NSString *const FacebookSDKDomain; + +/*! + The NSError domain of all errors surfaced by the Facebook SDK that + were returned by the Facebook Application + */ +FBSDK_EXTERN NSString *const FacebookNativeApplicationDomain; + +/*! + The key in the userInfo NSDictionary of NSError where you can find + the inner NSError (if any). +*/ +FBSDK_EXTERN NSString *const FBErrorInnerErrorKey; + +/*! + The key in the userInfo NSDictionary of NSError for the parsed JSON response + from the server. In case of a batch, includes the JSON for a single FBRequest. +*/ +FBSDK_EXTERN NSString *const FBErrorParsedJSONResponseKey; + +/*! + The key in the userInfo NSDictionary of NSError indicating + the HTTP status code of the response (if any). +*/ +FBSDK_EXTERN NSString *const FBErrorHTTPStatusCodeKey; + +/*! + @typedef NS_ENUM (NSUInteger, FBErrorCode) + @abstract Error codes returned by the Facebook SDK in NSError. + + @discussion + These are valid only in the scope of FacebookSDKDomain. + */ +typedef NS_ENUM(NSUInteger, FBErrorCode) { + /*! + Like nil for FBErrorCode values, represents an error code that + has not been initialized yet. + */ + FBErrorInvalid = 0, + + /*! The operation failed because it was cancelled. */ + FBErrorOperationCancelled, + + /*! A login attempt failed */ + FBErrorLoginFailedOrCancelled, + + /*! The graph API returned an error for this operation. */ + FBErrorRequestConnectionApi, + + /*! + The operation failed because the server returned an unexpected + response. You can get this error if you are not using the most + recent SDK, or if you set your application's migration settings + incorrectly for the version of the SDK you are using. + + If this occurs on the current SDK with proper app migration + settings, you may need to try changing to one request per batch. + */ + FBErrorProtocolMismatch, + + /*! Non-success HTTP status code was returned from the operation. */ + FBErrorHTTPError, + + /*! An endpoint that returns a binary response was used with FBRequestConnection. + Endpoints that return image/jpg, etc. should be accessed using NSURLRequest */ + FBErrorNonTextMimeTypeReturned, + + /*! An error occurred while trying to display a native dialog */ + FBErrorDialog, + + /*! An error occurred using the FBAppEvents class */ + FBErrorAppEvents, + + /*! An error occurred related to an iOS API call */ + FBErrorSystemAPI, + + /*! An error occurred while trying to fetch publish install response data */ + FBErrorPublishInstallResponse, + + /*! + The application had its applicationDidBecomeActive: method called while waiting + on a response from the native Facebook app for a pending FBAppCall. + */ + FBErrorAppActivatedWhilePendingAppCall, + + /*! + The application had its openURL: method called from a source that was not a + Facebook app and with a URL that was intended for the AppBridge + */ + FBErrorUntrustedURL, + + /*! + The URL passed to FBAppCall, was not able to be parsed + */ + FBErrorMalformedURL, + + /*! + The operation failed because the session is currently busy reconnecting. + */ + FBErrorSessionReconnectInProgess, + + /*! + Reserved for future use. + */ + FBErrorOperationDisallowedForRestrictedTreament, +}; + +/*! + @typedef NS_ENUM (NSUInteger, FBNativeApplicationErrorCode) + @abstract Error codes returned by the Facebook SDK in NSError. + + @discussion + These are valid only in the scope of FacebookNativeApplicationDomain. + */ +typedef NS_ENUM(NSUInteger, FBNativeApplicationErrorCode) { + /*! A general error in processing an FBAppCall, without a known cause. Unhandled exceptions are a good example */ + FBAppCallErrorUnknown = 1, + + /*! The FBAppCall cannot be processed for some reason */ + FBAppCallErrorUnsupported = 2, + + /*! The FBAppCall is for a method that does not exist (or is turned off) */ + FBAppCallErrorUnknownMethod = 3, + + /*! The FBAppCall cannot be processed at the moment, but can be retried at a later time. */ + FBAppCallErrorServiceBusy = 4, + + /*! Share was called in the native Facebook app with incomplete or incorrect arguments */ + FBShareErrorInvalidParam = 100, + + /*! A server error occurred while calling Share in the native Facebook app. */ + FBShareErrorServer = 102, + + /*! An unknown error occurred while calling Share in the native Facebook app. */ + FBShareErrorUnknown = 103, + + /*! Disallowed from calling Share in the native Facebook app. */ + FBShareErrorDenied = 104, +}; + +/*! + @typedef NS_ENUM (NSInteger, FBErrorCategory) + + @abstract Indicates the Facebook SDK classification for the error + + @discussion + */ +typedef NS_ENUM(NSInteger, FBErrorCategory) { + /*! Indicates that the error category is invalid and likely represents an error that + is unrelated to Facebook or the Facebook SDK */ + FBErrorCategoryInvalid = 0, + /*! Indicates that the error may be authentication related but the application should retry the operation. + This case may involve user action that must be taken, and so the application should also test + the fberrorShouldNotifyUser property and if YES display fberrorUserMessage to the user before retrying.*/ + FBErrorCategoryRetry = 1, + /*! Indicates that the error is authentication related and the application should reopen the session */ + FBErrorCategoryAuthenticationReopenSession = 2, + /*! Indicates that the error is permission related */ + FBErrorCategoryPermissions = 3, + /*! Indicates that the error implies that the server had an unexpected failure or may be temporarily down */ + FBErrorCategoryServer = 4, + /*! Indicates that the error results from the server throttling the client */ + FBErrorCategoryThrottling = 5, + /*! Indicates the user cancelled the operation */ + FBErrorCategoryUserCancelled = 6, + /*! Indicates that the error is Facebook-related but is uncategorizable, and likely newer than the + current version of the SDK */ + FBErrorCategoryFacebookOther = -1, + /*! Indicates that the error is an application error resulting in a bad or malformed request to the server. */ + FBErrorCategoryBadRequest = -2, +}; + +/*! + The key in the userInfo NSDictionary of NSError where you can find + the inner NSError (if any). + */ +FBSDK_EXTERN NSString *const FBErrorInnerErrorKey; + +/*! + The key in the userInfo NSDictionary of NSError where you can find + the session associated with the error (if any). +*/ +FBSDK_EXTERN NSString *const FBErrorSessionKey; + +/*! + The key in the userInfo NSDictionary of NSError that points to the URL + that caused an error, in its processing by FBAppCall. + */ +FBSDK_EXTERN NSString *const FBErrorUnprocessedURLKey; + +/*! + The key in the userInfo NSDictionary of NSError for unsuccessful + logins (error.code equals FBErrorLoginFailedOrCancelled). If present, + the value will be one of the constants prefixed by FBErrorLoginFailedReason*. +*/ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReason; + +/*! + The key in the userInfo NSDictionary of NSError for unsuccessful + logins (error.code equals FBErrorLoginFailedOrCancelled). If present, + the value indicates an original login error code wrapped by this error. + This is only used in the web dialog login flow. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedOriginalErrorCode; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates the user + cancelled a web dialog auth. +*/ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonInlineCancelledValue; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates the user + did not cancel a web dialog auth. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonInlineNotCancelledValue; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates the user + cancelled a non-iOS 6 SSO (either Safari or Facebook App) login. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonUserCancelledValue; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates the user + cancelled an iOS system login. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonUserCancelledSystemValue; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates an error + condition. You may inspect the rest of userInfo for other data. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonOtherError; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates the app's + slider in iOS 6 (device Settings -> Privacy -> Facebook {app}) has + been disabled. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonSystemDisallowedWithoutErrorValue; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates an error + has occurred when requesting Facebook account acccess in iOS 6 that was + not `FBErrorLoginFailedReasonSystemDisallowedWithoutErrorValue` nor + a user cancellation. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonSystemError; +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonUnitTestResponseUnrecognized; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key when requesting new permissions fails. Indicates + the request for new permissions has failed because the session was closed. + */ +FBSDK_EXTERN NSString *const FBErrorReauthorizeFailedReasonSessionClosed; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key when requesting new permissions fails. Indicates + the request for new permissions has failed because the user cancelled. + */ +FBSDK_EXTERN NSString *const FBErrorReauthorizeFailedReasonUserCancelled; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key when requesting new permissions fails on + iOS 6 with the Facebook account. Indicates the request for new permissions has + failed because the user cancelled. + */ +FBSDK_EXTERN NSString *const FBErrorReauthorizeFailedReasonUserCancelledSystem; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key when requesting new permissions fails. Indicates + the request for new permissions has failed because the request was + for a different user than the original permission set. + */ +FBSDK_EXTERN NSString *const FBErrorReauthorizeFailedReasonWrongUser; + +/*! + The key in the userInfo NSDictionary of NSError for errors + encountered with `FBDialogs` operations. (error.code equals FBErrorDialog). + If present, the value will be one of the constants prefixed by FBErrorDialog *. +*/ +FBSDK_EXTERN NSString *const FBErrorDialogReasonKey; + +/*! + A value that may appear in the NSError userInfo dictionary under the +`FBErrorDialogReasonKey` key. Indicates that a native dialog is not supported + in the current OS. +*/ +FBSDK_EXTERN NSString *const FBErrorDialogNotSupported; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorDialogReasonKey` key. Indicates that a native dialog cannot be + displayed because it is not appropriate for the current session. +*/ +FBSDK_EXTERN NSString *const FBErrorDialogInvalidForSession; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorDialogReasonKey` key. Indicates that a native dialog cannot be + displayed for some other reason. + */ +FBSDK_EXTERN NSString *const FBErrorDialogCantBeDisplayed; + +/*! + A value that may appear in the NSError userInfo ditionary under the + `FBErrorDialogReasonKey` key. Indicates that a native dialog cannot be + displayed because an Open Graph object that was passed was not configured + correctly. The object must either (a) exist by having an 'id' or 'url' value; + or, (b) configured for creation (by setting the 'type' value and + provisionedForPost property) +*/ +FBSDK_EXTERN NSString *const FBErrorDialogInvalidOpenGraphObject; + +/*! + A value that may appear in the NSError userInfo ditionary under the + `FBErrorDialogReasonKey` key. Indicates that a native dialog cannot be + displayed because the parameters for sharing an Open Graph action were + not configured. The parameters must include an 'action', 'actionType', and + 'previewPropertyName'. + */ +FBSDK_EXTERN NSString *const FBErrorDialogInvalidOpenGraphActionParameters; + +/*! + A value that may appear in the NSError userInfo ditionary under the + `FBErrorDialogReasonKey` key. Indicates that a native dialog cannot be + displayed because the parameters for sharing a status update, link, or photo were + not configured. The parameters must not include both 'photos' and a 'link'. */ +FBSDK_EXTERN NSString *const FBErrorDialogInvalidShareParameters; + +/*! + A value that may appear in the NSError userInfo ditionary under the + `FBErrorDialogReasonKey` key. Indicates that a like dialog cannot be + displayed because the objectID parameter value is invalid. + */ +FBSDK_EXTERN NSString *const FBErrorDialogInvalidLikeObjectID; + +/*! + The key in the userInfo NSDictionary of NSError for errors + encountered with `FBAppEvents` operations (error.code equals FBErrorAppEvents). +*/ +FBSDK_EXTERN NSString *const FBErrorAppEventsReasonKey; + +// Exception strings raised by the Facebook SDK + +/*! + This exception is raised by methods in the Facebook SDK to indicate + that an attempted operation is invalid + */ +FBSDK_EXTERN NSString *const FBInvalidOperationException; + +// Facebook SDK also raises exceptions the following common exceptions: +// NSInvalidArgumentException + diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBErrorUtility.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBErrorUtility.h new file mode 100755 index 0000000..4e4c7e0 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBErrorUtility.h @@ -0,0 +1,67 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FBError.h" + +/*! + @class FBErrorUtility + + @abstract A utility class with methods to provide more information for Facebook + related errors if you do not want to use the NSError(FBError) category. + + */ +@interface FBErrorUtility : NSObject + +/*! + @abstract + Categorizes the error, if it is Facebook related, to simplify application mitigation behavior + + @discussion + In general, in response to an error connecting to Facebook, an application should, retry the + operation, request permissions, reconnect the application, or prompt the user to take an action. + The error category can be used to understand the class of error received from Facebook. For more infomation on this + see https://developers.facebook.com/docs/reference/api/errors/ + + @param error the error to be categorized. + */ ++ (FBErrorCategory)errorCategoryForError:(NSError *)error; + +/*! + @abstract + If YES indicates that a user action is required in order to successfully continue with the facebook operation + + @discussion + In general if this returns NO, then the application has a straightforward mitigation, such as + retry the operation or request permissions from the user, etc. In some cases it is necessary for the user to + take an action before the application continues to attempt a Facebook connection. For more infomation on this + see https://developers.facebook.com/docs/reference/api/errors/ + + @param error the error to inspect. + */ ++ (BOOL)shouldNotifyUserForError:(NSError *)error; + +/*! + @abstract + A message suitable for display to the user, describing a user action necessary to enable Facebook functionality. + Not all Facebook errors yield a message suitable for user display; however in all cases where + fberrorShouldNotifyUser is YES, this property returns a localizable message suitable for display. + + @param error the error to inspect. + */ ++ (NSString *)userMessageForError:(NSError *)error; + + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFrictionlessRecipientCache.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFrictionlessRecipientCache.h new file mode 100755 index 0000000..cfca124 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFrictionlessRecipientCache.h @@ -0,0 +1,81 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#import + +#import "FBCacheDescriptor.h" +#import "FBRequest.h" +#import "FBWebDialogs.h" + +/*! + @class FBFrictionlessRecipientCache + + @abstract + Maintains a cache of friends that can recieve application requests from the user in + using the frictionless feature of the requests web dialog. + + This class follows the `FBCacheDescriptor` pattern used elsewhere in the SDK, and applications may call + one of the prefetchAndCacheForSession methods to fetch a friend list prior to the + point where a dialog is presented. The cache is also updated with each presentation of the request + dialog using the cache instance. + */ +@interface FBFrictionlessRecipientCache : FBCacheDescriptor + +/*! @abstract An array containing the list of known FBIDs for recipients enabled for frictionless requests */ +@property (nonatomic, readwrite, copy) NSArray *recipientIDs; + +/*! + @abstract + Checks to see if a given user or FBID for a user is known to be enabled for + frictionless requestests + + @param user An NSString, NSNumber of `FBGraphUser` representing a user to check + */ +- (BOOL)isFrictionlessRecipient:(id)user; + +/*! + @abstract + Checks to see if a collection of users or FBIDs for users are known to be enabled for + frictionless requestests + + @param users An NSArray of NSString, NSNumber of `FBGraphUser` objects + representing users to check + */ +- (BOOL)areFrictionlessRecipients:(NSArray *)users; + +/*! + @abstract + Issues a request and fills the cache with a list of users to use for frictionless requests + + @param session The session to use for the request; nil indicates that the Active Session should + be used + */ +- (void)prefetchAndCacheForSession:(FBSession *)session; + +/*! + @abstract + Issues a request and fills the cache with a list of users to use for frictionless requests + + @param session The session to use for the request; nil indicates that the Active Session should + be used + + @param handler An optional completion handler, called when the request for cached users has + completed. It can be useful to use the handler to enable UI or perform other request-related + operations, after the cache is populated. + */ +- (void)prefetchAndCacheForSession:(FBSession *)session + completionHandler:(FBRequestHandler)handler; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFrictionlessRequestSettings.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFrictionlessRequestSettings.h new file mode 100755 index 0000000..17ee8ec --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFrictionlessRequestSettings.h @@ -0,0 +1,80 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@class FBRequest; +@class Facebook; + +/** + * Do not use this interface directly, instead, use methods in Facebook.h + * + * Handles frictionless interaction and recipient-caching by the SDK, + * see https://developers.facebook.com/docs/reference/dialogs/requests/ + */ +@interface FBFrictionlessRequestSettings : NSObject { +@private + NSArray *_allowedRecipients; + FBRequest *_activeRequest; + BOOL _enabled; +} + +/** + * BOOL indicating whether frictionless request sending has been enabled + */ +@property (nonatomic, readonly) BOOL enabled; + +/** + * NSArray of recipients + */ +@property (nonatomic, readonly) NSArray *recipientIDs; + +/** + * Enable frictionless request sending by the sdk; this means: + * 1. query and cache the current set of frictionless recipients + * 2. flag other facets of the sdk to behave in a frictionless way + */ +- (void)enableWithFacebook:(Facebook *)facebook; + +/** + * Reload recipient cache; called by the sdk to keep the cache fresh; + * method makes graph request: me/apprequestformerrecipients + */ +- (void)reloadRecipientCacheWithFacebook:(Facebook *)facebook; + +/** + * Update the recipient cache; called by the sdk to keep the cache fresh; + */ +- (void)updateRecipientCacheWithRecipients:(NSArray *)ids; + +/** + * Update the recipient cache, using a request result + */ +- (void)updateRecipientCacheWithRequestResult:(id)result; + +/** + * Given an fbID for a user, indicates whether user is enabled for + * frictionless calls + */ +- (BOOL)isFrictionlessEnabledForRecipient:(id)fbid; + +/** + * Given an array of user fbIDs, indicates whether they are enabled for + * frictionless calls + */ +- (BOOL)isFrictionlessEnabledForRecipients:(NSArray *)fbids; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFriendPickerViewController.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFriendPickerViewController.h new file mode 100755 index 0000000..187ad25 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFriendPickerViewController.h @@ -0,0 +1,290 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBCacheDescriptor.h" +#import "FBGraphUser.h" +#import "FBSession.h" +#import "FBViewController.h" + +@protocol FBFriendPickerDelegate; +@class FBFriendPickerCacheDescriptor; + +/*! + @typedef NS_ENUM (NSUInteger, FBFriendSortOrdering) + + @abstract Indicates the order in which friends should be listed in the friend picker. + + @discussion + */ +typedef NS_ENUM(NSUInteger, FBFriendSortOrdering) { + /*! Sort friends by first, middle, last names. */ + FBFriendSortByFirstName = 0, + /*! Sort friends by last, first, middle names. */ + FBFriendSortByLastName +}; + +/*! + @typedef NS_ENUM (NSUInteger, FBFriendDisplayOrdering) + + @abstract Indicates whether friends should be displayed first-name-first or last-name-first. + + @discussion + */ +typedef NS_ENUM(NSUInteger, FBFriendDisplayOrdering) { + /*! Display friends as First Middle Last. */ + FBFriendDisplayByFirstName = 0, + /*! Display friends as Last First Middle. */ + FBFriendDisplayByLastName, +}; + + +/*! + @class + + @abstract + The `FBFriendPickerViewController` class creates a controller object that manages + the user interface for displaying and selecting Facebook friends. + + @discussion + When the `FBFriendPickerViewController` view loads it creates a `UITableView` object + where the friends will be displayed. You can access this view through the `tableView` + property. The friend display can be sorted by first name or last name. Friends' + names can be displayed with the first name first or the last name first. + + The friend data can be pre-fetched and cached prior to using the view controller. The + cache is setup using an object that can trigger the + data fetch. Any friend data requests will first check the cache and use that data. + If the friend picker is being displayed cached data will initially be shown before + a fresh copy is retrieved. + + The `delegate` property may be set to an object that conforms to the + protocol. The `delegate` object will receive updates related to friend selection and + data changes. The delegate can also be used to filter the friends to display in the + picker. + */ +@interface FBFriendPickerViewController : FBViewController + +/*! + @abstract + Returns an outlet for the spinner used in the view controller. + */ +@property (nonatomic, retain) IBOutlet UIActivityIndicatorView *spinner; + +/*! + @abstract + Returns an outlet for the table view managed by the view controller. + */ +@property (nonatomic, retain) IBOutlet UITableView *tableView; + +/*! + @abstract + A Boolean value that specifies whether multi-select is enabled. + */ +@property (nonatomic) BOOL allowsMultipleSelection; + +/*! + @abstract + A Boolean value that indicates whether friend profile pictures are displayed. + */ +@property (nonatomic) BOOL itemPicturesEnabled; + +/*! + @abstract + Addtional fields to fetch when making the Graph API call to get friend data. + */ +@property (nonatomic, copy) NSSet *fieldsForRequest; + +/*! + @abstract + The session that is used in the request for friend data. + */ +@property (nonatomic, retain) FBSession *session; + +/*! + @abstract + The profile ID of the user whose friends are being viewed. + */ +@property (nonatomic, copy) NSString *userID; + +/*! + @abstract + The list of friends that are currently selected in the veiw. + The items in the array are objects. + + @discussion + You can set this this array to pre-select items in the picker. The objects in the array + must be complete id objects (i.e., fetched from a Graph query or from a + previous picker's selection, with id and appropriate name fields). + */ +@property (nonatomic, copy) NSArray *selection; + +/*! + @abstract + The order in which friends are sorted in the display. + */ +@property (nonatomic) FBFriendSortOrdering sortOrdering; + +/*! + @abstract + The order in which friends' names are displayed. + */ +@property (nonatomic) FBFriendDisplayOrdering displayOrdering; + +/*! + @abstract + Initializes a friend picker view controller. + + @param aDecoder An unarchiver object. + */ +- (instancetype)initWithCoder:(NSCoder *)aDecoder; + +/*! + @abstract + Used to initialize the object + + @param nibNameOrNil The name of the nib file to associate with the view controller. The nib file name should not contain any leading path information. If you specify nil, the nibName property is set to nil. + @param nibBundleOrNil The bundle in which to search for the nib file. This method looks for the nib file in the bundle's language-specific project directories first, followed by the Resources directory. If nil, this method looks for the nib file in the main bundle. + */ +- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil; + +/*! + @abstract + Configures the properties used in the caching data queries. + + @discussion + Cache descriptors are used to fetch and cache the data used by the view controller. + If the view controller finds a cached copy of the data, it will + first display the cached content then fetch a fresh copy from the server. + + @param cacheDescriptor The containing the cache query properties. + */ +- (void)configureUsingCachedDescriptor:(FBCacheDescriptor *)cacheDescriptor; + +/*! + @abstract + Initiates a query to get friend data. + + @discussion + A cached copy will be returned if available. The cached view is temporary until a fresh copy is + retrieved from the server. It is legal to call this more than once. + */ +- (void)loadData; + +/*! + @abstract + Updates the view locally without fetching data from the server or from cache. + + @discussion + Use this if the filter or sort properties change. This may affect the order or + display of friend information but should not need require new data. + */ +- (void)updateView; + +/*! + @abstract + Clears the current selection, so the picker is ready for a fresh use. + */ +- (void)clearSelection; + +/*! + @method + + @abstract + Creates a cache descriptor based on default settings of the `FBFriendPickerViewController` object. + + @discussion + An `FBCacheDescriptor` object may be used to pre-fetch data before it is used by + the view controller. It may also be used to configure the `FBFriendPickerViewController` + object. + */ ++ (FBCacheDescriptor *)cacheDescriptor; + +/*! + @method + + @abstract + Creates a cache descriptor with additional fields and a profile ID for use with the `FBFriendPickerViewController` object. + + @discussion + An `FBCacheDescriptor` object may be used to pre-fetch data before it is used by + the view controller. It may also be used to configure the `FBFriendPickerViewController` + object. + + @param userID The profile ID of the user whose friends will be displayed. A nil value implies a "me" alias. + @param fieldsForRequest The set of additional fields to include in the request for friend data. + */ ++ (FBCacheDescriptor *)cacheDescriptorWithUserID:(NSString *)userID fieldsForRequest:(NSSet *)fieldsForRequest; + +@end + +/*! + @protocol + + @abstract + The `FBFriendPickerDelegate` protocol defines the methods used to receive event + notifications and allow for deeper control of the + view. + */ +@protocol FBFriendPickerDelegate +@optional + +/*! + @abstract + Tells the delegate that data has been loaded. + + @discussion + The object's `tableView` property is automatically + reloaded when this happens. However, if another table view, for example the + `UISearchBar` is showing data, then it may also need to be reloaded. + + @param friendPicker The friend picker view controller whose data changed. + */ +- (void)friendPickerViewControllerDataDidChange:(FBFriendPickerViewController *)friendPicker; + +/*! + @abstract + Tells the delegate that the selection has changed. + + @param friendPicker The friend picker view controller whose selection changed. + */ +- (void)friendPickerViewControllerSelectionDidChange:(FBFriendPickerViewController *)friendPicker; + +/*! + @abstract + Asks the delegate whether to include a friend in the list. + + @discussion + This can be used to implement a search bar that filters the friend list. + + @param friendPicker The friend picker view controller that is requesting this information. + @param user An object representing the friend. + */ +- (BOOL)friendPickerViewController:(FBFriendPickerViewController *)friendPicker + shouldIncludeUser:(id)user; + +/*! + @abstract + Tells the delegate that there is a communication error. + + @param friendPicker The friend picker view controller that encountered the error. + @param error An error object containing details of the error. + */ +- (void)friendPickerViewController:(FBFriendPickerViewController *)friendPicker + handleError:(NSError *)error; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphLocation.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphLocation.h new file mode 100755 index 0000000..7f71ce6 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphLocation.h @@ -0,0 +1,78 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphObject.h" + +/*! + @protocol + + @abstract + The `FBGraphLocation` protocol enables typed access to the `location` property + of a Facebook place object. + + + @discussion + The `FBGraphLocation` protocol represents the most commonly used properties of a + location object. It may be used to access an `NSDictionary` object that has + been wrapped with an facade. + */ +@protocol FBGraphLocation + +/*! + @property + @abstract Typed access to a location's street. + */ +@property (retain, nonatomic) NSString *street; + +/*! + @property + @abstract Typed access to a location's city. + */ +@property (retain, nonatomic) NSString *city; + +/*! + @property + @abstract Typed access to a location's state. + */ +@property (retain, nonatomic) NSString *state; + +/*! + @property + @abstract Typed access to a location's country. + */ +@property (retain, nonatomic) NSString *country; + +/*! + @property + @abstract Typed access to a location's zip code. + */ +@property (retain, nonatomic) NSString *zip; + +/*! + @property + @abstract Typed access to a location's latitude. + */ +@property (retain, nonatomic) NSNumber *latitude; + +/*! + @property + @abstract Typed access to a location's longitude. + */ +@property (retain, nonatomic) NSNumber *longitude; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphObject.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphObject.h new file mode 100755 index 0000000..005aa99 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphObject.h @@ -0,0 +1,269 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@protocol FBOpenGraphObject; +@protocol FBOpenGraphAction; + +/*! + @protocol + + @abstract + The `FBGraphObject` protocol is the base protocol which enables typed access to graph objects and + open graph objects. Inherit from this protocol or a sub-protocol in order to introduce custom types + for typed access to Facebook objects. + + @discussion + The `FBGraphObject` protocol is the core type used by the Facebook SDK for iOS to + represent objects in the Facebook Social Graph and the Facebook Open Graph (OG). + The `FBGraphObject` class implements useful default functionality, but is rarely + used directly by applications. The `FBGraphObject` protocol, in contrast is the + base protocol for all graph object access via the SDK. + + Goals of the FBGraphObject types: +
    +
  • Lightweight/maintainable/robust
  • +
  • Extensible and resilient to change, both by Facebook and third party (OG)
  • +
  • Simple and natural extension to Objective-C
  • +
+ + The FBGraphObject at its core is a duck typed (if it walks/swims/quacks... + its a duck) model which supports an optional static facade. Duck-typing achieves + the flexibility necessary for Social Graph and OG uses, and the static facade + increases discoverability, maintainability, robustness and simplicity. + The following excerpt from the PlacePickerSample shows a simple use of the + a facade protocol `FBGraphPlace` by an application: + +
+ ‐ (void)placePickerViewControllerSelectionDidChange:(FBPlacePickerViewController *)placePicker
+ {
+ id<FBGraphPlace> place = placePicker.selection;
+
+ // we'll use logging to show the simple typed property access to place and location info
+ NSLog(@"place=%@, city=%@, state=%@, lat long=%@ %@",
+ place.name,
+ place.location.city,
+ place.location.state,
+ place.location.latitude,
+ place.location.longitude);
+ }
+ 
+ + Note that in this example, access to common place information is available through typed property + syntax. But if at some point places in the Social Graph supported additional fields "foo" and "bar", not + reflected in the `FBGraphPlace` protocol, the application could still access the values like so: + +
+ NSString *foo = [place objectForKey:@"foo"]; // perhaps located at the ... in the preceding example
+ NSNumber *bar = [place objectForKey:@"bar"]; // extensibility applies to Social and Open graph uses
+ 
+ + In addition to untyped access, applications and future revisions of the SDK may add facade protocols by + declaring a protocol inheriting the `FBGraphObject` protocol, like so: + +
+ @protocol MyGraphThing<FBGraphObject>
+ @property (copy, nonatomic) NSString *id;
+ @property (copy, nonatomic) NSString *name;
+ @end
+ 
+ + Important: facade implementations are inferred by graph objects returned by the methods of the SDK. This + means that no explicit implementation is required by application or SDK code. Any `FBGraphObject` instance + may be cast to any `FBGraphObject` facade protocol, and accessed via properties. If a field is not present + for a given facade property, the property will return nil. + + The following layer diagram depicts some of the concepts discussed thus far: + +
+                        *-------------* *------------* *-------------**--------------------------*
+ Facade -->             | FBGraphUser | |FBGraphPlace| | MyGraphThing|| MyGraphPersonExtentension| ...
+                        *-------------* *------------* *-------------**--------------------------*
+                        *------------------------------------* *--------------------------------------*
+ Transparent impl -->   |     FBGraphObject (instances)      | |      CustomClass<FBGraphObject>      |
+                        *------------------------------------* *--------------------------------------*
+                        *-------------------**------------------------* *-----------------------------*
+ Apparent impl -->      |NSMutableDictionary||FBGraphObject (protocol)| |FBGraphObject (class methods)|
+                        *-------------------**------------------------* *-----------------------------*
+ 
+ + The *Facade* layer is meant for typed access to graph objects. The *Transparent impl* layer (more + specifically, the instance capabilities of `FBGraphObject`) are used by the SDK and app logic + internally, but are not part of the public interface between application and SDK. The *Apparent impl* + layer represents the lower-level "duck-typed" use of graph objects. + + Implementation note: the SDK returns `NSMutableDictionary` derived instances with types declared like + one of the following: + +
+ NSMutableDictionary<FBGraphObject> *obj;     // no facade specified (still castable by app)
+ NSMutableDictionary<FBGraphPlace> *person;   // facade specified when possible
+ 
+ + However, when passing a graph object to the SDK, `NSMutableDictionary` is not assumed; only the + FBGraphObject protocol is assumed, like so: + +
+ id<FBGraphObject> anyGraphObj;
+ 
+ + As such, the methods declared on the `FBGraphObject` protocol represent the methods used by the SDK to + consume graph objects. While the `FBGraphObject` class implements the full `NSMutableDictionary` and KVC + interfaces, these are not consumed directly by the SDK, and are optional for custom implementations. + */ +@protocol FBGraphObject + +/*! + @method + @abstract + Returns the number of properties on this `FBGraphObject`. + */ +- (NSUInteger)count; +/*! + @method + @abstract + Returns a property on this `FBGraphObject`. + + @param aKey name of the property to return + */ +- (id)objectForKey:(id)aKey; +/*! + @method + @abstract + Returns an enumerator of the property naems on this `FBGraphObject`. + */ +- (NSEnumerator *)keyEnumerator; +/*! + @method + @abstract + Removes a property on this `FBGraphObject`. + + @param aKey name of the property to remove + */ +- (void)removeObjectForKey:(id)aKey; +/*! + @method + @abstract + Sets the value of a property on this `FBGraphObject`. + + @param anObject the new value of the property + @param aKey name of the property to set + */ +- (void)setObject:(id)anObject forKey:(id)aKey; + +@optional + +/*! + @abstract + This property signifies that the current graph object is provisioned for POST (as a definition + for a new or updated graph object), and should be posted AS-IS in its JSON encoded form, whereas + some graph objects (usually those embedded in other graph objects as references to existing objects) + may only have their "id" or "url" posted. + */ +@property (nonatomic, assign) BOOL provisionedForPost; + +@end + +/*! + @class + + @abstract + Static class with helpers for use with graph objects + + @discussion + The public interface of this class is useful for creating objects that have the same graph characteristics + of those returned by methods of the SDK. This class also represents the internal implementation of the + `FBGraphObject` protocol, used by the Facebook SDK. Application code should not use the `FBGraphObject` class to + access instances and instance members, favoring the protocol. + */ +@interface FBGraphObject : NSMutableDictionary + +/*! + @method + @abstract + Used to create a graph object, usually for use in posting a new graph object or action. + */ ++ (NSMutableDictionary *)graphObject; + +/*! + @method + @abstract + Used to wrap an existing dictionary with a `FBGraphObject` facade + + @discussion + Normally you will not need to call this method, as the Facebook SDK already "FBGraphObject-ifys" json objects + fetch via `FBRequest` and `FBRequestConnection`. However, you may have other reasons to create json objects in your + application, which you would like to treat as a graph object. The pattern for doing this is that you pass the root + node of the json to this method, to retrieve a wrapper. From this point, if you traverse the graph, any other objects + deeper in the hierarchy will be wrapped as `FBGraphObject`'s in a lazy fashion. + + This method is designed to avoid unnecessary memory allocations, and object copying. Due to this, the method does + not copy the source object if it can be avoided, but rather wraps and uses it as is. The returned object derives + callers shoudl use the returned object after calls to this method, rather than continue to call methods on the original + object. + + @param jsonDictionary the dictionary representing the underlying object to wrap + */ ++ (NSMutableDictionary *)graphObjectWrappingDictionary:(NSDictionary *)jsonDictionary; + +/*! + @method + @abstract + Used to create a graph object that's provisioned for POST, usually for use in posting a new Open Graph Action. + */ ++ (NSMutableDictionary *)openGraphActionForPost; + +/*! + @method + @abstract + Used to create a graph object that's provisioned for POST, usually for use in posting a new Open Graph object. + */ ++ (NSMutableDictionary *)openGraphObjectForPost; + +/*! + @method + @abstract + Used to create a graph object that's provisioned for POST, usually for use in posting a new Open Graph object. + + @param type the object type name, in the form namespace:typename + @param title a title for the object + @param image the image property for the object + @param url the url property for the object + @param description the description for the object + */ ++ (NSMutableDictionary *)openGraphObjectForPostWithType:(NSString *)type + title:(NSString *)title + image:(id)image + url:(id)url + description:(NSString *)description; + +/*! + @method + @abstract + Used to compare two `FBGraphObject`s to determine if represent the same object. We do not overload + the concept of equality as there are various types of equality that may be important for an `FBGraphObject` + (for instance, two different `FBGraphObject`s could represent the same object, but contain different + subsets of fields). + + @param anObject an `FBGraphObject` to test + + @param anotherObject the `FBGraphObject` to compare it against + */ ++ (BOOL)isGraphObjectID:(id)anObject sameAs:(id)anotherObject; + + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphPlace.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphPlace.h new file mode 100755 index 0000000..40e144f --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphPlace.h @@ -0,0 +1,61 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphLocation.h" +#import "FBGraphObject.h" + +/*! + @protocol + + @abstract + The `FBGraphPlace` protocol enables typed access to a place object + as represented in the Graph API. + + + @discussion + The `FBGraphPlace` protocol represents the most commonly used properties of a + Facebook place object. It may be used to access an `NSDictionary` object that has + been wrapped with an facade. + */ +@protocol FBGraphPlace + +/*! + @property + @abstract Typed access to the place ID. + */ +@property (retain, nonatomic) NSString *id; + +/*! + @property + @abstract Typed access to the place name. + */ +@property (retain, nonatomic) NSString *name; + +/*! + @property + @abstract Typed access to the place category. + */ +@property (retain, nonatomic) NSString *category; + +/*! + @property + @abstract Typed access to the place location. + */ +@property (retain, nonatomic) id location; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphUser.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphUser.h new file mode 100755 index 0000000..645ea1d --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphUser.h @@ -0,0 +1,91 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphObject.h" +#import "FBGraphPlace.h" + +/*! + @protocol + + @abstract + The `FBGraphUser` protocol enables typed access to a user object + as represented in the Graph API. + + + @discussion + The `FBGraphUser` protocol represents the most commonly used properties of a + Facebook user object. It may be used to access an `NSDictionary` object that has + been wrapped with an facade. + */ +@protocol FBGraphUser + +/*! + @property + @abstract Typed access to the user's ID. + */ +@property (retain, nonatomic) NSString *id; + +/*! + @property + @abstract Typed access to the user's name. + */ +@property (retain, nonatomic) NSString *name; + +/*! + @property + @abstract Typed access to the user's first name. + */ +@property (retain, nonatomic) NSString *first_name; + +/*! + @property + @abstract Typed access to the user's middle name. + */ +@property (retain, nonatomic) NSString *middle_name; + +/*! + @property + @abstract Typed access to the user's last name. + */ +@property (retain, nonatomic) NSString *last_name; + +/*! + @property + @abstract Typed access to the user's profile URL. + */ +@property (retain, nonatomic) NSString *link; + +/*! + @property + @abstract Typed access to the user's username. + */ +@property (retain, nonatomic) NSString *username; + +/*! + @property + @abstract Typed access to the user's birthday. + */ +@property (retain, nonatomic) NSString *birthday; + +/*! + @property + @abstract Typed access to the user's current city. + */ +@property (retain, nonatomic) id location; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBInsights.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBInsights.h new file mode 100755 index 0000000..10aedac --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBInsights.h @@ -0,0 +1,58 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSDKMacros.h" +#import "FBSession.h" + +/*! + @typedef FBInsightsFlushBehavior enum + + @abstract This enum has been deprecated in favor of FBAppEventsFlushBehavior. + */ +__attribute__ ((deprecated("use FBAppEventsFlushBehavior instead"))) +typedef enum { + FBInsightsFlushBehaviorAuto __attribute__ ((deprecated("use FBAppEventsFlushBehaviorAuto instead"))), + FBInsightsFlushBehaviorExplicitOnly __attribute__ ((deprecated("use FBAppEventsFlushBehaviorExplicitOnly instead"))), +} FBInsightsFlushBehavior; + +FBSDK_EXTERN NSString *const FBInsightsLoggingResultNotification __attribute__((deprecated)); + +/*! + @class FBInsights + + @abstract This class has been deprecated in favor of FBAppEvents. + */ +__attribute__ ((deprecated("Use the FBAppEvents class instead"))) +@interface FBInsights : NSObject + ++ (NSString *)appVersion __attribute__((deprecated)); ++ (void)setAppVersion:(NSString *)appVersion __attribute__((deprecated("use [FBSettings setAppVersion] instead"))); + ++ (void)logPurchase:(double)purchaseAmount currency:(NSString *)currency __attribute__((deprecated("use [FBAppEvents logPurchase] instead"))); ++ (void)logPurchase:(double)purchaseAmount currency:(NSString *)currency parameters:(NSDictionary *)parameters __attribute__((deprecated("use [FBAppEvents logPurchase] instead"))); ++ (void)logPurchase:(double)purchaseAmount currency:(NSString *)currency parameters:(NSDictionary *)parameters session:(FBSession *)session __attribute__((deprecated("use [FBAppEvents logPurchase] instead"))); + ++ (void)logConversionPixel:(NSString *)pixelID valueOfPixel:(double)value __attribute__((deprecated)); ++ (void)logConversionPixel:(NSString *)pixelID valueOfPixel:(double)value session:(FBSession *)session __attribute__((deprecated)); + ++ (FBInsightsFlushBehavior)flushBehavior __attribute__((deprecated("use [FBAppEvents flushBehavior] instead"))); ++ (void)setFlushBehavior:(FBInsightsFlushBehavior)flushBehavior __attribute__((deprecated("use [FBAppEvents setFlushBehavior] instead"))); + ++ (void)flush __attribute__((deprecated("use [FBAppEvents flush] instead"))); + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLikeControl.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLikeControl.h new file mode 100755 index 0000000..636ff1b --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLikeControl.h @@ -0,0 +1,126 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/*! + @typedef NS_ENUM (NSUInteger, FBLikeControlAuxiliaryPosition) + + @abstract Specifies the position of the auxiliary view relative to the like button. + */ +typedef NS_ENUM(NSUInteger, FBLikeControlAuxiliaryPosition) +{ + /*! The auxiliary view is inline with the like button. */ + FBLikeControlAuxiliaryPositionInline, + /*! The auxiliary view is above the like button. */ + FBLikeControlAuxiliaryPositionTop, + /*! The auxiliary view is below the like button. */ + FBLikeControlAuxiliaryPositionBottom, +}; + +/*! + @typedef NS_ENUM(NSUInteger, FBLikeControlHorizontalAlignment) + + @abstract Specifies the horizontal alignment for FBLikeControlStyleStandard with + FBLikeControlAuxiliaryPositionTop or FBLikeControlAuxiliaryPositionBottom. + */ +typedef NS_ENUM(NSUInteger, FBLikeControlHorizontalAlignment) +{ + /*! The subviews are left aligned. */ + FBLikeControlHorizontalAlignmentLeft, + /*! The subviews are center aligned. */ + FBLikeControlHorizontalAlignmentCenter, + /*! The subviews are right aligned. */ + FBLikeControlHorizontalAlignmentRight, +}; + +/*! + @typedef NS_ENUM (NSUInteger, FBLikeControlStyle) + + @abstract Specifies the style of a like control. + */ +typedef NS_ENUM(NSUInteger, FBLikeControlStyle) +{ + /*! Displays the button and the social sentence. */ + FBLikeControlStyleStandard = 0, + /*! Displays the button and a box that contains the like count. */ + FBLikeControlStyleBoxCount, + /*! Displays the button only. */ + FBLikeControlStyleButton, +}; + +/*! + @class FBLikeControl + + @abstract UI control to like an object in the Facebook graph. + + @discussion Taps on the like button within this control will invoke an API call to the Facebook app through a + fast-app-switch that allows the user to like the object. Upon return to the calling app, the view will update + with the new state and send actions for the UIControlEventValueChanged event. + */ +@interface FBLikeControl : UIControl + +/*! + @abstract The foreground color to use for the content of the receiver. + */ +@property (nonatomic, strong) UIColor *foregroundColor; + +/*! + @abstract The position for the auxiliary view for the receiver. + + @see FBLikeControlAuxiliaryPosition + */ +@property (nonatomic, assign) FBLikeControlAuxiliaryPosition likeControlAuxiliaryPosition; + +/*! + @abstract The text alignment of the social sentence. + + @discussion This value is only valid for FBLikeControlStyleStandard with FBLikeControlAuxiliaryPositionTop|Bottom. + */ +@property (nonatomic, assign) FBLikeControlHorizontalAlignment likeControlHorizontalAlignment; + +/*! + @abstract The style to use for the receiver. + + @see FBLikeControlStyle + */ +@property (nonatomic, assign) FBLikeControlStyle likeControlStyle; + +/*! + @abstract The objectID for the object to like. + + @discussion This value may be an Open Graph object ID or a string representation of an URL that describes an + Open Graph object. The objects may be public objects, like pages, or objects that are defined by your application. + */ +@property (nonatomic, copy) NSString *objectID; + +/*! + @abstract The preferred maximum width (in points) for autolayout. + + @discussion This property affects the size of the receiver when layout constraints are applied to it. During layout, + if the text extends beyond the width specified by this property, the additional text is flowed to one or more new + lines, thereby increasing the height of the receiver. + */ +@property (nonatomic, assign) CGFloat preferredMaxLayoutWidth; + +/*! + @abstract If YES, a sound is played when the receiver is toggled. + + @default YES + */ +@property (nonatomic, assign, getter = isSoundEnabled) BOOL soundEnabled; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLinkShareParams.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLinkShareParams.h new file mode 100755 index 0000000..22a6f1c --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLinkShareParams.h @@ -0,0 +1,81 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBDialogsParams.h" + +/*! + @class FBLinkShareParams + + @abstract + This object is used to encapsulate state for parameters to a share a link, + typically with the Facebook Native Share Dialog or the Message Dialog. + */ +@interface FBLinkShareParams : FBDialogsParams + +/*! @abstract The URL link to be attached to the post. Only "http" or "https" + schemes are supported. */ +@property (nonatomic, copy) NSURL *link; + +/*! @abstract The name, or title associated with the link. Is only used if the + link is non-nil. */ +@property (nonatomic, copy) NSString *name; + +/*! @abstract The caption to be used with the link. Is only used if the link is + non-nil. */ +@property (nonatomic, copy) NSString *caption; + +/*! @abstract The description associated with the link. Is only used if the + link is non-nil. */ +@property (nonatomic, copy) NSString *description; + +/*! @abstract The link to a thumbnail to associate with the post. Is only used + if the link is non-nil. Only "http" or "https" schemes are supported. Note that this + property should not be used to share photos; see the photos property. */ +@property (nonatomic, copy) NSURL *picture; + +/*! @abstract An array of NSStrings or FBGraphUsers to tag in the post. + If using NSStrings, the values must represent the IDs of the users to tag. */ +@property (nonatomic, copy) NSArray *friends; + +/*! @abstract An NSString or FBGraphPlace to tag in the status update. If + NSString, the value must be the ID of the place to tag. */ +@property (nonatomic, copy) id place; + +/*! @abstract A text reference for the category of the post, used on Facebook + Insights. */ +@property (nonatomic, copy) NSString *ref; + +/*! @abstract If YES, treats any data failures (e.g. failures when getting + data for IDs passed through "friends" or "place") as a fatal error, and will not + continue with the status update. */ +@property (nonatomic, assign) BOOL dataFailuresFatal; + +/*! + @abstract Designated initializer + @param link the required link to share + @param name the optional name to describe the share + @param caption the optional caption to describe the share + @param description the optional description to describe the share + @param picture the optional url to use as the share's image +*/ +- (instancetype)initWithLink:(NSURL *)link + name:(NSString *)name + caption:(NSString *)caption + description:(NSString *)description + picture:(NSURL *)picture; +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginDialog.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginDialog.h new file mode 100755 index 0000000..93528e7 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginDialog.h @@ -0,0 +1,48 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#import "FBDialog.h" + +@protocol FBLoginDialogDelegate; + +/** + * Do not use this interface directly, instead, use authorize in Facebook.h + * + * Facebook Login Dialog interface for start the facebook webView login dialog. + * It start pop-ups prompting for credentials and permissions. + */ + +@interface FBLoginDialog : FBDialog { + id _loginDelegate; +} + +- (instancetype)initWithURL:(NSString *)loginURL + loginParams:(NSMutableDictionary *)params + delegate:(id)delegate; +@end + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +@protocol FBLoginDialogDelegate + +- (void)fbDialogLogin:(NSString *)token expirationDate:(NSDate *)expirationDate params:(NSDictionary *)params; + +- (void)fbDialogNotLogin:(BOOL)cancelled; + +@end + + diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginTooltipView.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginTooltipView.h new file mode 100755 index 0000000..8f9fcbd --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginTooltipView.h @@ -0,0 +1,92 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBTooltipView.h" + +@protocol FBLoginTooltipViewDelegate; + +/*! + @class FBLoginTooltipView + + @abstract Represents a tooltip to be displayed next to a Facebook login button + to highlight features for new users. + + @discussion The `FBLoginView` may display this view automatically. If you do + not use the `FBLoginView`, you can manually call one of the `present*` methods + as appropriate and customize behavior via `FBLoginTooltipViewDelegate` delegate. + + By default, the `FBLoginTooltipView` is not added to the superview until it is + determined the app has migrated to the new login experience. You can override this + (e.g., to test the UI layout) by implementing the delegate or setting `forceDisplay` to YES. + + */ +@interface FBLoginTooltipView : FBTooltipView + +/*! @abstract the delegate */ +@property (nonatomic, assign) id delegate; + +/*! @abstract if set to YES, the view will always be displayed and the delegate's + `loginTooltipView:shouldAppear:` will NOT be called. */ +@property (nonatomic, assign) BOOL forceDisplay; + +@end + +/*! + @protocol + + @abstract + The `FBLoginTooltipViewDelegate` protocol defines the methods used to receive event + notifications from `FBLoginTooltipView` objects. + */ +@protocol FBLoginTooltipViewDelegate + +@optional + +/*! + @abstract + Asks the delegate if the tooltip view should appear + + @param view The tooltip view. + @param appIsEligible The value fetched from the server identifying if the app + is eligible for the new login experience. + + @discussion Use this method to customize display behavior. + */ +- (BOOL)loginTooltipView:(FBLoginTooltipView *)view shouldAppear:(BOOL)appIsEligible; + +/*! + @abstract + Tells the delegate the tooltip view will appear, specifically after it's been + added to the super view but before the fade in animation. + + @param view The tooltip view. + */ +- (void)loginTooltipViewWillAppear:(FBLoginTooltipView *)view; + +/*! + @abstract + Tells the delegate the tooltip view will not appear (i.e., was not + added to the super view). + + @param view The tooltip view. + */ +- (void)loginTooltipViewWillNotAppear:(FBLoginTooltipView *)view; + + +@end + diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginView.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginView.h new file mode 100755 index 0000000..8e2ed93 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginView.h @@ -0,0 +1,224 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphUser.h" +#import "FBSession.h" +#import "FBTooltipView.h" + +@protocol FBLoginViewDelegate; + +/*! + @typedef + @abstract Indicates the desired login tooltip behavior. + */ +typedef NS_ENUM(NSUInteger, FBLoginViewTooltipBehavior) { + /*! The default behavior. The tooltip will only be displayed if + the app is eligible (determined by server round trip) */ + FBLoginViewTooltipBehaviorDefault = 0, + /*! Force display of the tooltip (typically for UI testing) */ + FBLoginViewTooltipBehaviorForceDisplay = 1, + /*! Force disable. In this case you can still exert more refined + control by manually constructing a `FBLoginTooltipView` instance. */ + FBLoginViewTooltipBehaviorDisable = 2 +}; + +/*! + @class FBLoginView + @abstract FBLoginView is a custom UIView that renders a button to login or logout based on the + state of `FBSession.activeSession` + + @discussion This view is closely associated with `FBSession.activeSession`. Upon initialization, + it will attempt to open an active session without UI if the current active session is not open. + + The FBLoginView instance also monitors for changes to the active session. + + Please note: Since FBLoginView observes the active session, using multiple FBLoginView instances + in different parts of your app can result in each instance's delegates being notified of changes + for one event. + */ +@interface FBLoginView : UIView + +/*! + @abstract + The permissions to login with. Defaults to nil, meaning basic permissions. + + @discussion Methods and properties that specify permissions without a read or publish + qualification are deprecated; use of a read-qualified or publish-qualified alternative is preferred. + */ +@property (readwrite, copy) NSArray *permissions __attribute__((deprecated)); + +/*! + @abstract + The read permissions to request if the user logs in via this view. + + @discussion + Note, that if read permissions are specified, then publish permissions should not be specified. + */ +@property (nonatomic, copy) NSArray *readPermissions; + +/*! + @abstract + The publish permissions to request if the user logs in via this view. + + @discussion + Note, that a defaultAudience value of FBSessionDefaultAudienceOnlyMe, FBSessionDefaultAudienceEveryone, or + FBSessionDefaultAudienceFriends should be set if publish permissions are specified. Additionally, when publish + permissions are specified, then read should not be specified. + */ +@property (nonatomic, copy) NSArray *publishPermissions; + +/*! + @abstract + The default audience to use, if publish permissions are requested at login time. + */ +@property (nonatomic, assign) FBSessionDefaultAudience defaultAudience; + +/*! + @abstract + The login behavior for the active session if the user logs in via this view + + @discussion + The default value is FBSessionLoginBehaviorWithFallbackToWebView. + */ +@property (nonatomic) FBSessionLoginBehavior loginBehavior; + +/*! + @abstract + Gets or sets the desired tooltip behavior. + */ +@property (nonatomic, assign) FBLoginViewTooltipBehavior tooltipBehavior; + +/*! + @abstract + Gets or sets the desired tooltip color style. + */ +@property (nonatomic, assign) FBTooltipColorStyle tooltipColorStyle; + +/*! + @abstract + Initializes and returns an `FBLoginView` object. The underlying session has basic permissions granted to it. + */ +- (instancetype)init; + +/*! + @method + + @abstract + Initializes and returns an `FBLoginView` object constructed with the specified permissions. + + @param permissions An array of strings representing the permissions to request during the + authentication flow. A value of nil will indicates basic permissions. + + @discussion Methods and properties that specify permissions without a read or publish + qualification are deprecated; use of a read-qualified or publish-qualified alternative is preferred. + */ +- (instancetype)initWithPermissions:(NSArray *)permissions __attribute__((deprecated)); + +/*! + @method + + @abstract + Initializes and returns an `FBLoginView` object constructed with the specified permissions. + + @param readPermissions An array of strings representing the read permissions to request during the + authentication flow. A value of nil will indicates basic permissions. + + */ +- (instancetype)initWithReadPermissions:(NSArray *)readPermissions; + +/*! + @method + + @abstract + Initializes and returns an `FBLoginView` object constructed with the specified permissions. + + @param publishPermissions An array of strings representing the publish permissions to request during the + authentication flow. + + @param defaultAudience An audience for published posts; note that FBSessionDefaultAudienceNone is not valid + for permission requests that include publish or manage permissions. + + */ +- (instancetype)initWithPublishPermissions:(NSArray *)publishPermissions + defaultAudience:(FBSessionDefaultAudience)defaultAudience; + +/*! + @abstract + The delegate object that receives updates for selection and display control. + */ +@property (nonatomic, assign) IBOutlet id delegate; + +@end + +/*! + @protocol + + @abstract + The `FBLoginViewDelegate` protocol defines the methods used to receive event + notifications from `FBLoginView` objects. + + @discussion + Please note: Since FBLoginView observes the active session, using multiple FBLoginView instances + in different parts of your app can result in each instance's delegates being notified of changes + for one event. + */ +@protocol FBLoginViewDelegate + +@optional + +/*! + @abstract + Tells the delegate that the view is now in logged in mode + + @param loginView The login view that transitioned its view mode + */ +- (void)loginViewShowingLoggedInUser:(FBLoginView *)loginView; + +/*! + @abstract + Tells the delegate that the view is has now fetched user info + + @param loginView The login view that transitioned its view mode + + @param user The user info object describing the logged in user + */ +- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView + user:(id)user; + +/*! + @abstract + Tells the delegate that the view is now in logged out mode + + @param loginView The login view that transitioned its view mode + */ +- (void)loginViewShowingLoggedOutUser:(FBLoginView *)loginView; + +/*! + @abstract + Tells the delegate that there is a communication or authorization error. + + @param loginView The login view that transitioned its view mode + @param error An error object containing details of the error. + @discussion See https://developers.facebook.com/docs/technical-guides/iossdk/errors/ + for error handling best practices. + */ +- (void)loginView:(FBLoginView *)loginView + handleError:(NSError *)error; + +@end + diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBNativeDialogs.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBNativeDialogs.h new file mode 100755 index 0000000..a6c79f1 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBNativeDialogs.h @@ -0,0 +1,109 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBAppCall.h" +#import "FBOpenGraphActionShareDialogParams.h" +#import "FBShareDialogParams.h" + +@class FBSession; +@protocol FBOpenGraphAction; + +// note that the following class and types are deprecated in favor of FBDialogs and its methods + +/*! + @typedef FBNativeDialogResult enum + + @abstract + Please note that this enum and its related methods have been deprecated, please migrate your + code to use `FBOSIntegratedShareDialogResult` and its related methods. + */ +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 could not be shown (because not on ios6 or ios6 auth was not used). */ + FBNativeDialogResultError +} FBNativeDialogResult +__attribute__((deprecated)); + +/*! + @typedef + + @abstract + Please note that `FBShareDialogHandler` and its related methods have been deprecated, please migrate your + code to use `FBOSIntegratedShareDialogHandler` and its related methods. + */ +typedef void (^FBShareDialogHandler)(FBNativeDialogResult result, NSError *error) +__attribute__((deprecated)); + +/*! + @class FBNativeDialogs + + @abstract + Please note that `FBNativeDialogs` has been deprecated, please migrate your + code to use `FBDialogs`. + */ +@interface FBNativeDialogs : NSObject + +/*! + @abstract + Please note that this method has been deprecated, please migrate your + code to use `FBDialogs` and the related method `presentOSIntegratedShareDialogModallyFrom`. + */ ++ (BOOL)presentShareDialogModallyFrom:(UIViewController *)viewController + initialText:(NSString *)initialText + image:(UIImage *)image + url:(NSURL *)url + handler:(FBShareDialogHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Please note that this method has been deprecated, please migrate your + code to use `FBDialogs` and the related method `presentOSIntegratedShareDialogModallyFrom`. + */ ++ (BOOL)presentShareDialogModallyFrom:(UIViewController *)viewController + initialText:(NSString *)initialText + images:(NSArray *)images + urls:(NSArray *)urls + handler:(FBShareDialogHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Please note that this method has been deprecated, please migrate your + code to use `FBDialogs` and the related method `presentOSIntegratedShareDialogModallyFrom`. + */ ++ (BOOL)presentShareDialogModallyFrom:(UIViewController *)viewController + session:(FBSession *)session + initialText:(NSString *)initialText + images:(NSArray *)images + urls:(NSArray *)urls + handler:(FBShareDialogHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Please note that this method has been deprecated, please migrate your + code to use `FBDialogs` and the related method `canPresentOSIntegratedShareDialogWithSession`. + */ ++ (BOOL)canPresentShareDialogWithSession:(FBSession *)session __attribute__((deprecated)); + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphAction.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphAction.h new file mode 100755 index 0000000..adc5ef4 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphAction.h @@ -0,0 +1,128 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphObject.h" + +@protocol FBGraphPlace; +@protocol FBGraphUser; + +/*! + @protocol + + @abstract + The `FBOpenGraphAction` protocol is the base protocol for use in posting and retrieving Open Graph actions. + It inherits from the `FBGraphObject` protocol; you may derive custome protocols from `FBOpenGraphAction` in order + implement typed access to your application's custom actions. + + @discussion + Represents an Open Graph custom action, to be used directly, or from which to + derive custom action protocols with custom properties. + */ +@protocol FBOpenGraphAction + +/*! + @property + @abstract Typed access to action's id + */ +@property (retain, nonatomic) NSString *id; + +/*! + @property + @abstract Typed access to action's start time + */ +@property (retain, nonatomic) NSString *start_time; + +/*! + @property + @abstract Typed access to action's end time + */ +@property (retain, nonatomic) NSString *end_time; + +/*! + @property + @abstract Typed access to action's publication time + */ +@property (retain, nonatomic) NSString *publish_time; + +/*! + @property + @abstract Typed access to action's creation time + */ +@property (retain, nonatomic) NSString *created_time; + +/*! + @property + @abstract Typed access to action's expiration time + */ +@property (retain, nonatomic) NSString *expires_time; + +/*! + @property + @abstract Typed access to action's ref + */ +@property (retain, nonatomic) NSString *ref; + +/*! + @property + @abstract Typed access to action's user message + */ +@property (retain, nonatomic) NSString *message; + +/*! + @property + @abstract Typed access to action's place + */ +@property (retain, nonatomic) id place; + +/*! + @property + @abstract Typed access to action's tags + */ +@property (retain, nonatomic) NSArray *tags; + +/*! + @property + @abstract Typed access to action's image(s) + */ +@property (retain, nonatomic) id image; + +/*! + @property + @abstract Typed access to action's from-user + */ +@property (retain, nonatomic) id from; + +/*! + @property + @abstract Typed access to action's likes + */ +@property (retain, nonatomic) NSArray *likes; + +/*! + @property + @abstract Typed access to action's application + */ +@property (retain, nonatomic) id application; + +/*! + @property + @abstract Typed access to action's comments + */ +@property (retain, nonatomic) NSArray *comments; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphActionParams.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphActionParams.h new file mode 100755 index 0000000..b96ee0c --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphActionParams.h @@ -0,0 +1,54 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBDialogsParams.h" +#import "FBOpenGraphAction.h" +#import "FBSDKMacros.h" + +FBSDK_EXTERN NSString *const FBPostObject; + +/*! + @class FBOpenGraphActionParams + + @abstract + This object is used to encapsulate state for parameters to an Open Graph share, + typically used with the Native Share Dialog or Message Dialog. + */ +@interface FBOpenGraphActionParams : FBDialogsParams + +/*! @abstract The Open Graph action to be published. */ +@property (nonatomic, retain) id action; + +/*! @abstract The name of the property representing the primary target of the Open + Graph action, which will be displayed as a preview in the dialog. */ +@property (nonatomic, copy) NSString *previewPropertyName; + +/*! @abstract The fully qualified type of the Open Graph action. */ +@property (nonatomic, copy) NSString *actionType; + +/*! + @abstract Designated initializer + @param action The action object, typically a dictionary based object created + from `[FBGraphObject openGraphActionForPost]`. + @param actionType The open graph action type defined in your application settings. + Typically, either a common open graph type like "books.reads", or a custom ":". + @param previewPropertyName The identifier for object in the open graph action. For example, for books.reads + this would be "book". +*/ +- (instancetype)initWithAction:(id)action actionType:(NSString *)actionType previewPropertyName:(NSString *)previewPropertyName; +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphActionShareDialogParams.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphActionShareDialogParams.h new file mode 100755 index 0000000..19f11a9 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphActionShareDialogParams.h @@ -0,0 +1,29 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBOpenGraphActionParams.h" + +/*! + @class FBOpenGraphActionShareDialogParams + + @abstract Deprecated. Use `FBOpenGraphActionParams` instead. + */ +__attribute__((deprecated)) +@interface FBOpenGraphActionShareDialogParams : FBOpenGraphActionParams + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphObject.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphObject.h new file mode 100755 index 0000000..be73a3b --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphObject.h @@ -0,0 +1,77 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphObject.h" + +/*! + @protocol + + @abstract + The `FBOpenGraphObject` protocol is the base protocol for use in posting and retrieving Open Graph objects. + It inherits from the `FBGraphObject` protocol; you may derive custome protocols from `FBOpenGraphObject` in order + implement typed access to your application's custom objects. + + @discussion + Represents an Open Graph custom object, to be used directly, or from which to + derive custom action protocols with custom properties. + */ +@protocol FBOpenGraphObject + +/*! + @property + @abstract Typed access to the object's id + */ +@property (retain, nonatomic) NSString *id; + +/*! + @property + @abstract Typed access to the object's type, which is a string in the form mynamespace:mytype + */ +@property (retain, nonatomic) NSString *type; + +/*! + @property + @abstract Typed access to object's title + */ +@property (retain, nonatomic) NSString *title; + +/*! + @property + @abstract Typed access to the object's image property + */ +@property (retain, nonatomic) id image; + +/*! + @property + @abstract Typed access to the object's url property + */ +@property (retain, nonatomic) id url; + +/*! + @property + @abstract Typed access to the object's description property + */ +@property (retain, nonatomic) id description; + +/*! + @property + @abstract Typed access to action's data, which is a dictionary of custom properties + */ +@property (retain, nonatomic) id data; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBPhotoParams.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBPhotoParams.h new file mode 100755 index 0000000..4c389fd --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBPhotoParams.h @@ -0,0 +1,51 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBDialogsParams.h" + +/*! + @class FBPhotoParams + + @abstract + This object is used to encapsulate state for parameters to share photos, + typically with the Facebook Native Share Dialog or Message Dialog + */ +@interface FBPhotoParams : FBDialogsParams + +/*! @abstract An array of NSStrings or FBGraphUsers to tag in the post. + If using NSStrings, the values must represent the IDs of the users to tag. */ +@property (nonatomic, copy) NSArray *friends; + +/*! @abstract An NSString or FBGraphPlace to tag in the status update. If + NSString, the value must be the ID of the place to tag. */ +@property (nonatomic, copy) id place; + +/*! @abstract If YES, treats any data failures (e.g. failures when getting + data for IDs passed through "friends" or "place") as a fatal error, and will not + continue with the status update. */ +@property (nonatomic, assign) BOOL dataFailuresFatal; + +/*! @abstract An array of UIImages representing photos to be shared. Only + six or fewer images are supported. */ +@property (nonatomic, copy) NSArray *photos; + +/*! @abstract Designated initializer. + @param photos the array of UIImages +*/ +- (instancetype)initWithPhotos:(NSArray *)photos; +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBPlacePickerViewController.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBPlacePickerViewController.h new file mode 100755 index 0000000..3d8c6f0 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBPlacePickerViewController.h @@ -0,0 +1,258 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBCacheDescriptor.h" +#import "FBGraphPlace.h" +#import "FBSession.h" +#import "FBViewController.h" + +@protocol FBPlacePickerDelegate; + +/*! + @class FBPlacePickerViewController + + @abstract + The `FBPlacePickerViewController` class creates a controller object that manages + the user interface for displaying and selecting nearby places. + + @discussion + When the `FBPlacePickerViewController` view loads it creates a `UITableView` object + where the places near a given location will be displayed. You can access this view + through the `tableView` property. + + The place data can be pre-fetched and cached prior to using the view controller. The + cache is setup using an object that can trigger the + data fetch. Any place data requests will first check the cache and use that data. + If the place picker is being displayed cached data will initially be shown before + a fresh copy is retrieved. + + The `delegate` property may be set to an object that conforms to the + protocol. The `delegate` object will receive updates related to place selection and + data changes. The delegate can also be used to filter the places to display in the + picker. + */ +@interface FBPlacePickerViewController : FBViewController + +/*! + @abstract + Returns an outlet for the spinner used in the view controller. + */ +@property (nonatomic, retain) IBOutlet UIActivityIndicatorView *spinner; + +/*! + @abstract + Returns an outlet for the table view managed by the view controller. + */ +@property (nonatomic, retain) IBOutlet UITableView *tableView; + +/*! + @abstract + Addtional fields to fetch when making the Graph API call to get place data. + */ +@property (nonatomic, copy) NSSet *fieldsForRequest; + +/*! + @abstract + A Boolean value that indicates whether place profile pictures are displayed. + */ +@property (nonatomic) BOOL itemPicturesEnabled; + +/*! + @abstract + The coordinates to use for place discovery. + */ +@property (nonatomic) CLLocationCoordinate2D locationCoordinate; + +/*! + @abstract + The radius to use for place discovery. + */ +@property (nonatomic) NSInteger radiusInMeters; + +/*! + @abstract + The maximum number of places to fetch. + */ +@property (nonatomic) NSInteger resultsLimit; + +/*! + @abstract + The search words used to narrow down the results returned. + */ +@property (nonatomic, copy) NSString *searchText; + +/*! + @abstract + The session that is used in the request for place data. + */ +@property (nonatomic, retain) FBSession *session; + +/*! + @abstract + The place that is currently selected in the view. This is nil + if nothing is selected. + */ +@property (nonatomic, retain, readonly) id selection; + +/*! + @abstract + Clears the current selection, so the picker is ready for a fresh use. + */ +- (void)clearSelection; + +/*! + @abstract + Initializes a place picker view controller. + */ +- (instancetype)init; + +/*! + @abstract + Initializes a place picker view controller. + + @param aDecoder An unarchiver object. + */ +- (instancetype)initWithCoder:(NSCoder *)aDecoder; + +/*! + @abstract + Initializes a place picker view controller. + + @param nibNameOrNil The name of the nib file to associate with the view controller. The nib file name should not contain any leading path information. If you specify nil, the nibName property is set to nil. + @param nibBundleOrNil The bundle in which to search for the nib file. This method looks for the nib file in the bundle's language-specific project directories first, followed by the Resources directory. If nil, this method looks for the nib file in the main bundle. + */ +- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil; + +/*! + @abstract + Configures the properties used in the caching data queries. + + @discussion + Cache descriptors are used to fetch and cache the data used by the view controller. + If the view controller finds a cached copy of the data, it will + first display the cached content then fetch a fresh copy from the server. + + @param cacheDescriptor The containing the cache query properties. + */ +- (void)configureUsingCachedDescriptor:(FBCacheDescriptor *)cacheDescriptor; + +/*! + @abstract + Initiates a query to get place data the first time or in response to changes in + the search criteria, filter, or location information. + + + @discussion + A cached copy will be returned if available. The cached view is temporary until a fresh copy is + retrieved from the server. It is legal to call this more than once. + */ +- (void)loadData; + +/*! + @abstract + Updates the view locally without fetching data from the server or from cache. + + @discussion + Use this if the filter properties change. This may affect the order or + display of information. + */ +- (void)updateView; + +/*! + @method + + @abstract + Creates a cache descriptor with additional fields and a profile ID for use with the + `FBPlacePickerViewController` object. + + @discussion + An `FBCacheDescriptor` object may be used to pre-fetch data before it is used by + the view controller. It may also be used to configure the `FBPlacePickerViewController` + object. + + @param locationCoordinate The coordinates to use for place discovery. + @param radiusInMeters The radius to use for place discovery. + @param searchText The search words used to narrow down the results returned. + @param resultsLimit The maximum number of places to fetch. + @param fieldsForRequest Addtional fields to fetch when making the Graph API call to get place data. + */ ++ (FBCacheDescriptor *)cacheDescriptorWithLocationCoordinate:(CLLocationCoordinate2D)locationCoordinate + radiusInMeters:(NSInteger)radiusInMeters + searchText:(NSString *)searchText + resultsLimit:(NSInteger)resultsLimit + fieldsForRequest:(NSSet *)fieldsForRequest; + +@end + +/*! + @protocol + + @abstract + The `FBPlacePickerDelegate` protocol defines the methods used to receive event + notifications and allow for deeper control of the + view. + */ +@protocol FBPlacePickerDelegate +@optional + +/*! + @abstract + Tells the delegate that data has been loaded. + + @discussion + The object's `tableView` property is automatically + reloaded when this happens. However, if another table view, for example the + `UISearchBar` is showing data, then it may also need to be reloaded. + + @param placePicker The place picker view controller whose data changed. + */ +- (void)placePickerViewControllerDataDidChange:(FBPlacePickerViewController *)placePicker; + +/*! + @abstract + Tells the delegate that the selection has changed. + + @param placePicker The place picker view controller whose selection changed. + */ +- (void)placePickerViewControllerSelectionDidChange:(FBPlacePickerViewController *)placePicker; + +/*! + @abstract + Asks the delegate whether to include a place in the list. + + @discussion + This can be used to implement a search bar that filters the places list. + + @param placePicker The place picker view controller that is requesting this information. + @param place An object representing the place. + */ +- (BOOL)placePickerViewController:(FBPlacePickerViewController *)placePicker + shouldIncludePlace:(id)place; + +/*! + @abstract + Called if there is a communication error. + + @param placePicker The place picker view controller that encountered the error. + @param error An error object containing details of the error. + */ +- (void)placePickerViewController:(FBPlacePickerViewController *)placePicker + handleError:(NSError *)error; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBProfilePictureView.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBProfilePictureView.h new file mode 100755 index 0000000..8859dea --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBProfilePictureView.h @@ -0,0 +1,79 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/*! + @typedef FBProfilePictureCropping enum + + @abstract + Type used to specify the cropping treatment of the profile picture. + + @discussion + */ +typedef enum { + + /*! Square (default) - the square version that the Facebook user defined. */ + FBProfilePictureCroppingSquare = 0, + + /*! Original - the original profile picture, as uploaded. */ + FBProfilePictureCroppingOriginal = 1 + +} FBProfilePictureCropping; + +/*! + @class + @abstract + An instance of `FBProfilePictureView` is used to display a profile picture. + + The default behavior of this control is to center the profile picture + in the view and shrinks it, if necessary, to the view's bounds, preserving the aspect ratio. The smallest + possible image is downloaded to ensure that scaling up never happens. Resizing the view may result in + a different size of the image being loaded. Canonical image sizes are documented in the "Pictures" section + of https://developers.facebook.com/docs/reference/api. + */ +@interface FBProfilePictureView : UIView + +/*! + @abstract + The Facebook ID of the user, place or object for which a picture should be fetched and displayed. + */ +@property (copy, nonatomic) NSString *profileID; + +/*! + @abstract + The cropping to use for the profile picture. + */ +@property (nonatomic) FBProfilePictureCropping pictureCropping; + +/*! + @abstract + Initializes and returns a profile view object. + */ +- (instancetype)init; + + +/*! + @abstract + Initializes and returns a profile view object for the given Facebook ID and cropping. + + @param profileID The Facebook ID of the user, place or object for which a picture should be fetched and displayed. + @param pictureCropping The cropping to use for the profile picture. + */ +- (instancetype)initWithProfileID:(NSString *)profileID + pictureCropping:(FBProfilePictureCropping)pictureCropping; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBRequest.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBRequest.h new file mode 100755 index 0000000..719f267 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBRequest.h @@ -0,0 +1,690 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBGraphObject.h" +#import "FBOpenGraphAction.h" +#import "FBOpenGraphObject.h" +#import "FBRequestConnection.h" +#import "FBSDKMacros.h" + +/*! The base URL used for graph requests */ +FBSDK_EXTERN NSString *const FBGraphBasePath __attribute__((deprecated)); + +// up-front decl's +@protocol FBRequestDelegate; +@class FBSession; +@class UIImage; + +/*! + @typedef FBRequestState + + @abstract + Deprecated - do not use in new code. + + @discussion + FBRequestState is retained from earlier versions of the SDK to give existing + apps time to remove dependency on this. + + @deprecated + */ +typedef NSUInteger FBRequestState __attribute__((deprecated)); + +/*! + @class FBRequest + + @abstract + The `FBRequest` object is used to setup and manage requests to Facebook Graph + and REST APIs. This class provides helper methods that simplify the connection + and response handling. + + @discussion + An object is required for all authenticated uses of `FBRequest`. + Requests that do not require an unauthenticated user are also supported and + do not require an object to be passed in. + + An instance of `FBRequest` represents the arguments and setup for a connection + to Facebook. After creating an `FBRequest` object it can be used to setup a + connection to Facebook through the object. The + object is created to manage a single connection. To + cancel a connection use the instance method in the class. + + An `FBRequest` object may be reused to issue multiple connections to Facebook. + However each instance will manage one connection. + + Class and instance methods prefixed with **start* ** can be used to perform the + request setup and initiate the connection in a single call. + + */ +@interface FBRequest : NSObject { +@private + id _delegate; + NSString * _url; + NSString * _versionPart; + NSURLConnection * _connection; + NSMutableData * _responseText; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + FBRequestState _state; +#pragma GCC diagnostic pop + NSError * _error; + BOOL _sessionDidExpire; + id _graphObject; +} + +/*! + @methodgroup Creating a request + + @method + Calls with the default parameters. + */ +- (instancetype)init; + +/*! + @method + Calls with default parameters + except for the ones provided to this method. + + @param session The session object representing the identity of the Facebook user making + the request. A nil value indicates a request that requires no token; to + use the active session pass `[FBSession activeSession]`. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + */ +- (instancetype)initWithSession:(FBSession *)session + graphPath:(NSString *)graphPath; + +/*! + @method + + @abstract + Initializes an `FBRequest` object for a Graph API request call. + + @discussion + Note that this only sets properties on the `FBRequest` object. + + To send the request, initialize an object, add this request, + and send <[FBRequestConnection start]>. See other methods on this + class for shortcuts to simplify this process. + + @param session The session object representing the identity of the Facebook user making + the request. A nil value indicates a request that requires no token; to + use the active session pass `[FBSession activeSession]`. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param parameters The parameters for the request. A value of nil sends only the automatically handled + parameters, for example, the access token. The default is nil. + + @param HTTPMethod The HTTP method to use for the request. The default is value of nil implies a GET. + */ +- (instancetype)initWithSession:(FBSession *)session + graphPath:(NSString *)graphPath + parameters:(NSDictionary *)parameters + HTTPMethod:(NSString *)HTTPMethod; + +/*! + @method + @abstract + Initialize a `FBRequest` object that will do a graph request. + + @discussion + Note that this only sets properties on the `FBRequest`. + + To send the request, initialize a , add this request, + and send <[FBRequestConnection start]>. See other methods on this + class for shortcuts to simplify this process. + + @param session The session object representing the identity of the Facebook user making + the request. A nil value indicates a request that requires no token; to + use the active session pass `[FBSession activeSession]`. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param graphObject An object or open graph action to post. + */ +- (instancetype)initForPostWithSession:(FBSession *)session + graphPath:(NSString *)graphPath + graphObject:(id)graphObject; + +/*! + @method + @abstract + Initialize a `FBRequest` object that will do a rest API request. + + @discussion + Prefer to use graph requests instead of this where possible. + + Note that this only sets properties on the `FBRequest`. + + To send the request, initialize a , add this request, + and send <[FBRequestConnection start]>. See other methods on this + class for shortcuts to simplify this process. + + @param session The session object representing the identity of the Facebook user making + the request. A nil value indicates a request that requires no token; to + use the active session pass `[FBSession activeSession]`. + + @param restMethod A valid REST API method. + + @param parameters The parameters for the request. A value of nil sends only the automatically handled + parameters, for example, the access token. The default is nil. + + @param HTTPMethod The HTTP method to use for the request. The default is value of nil implies a GET. + + */ +- (instancetype)initWithSession:(FBSession *)session + restMethod:(NSString *)restMethod + parameters:(NSDictionary *)parameters + HTTPMethod:(NSString *)HTTPMethod; + +/*! + @abstract + The parameters for the request. + + @discussion + May be used to read the parameters that were automatically set during + the object initiliazation. Make any required modifications prior to + sending the request. + + `NSString` parameters are used to generate URL parameter values or JSON + parameters. `NSData` and `UIImage` parameters are added as attachments + to the HTTP body and referenced by name in the URL and/or JSON. + */ +@property (nonatomic, retain, readonly) NSMutableDictionary *parameters; + +/*! + @abstract + The session object to use for the request. + + @discussion + May be used to read the session that was automatically set during + the object initiliazation. Make any required modifications prior to + sending the request. + */ +@property (nonatomic, retain) FBSession *session; + +/*! + @abstract + The Graph API endpoint to use for the request, for example "me". + + @discussion + May be used to read the Graph API endpoint that was automatically set during + the object initiliazation. Make any required modifications prior to + sending the request. + */ +@property (nonatomic, copy) NSString *graphPath; + +/*! + @abstract + A valid REST API method. + + @discussion + May be used to read the REST method that was automatically set during + the object initiliazation. Make any required modifications prior to + sending the request. + + Use the Graph API equivalent of the API if it exists as the REST API + method is deprecated if there is a Graph API equivalent. + */ +@property (nonatomic, copy) NSString *restMethod; + +/*! + @abstract + The HTTPMethod to use for the request, for example "GET" or "POST". + + @discussion + May be used to read the HTTP method that was automatically set during + the object initiliazation. Make any required modifications prior to + sending the request. + */ +@property (nonatomic, copy) NSString *HTTPMethod; + +/*! + @abstract + The graph object to post with the request. + + @discussion + May be used to read the graph object that was automatically set during + the object initiliazation. Make any required modifications prior to + sending the request. + */ +@property (nonatomic, retain) id graphObject; + +/*! + @methodgroup Instance methods + */ + +/*! + @method + + @abstract + Overrides the default version for a single request + + @discussion + The SDK automatically prepends a version part, such as "v2.0" to API paths in order to simplify API versioning + for applications. Sometimes it is preferable to explicitly set the version for a request, which can be + accomplished in one of two ways. The first is to call this method and set an override version part. The second + is approach is to include the version part in the api path, for example @"v2.0/me/friends" + + @param version This is a string in the form @"v2.0" which will be used for the version part of an API path + */ +- (void)overrideVersionPartWith:(NSString *)version; + +/*! + @method + + @abstract + Starts a connection to the Facebook API. + + @discussion + This is used to start an API call to Facebook and call the block when the + request completes with a success, error, or cancel. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + The handler will be invoked on the main thread. + */ +- (FBRequestConnection *)startWithCompletionHandler:(FBRequestHandler)handler; + +/*! + @methodgroup FBRequestConnection start methods + + @abstract + These methods start an . + + @discussion + These methods simplify the process of preparing a request and starting + the connection. The methods handle initializing an `FBRequest` object, + initializing a object, adding the `FBRequest` + object to the to the , and finally starting the + connection. + */ + +/*! + @methodgroup FBRequest factory methods + + @abstract + These methods initialize a `FBRequest` for common scenarios. + + @discussion + These simplify the process of preparing a request to send. These + initialize a `FBRequest` based on strongly typed parameters that are + specific to the scenario. + + These method do not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + */ + +// request +// +// Summary: +// Helper methods used to create common request objects which can be used to create single or batch connections +// +// session: - the session object representing the identity of the +// Facebook user making the request; nil implies an +// unauthenticated request; default=nil + +/*! + @method + + @abstract + Creates a request representing a Graph API call to the "me" endpoint, using the active session. + + @discussion + Simplifies preparing a request to retrieve the user's identity. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + A successful Graph API call will return an object representing the + user's identity. + + Note you may change the session property after construction if a session other than + the active session is preferred. + */ ++ (FBRequest *)requestForMe; + +/*! + @method + + @abstract + Creates a request representing a Graph API call to the "me/friends" endpoint using the active session. + + @discussion + Simplifies preparing a request to retrieve the user's friends. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + A successful Graph API call will return an array of objects representing the + user's friends. + */ ++ (FBRequest *)requestForMyFriends; + +/*! + @method + + @abstract + Creates a request representing a Graph API call to upload a photo to the app's album using the active session. + + @discussion + Simplifies preparing a request to post a photo. + + To post a photo to a specific album, get the `FBRequest` returned from this method + call, then modify the request parameters by adding the album ID to an "album" key. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param photo A `UIImage` for the photo to upload. + */ ++ (FBRequest *)requestForUploadPhoto:(UIImage *)photo; + +/*! + @method + + @abstract + Creates a request representing a status update. + + @discussion + Simplifies preparing a request to post a status update. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param message The message to post. + */ ++ (FBRequest *)requestForPostStatusUpdate:(NSString *)message; + +/*! + @method + + @abstract + Creates a request representing a status update. + + @discussion + Simplifies preparing a request to post a status update. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param message The message to post. + @param place The place to checkin with, or nil. Place may be an fbid or a + graph object representing a place. + @param tags Array of friends to tag in the status update, each element + may be an fbid or a graph object representing a user. + */ ++ (FBRequest *)requestForPostStatusUpdate:(NSString *)message + place:(id)place + tags:(id)tags; + +/*! + @method + + @abstract + Creates a request representing a Graph API call to the "search" endpoint + for a given location using the active session. + + @discussion + Simplifies preparing a request to search for places near a coordinate. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + A successful Graph API call will return an array of objects representing + the nearby locations. + + @param coordinate The search coordinates. + + @param radius The search radius in meters. + + @param limit The maxiumum number of results to return. It is + possible to receive fewer than this because of the radius and because of server limits. + + @param searchText The text to use in the query to narrow the set of places + returned. + */ ++ (FBRequest *)requestForPlacesSearchAtCoordinate:(CLLocationCoordinate2D)coordinate + radiusInMeters:(NSInteger)radius + resultsLimit:(NSInteger)limit + searchText:(NSString *)searchText; + +/*! + @method + + @abstract + Creates a request representing the Graph API call to retrieve a Custom Audience "thirdy party ID" for the app's Facebook user. + Callers will send this ID back to their own servers, collect up a set to create a Facebook Custom Audience with, + and then use the resultant Custom Audience to target ads. + + @param session The FBSession to use to establish the user's identity for users logged into Facebook through this app. + If `nil`, then the activeSession is used. + + @discussion + This method will throw an exception if <[FBSettings defaultAppID]> is `nil`. The appID won't be nil when the pList + includes the appID, or if it's explicitly set. + + The JSON in the request's response will include an "custom_audience_third_party_id" key/value pair, with the value being the ID retrieved. + This ID is an encrypted encoding of the Facebook user's ID and the invoking Facebook app ID. + Multiple calls with the same user will return different IDs, thus these IDs cannot be used to correlate behavior + across devices or applications, and are only meaningful when sent back to Facebook for creating Custom Audiences. + + The ID retrieved represents the Facebook user identified in the following way: if the specified session (or activeSession if the specified + session is `nil`) is open, the ID will represent the user associated with the activeSession; otherwise the ID will represent the user logged into the + native Facebook app on the device. If there is no native Facebook app, no one is logged into it, or the user has opted out + at the iOS level from ad tracking, then a `nil` ID will be returned. + + This method returns `nil` if either the user has opted-out (via iOS) from Ad Tracking, the app itself has limited event usage + via the `[FBAppEvents setLimitEventUsage]` flag, or a specific Facebook user cannot be identified. + */ ++ (FBRequest *)requestForCustomAudienceThirdPartyID:(FBSession *)session; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to make a Graph API call for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + */ ++ (FBRequest *)requestForGraphPath:(NSString *)graphPath; + +/*! + @method + + @abstract + Creates request representing a DELETE to a object. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param object This can be an NSString, NSNumber or NSDictionary representing an object to delete + */ ++ (FBRequest *)requestForDeleteObject:(id)object; + +/*! + @method + + @abstract + Creates a request representing a POST for a graph object. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param graphObject An object or open graph action to post. + + @discussion This method is typically used for posting an open graph action. If you are only + posting an open graph object (without an action), consider using `requestForPostOpenGraphObject:` + */ ++ (FBRequest *)requestForPostWithGraphPath:(NSString *)graphPath + graphObject:(id)graphObject; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to make a Graph API call for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param parameters The parameters for the request. A value of nil sends only the automatically handled parameters, for example, the access token. The default is nil. + + @param HTTPMethod The HTTP method to use for the request. A nil value implies a GET. + */ ++ (FBRequest *)requestWithGraphPath:(NSString *)graphPath + parameters:(NSDictionary *)parameters + HTTPMethod:(NSString *)HTTPMethod; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to create a user owned + Open Graph object for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param object The Open Graph object to create. Some common expected fields include "title", "image", "url", etc. + */ ++ (FBRequest *)requestForPostOpenGraphObject:(id)object; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to create a user owned + Open Graph object for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param type The fully-specified Open Graph object type (e.g., my_app_namespace:my_object_name) + @param title The title of the Open Graph object. + @param image The link to an image to be associated with the Open Graph object. + @param url The url to be associated with the Open Graph object. + @param description The description to be associated with the object. + @param objectProperties Any additional properties for the Open Graph object. + */ ++ (FBRequest *)requestForPostOpenGraphObjectWithType:(NSString *)type + title:(NSString *)title + image:(id)image + url:(id)url + description:(NSString *)description + objectProperties:(NSDictionary *)objectProperties; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to update a user owned + Open Graph object for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param object The Open Graph object to update the existing object with. + */ ++ (FBRequest *)requestForUpdateOpenGraphObject:(id)object; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to update a user owned + Open Graph object for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param objectId The id of the Open Graph object to update. + @param title The updated title of the Open Graph object. + @param image The updated link to an image to be associated with the Open Graph object. + @param url The updated url to be associated with the Open Graph object. + @param description The updated description of the Open Graph object. + @param objectProperties Any additional properties to update for the Open Graph object. + */ ++ (FBRequest *)requestForUpdateOpenGraphObjectWithId:(id)objectId + title:(NSString *)title + image:(id)image + url:(id)url + description:(NSString *)description + objectProperties:(NSDictionary *)objectProperties; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to upload an image + to create a staging resource. Staging resources allow you to post binary data + such as images, in preparation for a post of an open graph object or action + which references the image. The URI returned when uploading a staging resource + may be passed as the image property for an open graph object or action. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param image A `UIImage` for the image to upload. + */ ++ (FBRequest *)requestForUploadStagingResourceWithImage:(UIImage *)image; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBRequestConnection.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBRequestConnection.h new file mode 100755 index 0000000..1d3a149 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBRequestConnection.h @@ -0,0 +1,627 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBGraphObject.h" +#import "FBSDKMacros.h" + +// up-front decl's +@class FBRequest; +@class FBRequestConnection; +@class FBSession; +@class UIImage; + + +/*! + @attribute beta true + + @typedef FBRequestConnectionErrorBehavior enum + + @abstract Describes what automatic error handling behaviors to provide (if any). + + @discussion This is a bitflag enum that can be composed of different values. + + See FBError.h and FBErrorUtility.h for error category and user message details. + */ +typedef enum { + /*! The default behavior of none */ + FBRequestConnectionErrorBehaviorNone = 0, + + /*! This will retry any requests whose error category is classified as `FBErrorCategoryRetry`. + If the retry fails, the normal handler is invoked. */ + FBRequestConnectionErrorBehaviorRetry = 1, + + /*! This will automatically surface any SDK provided userMessage (at most one), after + retry attempts, but before any reconnects are tried. The alert will have one button + whose text can be localized with the key "FBE:AlertMessageButton". + + You should not display your own alert views in your request handler when specifying this + behavior. + */ + FBRequestConnectionErrorBehaviorAlertUser = 2, + + /*! This will automatically reconnect a session if the request failed due to an invalid token + that would otherwise close the session (such as an expired token or password change). Note + this will NOT reconnect a session if the user had uninstalled the app, or if the user had + disabled the app's slider in their privacy settings (in cases of iOS 6 system auth). + If the session is reconnected, this will transition the session state to FBSessionStateTokenExtended + which will invoke any state change handlers. Otherwise, the session is closed as normal. + + This behavior should not be used if the FBRequestConnection contains multiple + session instances. Further, when this behavior is used, you must not request new permissions + for the session until the connection is completed. + + Lastly, you should avoid using additional FBRequestConnections with the same session because + that will be subject to race conditions. + */ + FBRequestConnectionErrorBehaviorReconnectSession = 4, +} FBRequestConnectionErrorBehavior; + +/*! + Normally requests return JSON data that is parsed into a set of `NSDictionary` + and `NSArray` objects. + + When a request returns a non-JSON response, that response is packaged in + a `NSDictionary` using FBNonJSONResponseProperty as the key and the literal + response as the value. + */ +FBSDK_EXTERN NSString *const FBNonJSONResponseProperty; + +/*! + @typedef FBRequestHandler + + @abstract + A block that is passed to addRequest to register for a callback with the results of that + request once the connection completes. + + @discussion + Pass a block of this type when calling addRequest. This will be called once + the request completes. The call occurs on the UI thread. + + @param connection The `FBRequestConnection` that sent the request. + + @param result The result of the request. This is a translation of + JSON data to `NSDictionary` and `NSArray` objects. This + is nil if there was an error. + + @param error The `NSError` representing any error that occurred. + + */ +typedef void (^FBRequestHandler)(FBRequestConnection *connection, + id result, + NSError *error); + +/*! + @class FBRequestConnection + + @abstract + The `FBRequestConnection` represents a single connection to Facebook to service a request. + + @discussion + The request settings are encapsulated in a reusable object. The + `FBRequestConnection` object encapsulates the concerns of a single communication + e.g. starting a connection, canceling a connection, or batching requests. + + */ +@interface FBRequestConnection : NSObject + +/*! + @methodgroup Creating a request + */ + +/*! + @method + + Calls with a default timeout of 180 seconds. + */ +- (instancetype)init; + +/*! + @method + + @abstract + `FBRequestConnection` objects are used to issue one or more requests as a single + request/response connection with Facebook. + + @discussion + For a single request, the usual method for creating an `FBRequestConnection` + object is to call one of the **start* ** methods on . However, it is + allowable to init an `FBRequestConnection` object directly, and call + to add one or more request objects to the + connection, before calling start. + + Note that if requests are part of a batch, they must have an open + FBSession that has an access token associated with it. Alternatively a default App ID + must be set either in the plist or through an explicit call to <[FBSession defaultAppID]>. + + @param timeout The `NSTimeInterval` (seconds) to wait for a response before giving up. + */ + +- (instancetype)initWithTimeout:(NSTimeInterval)timeout; + +// properties + +/*! + @abstract + The request that will be sent to the server. + + @discussion + This property can be used to create a `NSURLRequest` without using + `FBRequestConnection` to send that request. It is legal to set this property + in which case the provided `NSMutableURLRequest` will be used instead. However, + the `NSMutableURLRequest` must result in an appropriate response. Furthermore, once + this property has been set, no more objects can be added to this + `FBRequestConnection`. + */ +@property (nonatomic, retain, readwrite) NSMutableURLRequest *urlRequest; + +/*! + @abstract + The raw response that was returned from the server. (readonly) + + @discussion + This property can be used to inspect HTTP headers that were returned from + the server. + + The property is nil until the request completes. If there was a response + then this property will be non-nil during the FBRequestHandler callback. + */ +@property (nonatomic, retain, readonly) NSHTTPURLResponse *urlResponse; + +/*! + @attribute beta true + + @abstract Set the automatic error handling behaviors. + @discussion + + This must be set before any requests are added. + + When using retry behaviors, note the FBRequestConnection instance + passed to the FBRequestHandler may be a different instance that the + one the requests were originally started on. + */ +@property (nonatomic, assign) FBRequestConnectionErrorBehavior errorBehavior; + +/*! + @methodgroup Adding requests + */ + +/*! + @method + + @abstract + This method adds an object to this connection. + + @discussion + The completion handler is retained until the block is called upon the + completion or cancellation of the connection. + + @param request A request to be included in the round-trip when start is called. + @param handler A handler to call back when the round-trip completes or times out. + The handler will be invoked on the main thread. + */ +- (void)addRequest:(FBRequest *)request + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + This method adds an object to this connection. + + @discussion + The completion handler is retained until the block is called upon the + completion or cancellation of the connection. This request can be named + to allow for using the request's response in a subsequent request. + + @param request A request to be included in the round-trip when start is called. + + @param handler A handler to call back when the round-trip completes or times out. + The handler will be invoked on the main thread. + + @param name An optional name for this request. This can be used to feed + the results of one request to the input of another in the same + `FBRequestConnection` as described in + [Graph API Batch Requests]( https://developers.facebook.com/docs/reference/api/batch/ ). + */ +- (void)addRequest:(FBRequest *)request + completionHandler:(FBRequestHandler)handler + batchEntryName:(NSString *)name; + +/*! + @method + + @abstract + This method adds an object to this connection. + + @discussion + The completion handler is retained until the block is called upon the + completion or cancellation of the connection. This request can be named + to allow for using the request's response in a subsequent request. + + @param request A request to be included in the round-trip when start is called. + + @param handler A handler to call back when the round-trip completes or times out. + + @param batchParameters The optional dictionary of parameters to include for this request + as described in [Graph API Batch Requests]( https://developers.facebook.com/docs/reference/api/batch/ ). + Examples include "depends_on", "name", or "omit_response_on_success". + */ +- (void)addRequest:(FBRequest *)request + completionHandler:(FBRequestHandler)handler + batchParameters:(NSDictionary *)batchParameters; + +/*! + @methodgroup Instance methods + */ + +/*! + @method + + @abstract + This method starts a connection with the server and is capable of handling all of the + requests that were added to the connection. + + @discussion + Errors are reported via the handler callback, even in cases where no + communication is attempted by the implementation of `FBRequestConnection`. In + such cases multiple error conditions may apply, and if so the following + priority (highest to lowest) is used: + + - `FBRequestConnectionInvalidRequestKey` -- this error is reported when an + cannot be encoded for transmission. + + - `FBRequestConnectionInvalidBatchKey` -- this error is reported when any + request in the connection cannot be encoded for transmission with the batch. + In this scenario all requests fail. + + This method cannot be called twice for an `FBRequestConnection` instance. + */ +- (void)start; + +/*! + @method + + @abstract + Signals that a connection should be logically terminated as the + application is no longer interested in a response. + + @discussion + Synchronously calls any handlers indicating the request was cancelled. Cancel + does not guarantee that the request-related processing will cease. It + does promise that all handlers will complete before the cancel returns. A call to + cancel prior to a start implies a cancellation of all requests associated + with the connection. + */ +- (void)cancel; + +/*! + @method + + @abstract + Simple method to make a graph API request for user info (/me), creates an + then uses an object to start the connection with Facebook. The + request uses the active session represented by `[FBSession activeSession]`. + + See + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForMeWithCompletionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to make a graph API request for user friends (/me/friends), creates an + then uses an object to start the connection with Facebook. The + request uses the active session represented by `[FBSession activeSession]`. + + See + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForMyFriendsWithCompletionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to make a graph API post of a photo. The request + uses the active session represented by `[FBSession activeSession]`. + + @param photo A `UIImage` for the photo to upload. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForUploadPhoto:(UIImage *)photo + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to make a graph API post of a status update. The request + uses the active session represented by `[FBSession activeSession]`. + + @param message The message to post. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForPostStatusUpdate:(NSString *)message + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to make a graph API post of a status update. The request + uses the active session represented by `[FBSession activeSession]`. + + @param message The message to post. + @param place The place to checkin with, or nil. Place may be an fbid or a + graph object representing a place. + @param tags Array of friends to tag in the status update, each element + may be an fbid or a graph object representing a user. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForPostStatusUpdate:(NSString *)message + place:(id)place + tags:(id)tags + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Starts a request representing a Graph API call to the "search" endpoint + for a given location using the active session. + + @discussion + Simplifies starting a request to search for places near a coordinate. + + This method creates the necessary object and initializes and + starts an object. A successful Graph API call will + return an array of objects representing the nearby locations. + + @param coordinate The search coordinates. + + @param radius The search radius in meters. + + @param limit The maxiumum number of results to return. It is + possible to receive fewer than this because of the + radius and because of server limits. + + @param searchText The text to use in the query to narrow the set of places + returned. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForPlacesSearchAtCoordinate:(CLLocationCoordinate2D)coordinate + radiusInMeters:(NSInteger)radius + resultsLimit:(NSInteger)limit + searchText:(NSString *)searchText + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Starts a request representing the Graph API call to retrieve a Custom Audience "third party ID" for the app's Facebook user. + Callers will send this ID back to their own servers, collect up a set to create a Facebook Custom Audience with, + and then use the resultant Custom Audience to target ads. + + @param session The FBSession to use to establish the user's identity for users logged into Facebook through this app. + If `nil`, then the activeSession is used. + + @discussion + This method will throw an exception if <[FBSettings defaultAppID]> is `nil`. The appID won't be nil when the pList + includes the appID, or if it's explicitly set. + + The JSON in the request's response will include an "custom_audience_third_party_id" key/value pair, with the value being the ID retrieved. + This ID is an encrypted encoding of the Facebook user's ID and the invoking Facebook app ID. + Multiple calls with the same user will return different IDs, thus these IDs cannot be used to correlate behavior + across devices or applications, and are only meaningful when sent back to Facebook for creating Custom Audiences. + + The ID retrieved represents the Facebook user identified in the following way: if the specified session (or activeSession if the specified + session is `nil`) is open, the ID will represent the user associated with the activeSession; otherwise the ID will represent the user logged into the + native Facebook app on the device. If there is no native Facebook app, no one is logged into it, or the user has opted out + at the iOS level from ad tracking, then a `nil` ID will be returned. + + This method returns `nil` if either the user has opted-out (via iOS) from Ad Tracking, the app itself has limited event usage + via the `[FBAppEvents setLimitEventUsage]` flag, or a specific Facebook user cannot be identified. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForCustomAudienceThirdPartyID:(FBSession *)session + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to make a graph API request, creates an object for HTTP GET, + then uses an object to start the connection with Facebook. The + request uses the active session represented by `[FBSession activeSession]`. + + See + + @param graphPath The Graph API endpoint to use for the request, for example "me". + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startWithGraphPath:(NSString *)graphPath + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to delete an object using the graph API, creates an object for + HTTP DELETE, then uses an object to start the connection with Facebook. + The request uses the active session represented by `[FBSession activeSession]`. + + @param object The object to delete, may be an NSString or NSNumber representing an fbid or an NSDictionary with an id property + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForDeleteObject:(id)object + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to post an object using the graph API, creates an object for + HTTP POST, then uses to start a connection with Facebook. The request uses + the active session represented by `[FBSession activeSession]`. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param graphObject An object or open graph action to post. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + + @discussion This method is typically used for posting an open graph action. If you are only + posting an open graph object (without an action), consider using `startForPostOpenGraphObject:completionHandler:` + */ ++ (FBRequestConnection *)startForPostWithGraphPath:(NSString *)graphPath + graphObject:(id)graphObject + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Creates an `FBRequest` object for a Graph API call, instantiate an + object, add the request to the newly created + connection and finally start the connection. Use this method for + specifying the request parameters and HTTP Method. The request uses + the active session represented by `[FBSession activeSession]`. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param parameters The parameters for the request. A value of nil sends only the automatically handled parameters, for example, the access token. The default is nil. + + @param HTTPMethod The HTTP method to use for the request. A nil value implies a GET. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startWithGraphPath:(NSString *)graphPath + parameters:(NSDictionary *)parameters + HTTPMethod:(NSString *)HTTPMethod + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Creates an `FBRequest` for creating a user owned Open Graph object, instantiate a + object, add the request to the newly created + connection and finally start the connection. The request uses + the active session represented by `[FBSession activeSession]`. + + @param object The Open Graph object to create. Some common expected fields include "title", "image", "url", etc. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForPostOpenGraphObject:(id)object + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Creates an `FBRequest` for creating a user owned Open Graph object, instantiate a + object, add the request to the newly created + connection and finally start the connection. The request uses + the active session represented by `[FBSession activeSession]`. + + @param type The fully-specified Open Graph object type (e.g., my_app_namespace:my_object_name) + @param title The title of the Open Graph object. + @param image The link to an image to be associated with the Open Graph object. + @param url The url to be associated with the Open Graph object. + @param description The description for the object. + @param objectProperties Any additional properties for the Open Graph object. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForPostOpenGraphObjectWithType:(NSString *)type + title:(NSString *)title + image:(id)image + url:(id)url + description:(NSString *)description + objectProperties:(NSDictionary *)objectProperties + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Creates an `FBRequest` for updating a user owned Open Graph object, instantiate a + object, add the request to the newly created + connection and finally start the connection. The request uses + the active session represented by `[FBSession activeSession]`. + + @param object The Open Graph object to update the existing object with. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForUpdateOpenGraphObject:(id)object + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Creates an `FBRequest` for updating a user owned Open Graph object, instantiate a + object, add the request to the newly created + connection and finally start the connection. The request uses + the active session represented by `[FBSession activeSession]`. + + @param objectId The id of the Open Graph object to update. + @param title The updated title of the Open Graph object. + @param image The updated link to an image to be associated with the Open Graph object. + @param url The updated url to be associated with the Open Graph object. + @param description The object's description. + @param objectProperties Any additional properties to update for the Open Graph object. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForUpdateOpenGraphObjectWithId:(id)objectId + title:(NSString *)title + image:(id)image + url:(id)url + description:(NSString *)description + objectProperties:(NSDictionary *)objectProperties + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Starts a request connection to upload an image + to create a staging resource. Staging resources allow you to post binary data + such as images, in preparation for a post of an open graph object or action + which references the image. The URI returned when uploading a staging resource + may be passed as the value for the image property of an open graph object or action. + + @discussion + This method simplifies the preparation of a Graph API call be creating the FBRequest + object and starting the request connection with a single method + + @param image A `UIImage` for the image to upload. + @param handler The handler block to call when the request completes. + */ ++ (FBRequestConnection *)startForUploadStagingResourceWithImage:(UIImage *)image + completionHandler:(FBRequestHandler)handler; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSDKMacros.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSDKMacros.h new file mode 100755 index 0000000..2faed4e --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSDKMacros.h @@ -0,0 +1,25 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#ifdef __cplusplus +#define FBSDK_EXTERN extern "C" __attribute__((visibility ("default"))) +#else +#define FBSDK_EXTERN extern __attribute__((visibility ("default"))) +#endif + +#define FBSDK_STATIC_INLINE static inline diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSession.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSession.h new file mode 100755 index 0000000..a1fffbb --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSession.h @@ -0,0 +1,819 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBSDKMacros.h" + +// up-front decl's +@class FBAccessTokenData; +@class FBSession; +@class FBSessionTokenCachingStrategy; + +#define FB_SESSIONSTATETERMINALBIT (1 << 8) + +#define FB_SESSIONSTATEOPENBIT (1 << 9) + +/* + * Constants used by NSNotificationCenter for active session notification + */ + +/*! NSNotificationCenter name indicating that a new active session was set */ +FBSDK_EXTERN NSString *const FBSessionDidSetActiveSessionNotification; + +/*! NSNotificationCenter name indicating that an active session was unset */ +FBSDK_EXTERN NSString *const FBSessionDidUnsetActiveSessionNotification; + +/*! NSNotificationCenter name indicating that the active session is open */ +FBSDK_EXTERN NSString *const FBSessionDidBecomeOpenActiveSessionNotification; + +/*! NSNotificationCenter name indicating that there is no longer an open active session */ +FBSDK_EXTERN NSString *const FBSessionDidBecomeClosedActiveSessionNotification; + +/*! + @typedef FBSessionState enum + + @abstract Passed to handler block each time a session state changes + + @discussion + */ +typedef enum { + /*! One of two initial states indicating that no valid cached token was found */ + FBSessionStateCreated = 0, + /*! One of two initial session states indicating that a cached token was loaded; + when a session is in this state, a call to open* will result in an open session, + without UX or app-switching*/ + FBSessionStateCreatedTokenLoaded = 1, + /*! One of three pre-open session states indicating that an attempt to open the session + is underway*/ + FBSessionStateCreatedOpening = 2, + + /*! Open session state indicating user has logged in or a cached token is available */ + FBSessionStateOpen = 1 | FB_SESSIONSTATEOPENBIT, + /*! Open session state indicating token has been extended */ + FBSessionStateOpenTokenExtended = 2 | FB_SESSIONSTATEOPENBIT, + + /*! Closed session state indicating that a login attempt failed */ + FBSessionStateClosedLoginFailed = 1 | FB_SESSIONSTATETERMINALBIT, // NSError obj w/more info + /*! Closed session state indicating that the session was closed, but the users token + remains cached on the device for later use */ + FBSessionStateClosed = 2 | FB_SESSIONSTATETERMINALBIT, // " +} FBSessionState; + +/*! helper macro to test for states that imply an open session */ +#define FB_ISSESSIONOPENWITHSTATE(state) (0 != (state & FB_SESSIONSTATEOPENBIT)) + +/*! helper macro to test for states that are terminal */ +#define FB_ISSESSIONSTATETERMINAL(state) (0 != (state & FB_SESSIONSTATETERMINALBIT)) + +/*! + @typedef FBSessionLoginBehavior enum + + @abstract + Passed to open to indicate whether Facebook Login should allow for fallback to be attempted. + + @discussion + Facebook Login authorizes the application to act on behalf of the user, using the user's + Facebook account. Usually a Facebook Login will rely on an account maintained outside of + the application, by the native Facebook application, the browser, or perhaps the device + itself. This avoids the need for a user to enter their username and password directly, and + provides the most secure and lowest friction way for a user to authorize the application to + interact with Facebook. If a Facebook Login is not possible, a fallback Facebook Login may be + attempted, where the user is prompted to enter their credentials in a web-view hosted directly + by the application. + + The `FBSessionLoginBehavior` enum specifies whether to allow fallback, disallow fallback, or + force fallback login behavior. Most applications will use the default, which attempts a normal + Facebook Login, and only falls back if needed. In rare cases, it may be preferable to disallow + fallback Facebook Login completely, or to force a fallback login. + */ +typedef enum { + /*! Attempt Facebook Login, ask user for credentials if necessary */ + FBSessionLoginBehaviorWithFallbackToWebView = 0, + /*! Attempt Facebook Login, no direct request for credentials will be made */ + FBSessionLoginBehaviorWithNoFallbackToWebView = 1, + /*! Only attempt WebView Login; ask user for credentials */ + FBSessionLoginBehaviorForcingWebView = 2, + /*! Attempt Facebook Login, prefering system account and falling back to fast app switch if necessary */ + FBSessionLoginBehaviorUseSystemAccountIfPresent = 3, + /*! Attempt only to login with Safari */ + FBSessionLoginBehaviorForcingSafari = 4, +} FBSessionLoginBehavior; + +/*! + @typedef FBSessionDefaultAudience enum + + @abstract + Passed to open to indicate which default audience to use for sessions that post data to Facebook. + + @discussion + Certain operations such as publishing a status or publishing a photo require an audience. When the user + grants an application permission to perform a publish operation, a default audience is selected as the + publication ceiling for the application. This enumerated value allows the application to select which + audience to ask the user to grant publish permission for. + */ +typedef enum { + /*! No audience needed; this value is useful for cases where data will only be read from Facebook */ + FBSessionDefaultAudienceNone = 0, + /*! Indicates that only the user is able to see posts made by the application */ + FBSessionDefaultAudienceOnlyMe = 10, + /*! Indicates that the user's friends are able to see posts made by the application */ + FBSessionDefaultAudienceFriends = 20, + /*! Indicates that all Facebook users are able to see posts made by the application */ + FBSessionDefaultAudienceEveryone = 30, +} FBSessionDefaultAudience; + +/*! + @typedef FBSessionLoginType enum + + @abstract + Used as the type of the loginType property in order to specify what underlying technology was used to + login the user. + + @discussion + The FBSession object is an abstraction over five distinct mechanisms. This enum allows an application + to test for the mechanism used by a particular instance of FBSession. Usually the mechanism used for a + given login does not matter, however for certain capabilities, the type of login can impact the behavior + of other Facebook functionality. + */ +typedef enum { + /*! A login type has not yet been established */ + FBSessionLoginTypeNone = 0, + /*! A system integrated account was used to log the user into the application */ + FBSessionLoginTypeSystemAccount = 1, + /*! The Facebook native application was used to log the user into the application */ + FBSessionLoginTypeFacebookApplication = 2, + /*! Safari was used to log the user into the application */ + FBSessionLoginTypeFacebookViaSafari = 3, + /*! A web view was used to log the user into the application */ + FBSessionLoginTypeWebView = 4, + /*! A test user was used to create an open session */ + FBSessionLoginTypeTestUser = 5, +} FBSessionLoginType; + +/*! + @typedef + + @abstract Block type used to define blocks called by for state updates + @discussion See https://developers.facebook.com/docs/technical-guides/iossdk/errors/ + for error handling best practices. + + Requesting additional permissions inside this handler (such as by calling + `requestNewPublishPermissions`) should be avoided because it is a poor user + experience and its behavior may vary depending on the login type. You should + request the permissions closer to the operation that requires it (e.g., when + the user performs some action). + */ +typedef void (^FBSessionStateHandler)(FBSession *session, + FBSessionState status, + NSError *error); + +/*! + @typedef + + @abstract Block type used to define blocks called by <[FBSession requestNewReadPermissions:completionHandler:]> + and <[FBSession requestNewPublishPermissions:defaultAudience:completionHandler:]>. + + @discussion See https://developers.facebook.com/docs/technical-guides/iossdk/errors/ + for error handling best practices. + + Requesting additional permissions inside this handler (such as by calling + `requestNewPublishPermissions`) should be avoided because it is a poor user + experience and its behavior may vary depending on the login type. You should + request the permissions closer to the operation that requires it (e.g., when + the user performs some action). + */ +typedef void (^FBSessionRequestPermissionResultHandler)(FBSession *session, + NSError *error); + +/*! + @typedef + + @abstract Block type used to define blocks called by <[FBSession reauthorizeWithPermissions]>. + + @discussion You should use the preferred FBSessionRequestPermissionHandler typedef rather than + this synonym, which has been deprecated. + */ +typedef FBSessionRequestPermissionResultHandler FBSessionReauthorizeResultHandler __attribute__((deprecated)); + +/*! + @typedef + + @abstract Block type used to define blocks called for system credential renewals. + @discussion + */ +typedef void (^FBSessionRenewSystemCredentialsHandler)(ACAccountCredentialRenewResult result, NSError *error) ; + +/*! + @class FBSession + + @abstract + The `FBSession` object is used to authenticate a user and manage the user's session. After + initializing a `FBSession` object the Facebook App ID and desired permissions are stored. + Opening the session will initiate the authentication flow after which a valid user session + should be available and subsequently cached. Closing the session can optionally clear the + cache. + + If an request requires user authorization then an `FBSession` object should be used. + + + @discussion + Instances of the `FBSession` class provide notification of state changes in the following ways: + + 1. Callers of certain `FBSession` methods may provide a block that will be called + back in the course of state transitions for the session (e.g. login or session closed). + + 2. The object supports Key-Value Observing (KVO) for property changes. + */ +@interface FBSession : NSObject + +/*! + @methodgroup Creating a session + */ + +/*! + @method + + @abstract + Returns a newly initialized Facebook session with default values for the parameters + to . + */ +- (instancetype)init; + +/*! + @method + + @abstract + Returns a newly initialized Facebook session with the specified permissions and other + default values for parameters to . + + @param permissions An array of strings representing the permissions to request during the + authentication flow. + + @discussion + It is required that any single permission request request (including initial log in) represent read-only permissions + or publish permissions only; not both. The permissions passed here should reflect this requirement. + + */ +- (instancetype)initWithPermissions:(NSArray *)permissions; + +/*! + @method + + @abstract + Following are the descriptions of the arguments along with their + defaults when ommitted. + + @param permissions An array of strings representing the permissions to request during the + authentication flow. + @param appID The Facebook App ID for the session. If nil is passed in the default App ID will be obtained from a call to <[FBSession defaultAppID]>. The default is nil. + @param urlSchemeSuffix The URL Scheme Suffix to be used in scenarious where multiple iOS apps use one Facebook App ID. A value of nil indicates that this information should be pulled from [FBSettings defaultUrlSchemeSuffix]. The default is nil. + @param tokenCachingStrategy Specifies a key name to use for cached token information in NSUserDefaults, nil + indicates a default value of @"FBAccessTokenInformationKey". + + @discussion + It is required that any single permission request request (including initial log in) represent read-only permissions + or publish permissions only; not both. The permissions passed here should reflect this requirement. + */ +- (instancetype)initWithAppID:(NSString *)appID + permissions:(NSArray *)permissions + urlSchemeSuffix:(NSString *)urlSchemeSuffix + tokenCacheStrategy:(FBSessionTokenCachingStrategy *)tokenCachingStrategy; + +/*! + @method + + @abstract + Following are the descriptions of the arguments along with their + defaults when ommitted. + + @param permissions An array of strings representing the permissions to request during the + authentication flow. + @param defaultAudience Most applications use FBSessionDefaultAudienceNone here, only specifying an audience when using reauthorize to request publish permissions. + @param appID The Facebook App ID for the session. If nil is passed in the default App ID will be obtained from a call to <[FBSession defaultAppID]>. The default is nil. + @param urlSchemeSuffix The URL Scheme Suffix to be used in scenarious where multiple iOS apps use one Facebook App ID. A value of nil indicates that this information should be pulled from [FBSettings defaultUrlSchemeSuffix]. The default is nil. + @param tokenCachingStrategy Specifies a key name to use for cached token information in NSUserDefaults, nil + indicates a default value of @"FBAccessTokenInformationKey". + + @discussion + It is required that any single permission request request (including initial log in) represent read-only permissions + or publish permissions only; not both. The permissions passed here should reflect this requirement. If publish permissions + are used, then the audience must also be specified. + */ +- (instancetype)initWithAppID:(NSString *)appID + permissions:(NSArray *)permissions + defaultAudience:(FBSessionDefaultAudience)defaultAudience + urlSchemeSuffix:(NSString *)urlSchemeSuffix + tokenCacheStrategy:(FBSessionTokenCachingStrategy *)tokenCachingStrategy; + +// instance readonly properties + +/*! @abstract Indicates whether the session is open and ready for use. */ +@property (readonly) BOOL isOpen; + +/*! @abstract Detailed session state */ +@property (readonly) FBSessionState state; + +/*! @abstract Identifies the Facebook app which the session object represents. */ +@property (readonly, copy) NSString *appID; + +/*! @abstract Identifies the URL Scheme Suffix used by the session. This is used when multiple iOS apps share a single Facebook app ID. */ +@property (readonly, copy) NSString *urlSchemeSuffix; + +/*! @abstract The access token for the session object. + @discussion Deprecated. Use the `accessTokenData` property. */ +@property(readonly, copy) NSString *accessToken +__attribute__((deprecated)); + +/*! @abstract The expiration date of the access token for the session object. + @discussion Deprecated. Use the `accessTokenData` property. */ +@property(readonly, copy) NSDate *expirationDate +__attribute__((deprecated)); + +/*! @abstract The permissions granted to the access token during the authentication flow. */ +@property (readonly, copy) NSArray *permissions; + +/*! @abstract Specifies the login type used to authenticate the user. + @discussion Deprecated. Use the `accessTokenData` property. */ +@property(readonly) FBSessionLoginType loginType +__attribute__((deprecated)); + +/*! @abstract Gets the FBAccessTokenData for the session */ +@property (readonly, copy) FBAccessTokenData *accessTokenData; + +/*! + @abstract + Returns a collection of permissions that have been declined by the user for this + given session instance. + + @discussion + A "declined" permission is one that had been requested but was either skipped or removed by + the user during the login flow. Note that once the permission has been granted (either by + requesting again or detected by a permissions refresh), it will be removed from this collection. + */ +@property (readonly, copy) NSArray *declinedPermissions; + +/*! + @methodgroup Instance methods + */ + +/*! + @method + + @abstract Opens a session for the Facebook. + + @discussion + A session may not be used with and other classes in the SDK until it is open. If, prior + to calling open, the session is in the state, then no UX occurs, and + the session becomes available for use. If the session is in the state, prior + to calling open, then a call to open causes login UX to occur, either via the Facebook application + or via mobile Safari. + + Open may be called at most once and must be called after the `FBSession` is initialized. Open must + be called before the session is closed. Calling an open method at an invalid time will result in + an exception. The open session methods may be passed a block that will be called back when the session + state changes. The block will be released when the session is closed. + + @param handler A block to call with the state changes. The default is nil. + */ +- (void)openWithCompletionHandler:(FBSessionStateHandler)handler; + +/*! + @method + + @abstract Logs a user on to Facebook. + + @discussion + A session may not be used with and other classes in the SDK until it is open. If, prior + to calling open, the session is in the state, then no UX occurs, and + the session becomes available for use. If the session is in the state, prior + to calling open, then a call to open causes login UX to occur, either via the Facebook application + or via mobile Safari. + + The method may be called at most once and must be called after the `FBSession` is initialized. It must + be called before the session is closed. Calling the method at an invalid time will result in + an exception. The open session methods may be passed a block that will be called back when the session + state changes. The block will be released when the session is closed. + + @param behavior Controls whether to allow, force, or prohibit Facebook Login or Inline Facebook Login. The default + is to allow Facebook Login, with fallback to Inline Facebook Login. + @param handler A block to call with session state changes. The default is nil. + */ +- (void)openWithBehavior:(FBSessionLoginBehavior)behavior + completionHandler:(FBSessionStateHandler)handler; + +/*! + @method + + @abstract Imports an existing access token and opens the session with it. + + @discussion + The method attempts to open the session using an existing access token. No UX will occur. If + successful, the session with be in an Open state and the method will return YES; otherwise, NO. + + The method may be called at most once and must be called after the `FBSession` is initialized (see below). + It must be called before the session is closed. Calling the method at an invalid time will result in + an exception. The open session methods may be passed a block that will be called back when the session + state changes. The block will be released when the session is closed. + + The initialized session must not have already been initialized from a cache (for example, you could use + the `[FBSessionTokenCachingStrategy nullCacheInstance]` instance). + + @param accessTokenData The token data. See `FBAccessTokenData` for construction methods. + @param handler A block to call with session state changes. The default is nil. + */ +- (BOOL)openFromAccessTokenData:(FBAccessTokenData *)accessTokenData completionHandler:(FBSessionStateHandler) handler; + +/*! + @abstract + Closes the local in-memory session object, but does not clear the persisted token cache. + */ +- (void)close; + +/*! + @abstract + Closes the in-memory session, and clears any persisted cache related to the session. + */ +- (void)closeAndClearTokenInformation; + +/*! + @abstract + Reauthorizes the session, with additional permissions. + + @param permissions An array of strings representing the permissions to request during the + authentication flow. A value of nil indicates basic permissions. The default is nil. + @param behavior Controls whether to allow, force, or prohibit Facebook Login. The default + is to allow Facebook Login and fall back to Inline Facebook Login if needed. + @param handler A block to call with session state changes. The default is nil. + + @discussion Methods and properties that specify permissions without a read or publish + qualification are deprecated; use of a read-qualified or publish-qualified alternative is preferred + (e.g. reauthorizeWithReadPermissions or reauthorizeWithPublishPermissions) + */ +- (void)reauthorizeWithPermissions:(NSArray *)permissions + behavior:(FBSessionLoginBehavior)behavior + completionHandler:(FBSessionReauthorizeResultHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Reauthorizes the session, with additional permissions. + + @param readPermissions An array of strings representing the permissions to request during the + authentication flow. A value of nil indicates basic permissions. + + @param handler A block to call with session state changes. The default is nil. + + @discussion This method is a deprecated alias of <[FBSession requestNewReadPermissions:completionHandler:]>. Consider + using <[FBSession requestNewReadPermissions:completionHandler:]>, which is preferred for readability. + */ +- (void)reauthorizeWithReadPermissions:(NSArray *)readPermissions + completionHandler:(FBSessionReauthorizeResultHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Reauthorizes the session, with additional permissions. + + @param writePermissions An array of strings representing the permissions to request during the + authentication flow. + + @param defaultAudience Specifies the audience for posts. + + @param handler A block to call with session state changes. The default is nil. + + @discussion This method is a deprecated alias of <[FBSession requestNewPublishPermissions:defaultAudience:completionHandler:]>. + Consider using <[FBSession requestNewPublishPermissions:defaultAudience:completionHandler:]>, which is preferred for readability. + */ +- (void)reauthorizeWithPublishPermissions:(NSArray *)writePermissions + defaultAudience:(FBSessionDefaultAudience)defaultAudience + completionHandler:(FBSessionReauthorizeResultHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Requests new or additional read permissions for the session. + + @param readPermissions An array of strings representing the permissions to request during the + authentication flow. A value of nil indicates basic permissions. + + @param handler A block to call with session state changes. The default is nil. + + @discussion The handler, if non-nil, is called once the operation has completed or failed. This is in contrast to the + state completion handler used in <[FBSession openWithCompletionHandler:]> (and other `open*` methods) which is called + for each state-change for the session. + */ +- (void)requestNewReadPermissions:(NSArray *)readPermissions + completionHandler:(FBSessionRequestPermissionResultHandler)handler; + +/*! + @abstract + Requests new or additional write permissions for the session. + + @param writePermissions An array of strings representing the permissions to request during the + authentication flow. + + @param defaultAudience Specifies the audience for posts. + + @param handler A block to call with session state changes. The default is nil. + + @discussion The handler, if non-nil, is called once the operation has completed or failed. This is in contrast to the + state completion handler used in <[FBSession openWithCompletionHandler:]> (and other `open*` methods) which is called + for each state-change for the session. + */ +- (void)requestNewPublishPermissions:(NSArray *)writePermissions + defaultAudience:(FBSessionDefaultAudience)defaultAudience + completionHandler:(FBSessionRequestPermissionResultHandler)handler; +/*! + @abstract Refreshes the current permissions for the session. + @param handler Called after completion of the refresh. + @discussion This will update the sessions' permissions array from the server. This can be + useful if you want to make sure the local permissions are up to date. + */ +- (void)refreshPermissionsWithCompletionHandler:(FBSessionRequestPermissionResultHandler)handler; + +/*! + @abstract + A helper method that is used to provide an implementation for + [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. It should be invoked during + the Facebook Login flow and will update the session information based on the incoming URL. + + @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + */ +- (BOOL)handleOpenURL:(NSURL *)url; + +/*! + @abstract + A helper method that is used to provide an implementation for + [UIApplicationDelegate applicationDidBecomeActive:] to properly resolve session state for + the Facebook Login flow, specifically to support app-switch login. + */ +- (void)handleDidBecomeActive; + +/*! + @abstract + Assign the block to be invoked for session state changes. + + @param stateChangeHandler the handler block. + + @discussion + This will overwrite any state change handler that was already assigned. Typically, + you should only use this setter if you were unable to assign a state change handler explicitly. + One example of this is if you are not opening the session (e.g., using the `open*`) + but still want to assign a `FBSessionStateHandler` block. This can happen when the SDK + opens a session from an app link. + */ +- (void)setStateChangeHandler:(FBSessionStateHandler)stateChangeHandler; + +/*! + @abstract + Returns true if the specified permission has been granted to this session. + + @param permission the permission to verify. + + @discussion + This is a convenience helper for checking if `pemission` is inside the permissions array. + */ +- (BOOL)hasGranted:(NSString *)permission; + +/*! + @methodgroup Class methods + */ + +/*! + @abstract + This is the simplest method for opening a session with Facebook. Using sessionOpen logs on a user, + and sets the static activeSession which becomes the default session object for any Facebook UI widgets + used by the application. This session becomes the active session, whether open succeeds or fails. + + Note, if there is not a cached token available, this method will present UI to the user in order to + open the session via explicit login by the user. + + @param allowLoginUI Sometimes it is useful to attempt to open a session, but only if + no login UI will be required to accomplish the operation. For example, at application startup it may not + be disirable to transition to login UI for the user, and yet an open session is desired so long as a cached + token can be used to open the session. Passing NO to this argument, assures the method will not present UI + to the user in order to open the session. + + @discussion + Returns YES if the session was opened synchronously without presenting UI to the user. This occurs + when there is a cached token available from a previous run of the application. If NO is returned, this indicates + that the session was not immediately opened, via cache. However, if YES was passed as allowLoginUI, then it is + possible that the user will login, and the session will become open asynchronously. The primary use for + this return value is to switch-on facebook capabilities in your UX upon startup, in the case where the session + is opened via cache. + */ ++ (BOOL)openActiveSessionWithAllowLoginUI:(BOOL)allowLoginUI; + +/*! + @abstract + This is a simple method for opening a session with Facebook. Using sessionOpen logs on a user, + and sets the static activeSession which becomes the default session object for any Facebook UI widgets + used by the application. This session becomes the active session, whether open succeeds or fails. + + @param permissions An array of strings representing the permissions to request during the + authentication flow. A value of nil indicates basic permissions. A nil value specifies + default permissions. + + @param allowLoginUI Sometimes it is useful to attempt to open a session, but only if + no login UI will be required to accomplish the operation. For example, at application startup it may not + be desirable to transition to login UI for the user, and yet an open session is desired so long as a cached + token can be used to open the session. Passing NO to this argument, assures the method will not present UI + to the user in order to open the session. + + @param handler Many applications will benefit from notification when a session becomes invalid + or undergoes other state transitions. If a block is provided, the FBSession + object will call the block each time the session changes state. + + @discussion + Returns true if the session was opened synchronously without presenting UI to the user. This occurs + when there is a cached token available from a previous run of the application. If NO is returned, this indicates + that the session was not immediately opened, via cache. However, if YES was passed as allowLoginUI, then it is + possible that the user will login, and the session will become open asynchronously. The primary use for + this return value is to switch-on facebook capabilities in your UX upon startup, in the case where the session + is opened via cache. + + It is required that initial permissions requests represent read-only permissions only. If publish + permissions are needed, you may use reauthorizeWithPermissions to specify additional permissions as + well as an audience. Use of this method will result in a legacy fast-app-switch Facebook Login due to + the requirement to separate read and publish permissions for newer applications. Methods and properties + that specify permissions without a read or publish qualification are deprecated; use of a read-qualified + or publish-qualified alternative is preferred. + */ ++ (BOOL)openActiveSessionWithPermissions:(NSArray *)permissions + allowLoginUI:(BOOL)allowLoginUI + completionHandler:(FBSessionStateHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + This is a simple method for opening a session with Facebook. Using sessionOpen logs on a user, + and sets the static activeSession which becomes the default session object for any Facebook UI widgets + used by the application. This session becomes the active session, whether open succeeds or fails. + + @param readPermissions An array of strings representing the read permissions to request during the + authentication flow. It is not allowed to pass publish permissions to this method. + + @param allowLoginUI Sometimes it is useful to attempt to open a session, but only if + no login UI will be required to accomplish the operation. For example, at application startup it may not + be desirable to transition to login UI for the user, and yet an open session is desired so long as a cached + token can be used to open the session. Passing NO to this argument, assures the method will not present UI + to the user in order to open the session. + + @param handler Many applications will benefit from notification when a session becomes invalid + or undergoes other state transitions. If a block is provided, the FBSession + object will call the block each time the session changes state. + + @discussion + Returns true if the session was opened synchronously without presenting UI to the user. This occurs + when there is a cached token available from a previous run of the application. If NO is returned, this indicates + that the session was not immediately opened, via cache. However, if YES was passed as allowLoginUI, then it is + possible that the user will login, and the session will become open asynchronously. The primary use for + this return value is to switch-on facebook capabilities in your UX upon startup, in the case where the session + is opened via cache. + + */ ++ (BOOL)openActiveSessionWithReadPermissions:(NSArray *)readPermissions + allowLoginUI:(BOOL)allowLoginUI + completionHandler:(FBSessionStateHandler)handler; + +/*! + @abstract + This is a simple method for opening a session with Facebook. Using sessionOpen logs on a user, + and sets the static activeSession which becomes the default session object for any Facebook UI widgets + used by the application. This session becomes the active session, whether open succeeds or fails. + + @param publishPermissions An array of strings representing the publish permissions to request during the + authentication flow. + + @param defaultAudience Anytime an app publishes on behalf of a user, the post must have an audience (e.g. me, my friends, etc.) + The default audience is used to notify the user of the cieling that the user agrees to grant to the app for the provided permissions. + + @param allowLoginUI Sometimes it is useful to attempt to open a session, but only if + no login UI will be required to accomplish the operation. For example, at application startup it may not + be desirable to transition to login UI for the user, and yet an open session is desired so long as a cached + token can be used to open the session. Passing NO to this argument, assures the method will not present UI + to the user in order to open the session. + + @param handler Many applications will benefit from notification when a session becomes invalid + or undergoes other state transitions. If a block is provided, the FBSession + object will call the block each time the session changes state. + + @discussion + Returns true if the session was opened synchronously without presenting UI to the user. This occurs + when there is a cached token available from a previous run of the application. If NO is returned, this indicates + that the session was not immediately opened, via cache. However, if YES was passed as allowLoginUI, then it is + possible that the user will login, and the session will become open asynchronously. The primary use for + this return value is to switch-on facebook capabilities in your UX upon startup, in the case where the session + is opened via cache. + + */ ++ (BOOL)openActiveSessionWithPublishPermissions:(NSArray *)publishPermissions + defaultAudience:(FBSessionDefaultAudience)defaultAudience + allowLoginUI:(BOOL)allowLoginUI + completionHandler:(FBSessionStateHandler)handler; + +/*! + @abstract + An application may get or set the current active session. Certain high-level components in the SDK + will use the activeSession to set default session (e.g. `FBLoginView`, `FBFriendPickerViewController`) + + @discussion + If sessionOpen* is called, the resulting `FBSession` object also becomes the activeSession. If another + session was active at the time, it is closed automatically. If activeSession is called when no session + is active, a session object is instatiated and returned; in this case open must be called on the session + in order for it to be useable for communication with Facebook. + */ ++ (FBSession *)activeSession; + +/*! + @abstract + An application may get or set the current active session. Certain high-level components in the SDK + will use the activeSession to set default session (e.g. `FBLoginView`, `FBFriendPickerViewController`) + + @param session The FBSession object to become the active session + + @discussion + If an application prefers the flexibilility of directly instantiating a session object, an active + session can be set directly. + */ ++ (FBSession *)setActiveSession:(FBSession *)session; + +/*! + @method + + @abstract Set the default Facebook App ID to use for sessions. The app ID may be + overridden on a per session basis. + + @discussion This method has been deprecated in favor of [FBSettings setDefaultAppID]. + + @param appID The default Facebook App ID to use for methods. + */ ++ (void)setDefaultAppID:(NSString *)appID __attribute__((deprecated)); + +/*! + @method + + @abstract Get the default Facebook App ID to use for sessions. If not explicitly + set, the default will be read from the application's plist. The app ID may be + overridden on a per session basis. + + @discussion This method has been deprecated in favor of [FBSettings defaultAppID]. + */ ++ (NSString *)defaultAppID __attribute__((deprecated)); + +/*! + @method + + @abstract Set the default url scheme suffix to use for sessions. The url + scheme suffix may be overridden on a per session basis. + + @discussion This method has been deprecated in favor of [FBSettings setDefaultUrlSchemeSuffix]. + + @param urlSchemeSuffix The default url scheme suffix to use for methods. + */ ++ (void)setDefaultUrlSchemeSuffix:(NSString *)urlSchemeSuffix __attribute__((deprecated)); + +/*! + @method + + @abstract Get the default url scheme suffix used for sessions. If not + explicitly set, the default will be read from the application's plist. The + url scheme suffix may be overridden on a per session basis. + + @discussion This method has been deprecated in favor of [FBSettings defaultUrlSchemeSuffix]. + */ ++ (NSString *)defaultUrlSchemeSuffix __attribute__((deprecated)); + +/*! + @method + + @abstract Issues an asychronous renewCredentialsForAccount call to the device Facebook account store. + + @param handler The completion handler to call when the renewal is completed. The handler will be + invoked on the main thread. + + @discussion This can be used to explicitly renew account credentials on iOS 6 devices and is provided + as a convenience wrapper around `[ACAccountStore renewCredentialsForAccount:completion]`. Note the + method will not issue the renewal call if the the Facebook account has not been set on the device, or + if access had not been granted to the account (though the handler wil receive an error). + + This is safe to call (and will surface an error to the handler) on versions of iOS before 6 or if the user + logged in via Safari or Facebook SSO. + */ ++ (void)renewSystemCredentials:(FBSessionRenewSystemCredentialsHandler)handler; +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSessionManualTokenCachingStrategy.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSessionManualTokenCachingStrategy.h new file mode 100755 index 0000000..2ba5ec8 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSessionManualTokenCachingStrategy.h @@ -0,0 +1,32 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FBSessionTokenCachingStrategy.h" + +// FBSessionManualTokenCachingStrategy +// +// Summary: +// Internal use only, this class enables migration logic for the Facebook class, by providing +// a means to directly provide the access token to a FBSession object +// +@interface FBSessionManualTokenCachingStrategy : FBSessionTokenCachingStrategy + +// set the properties before instantiating the FBSession object in order to seed a token +@property (readwrite, copy) NSString *accessToken; +@property (readwrite, copy) NSDate *expirationDate; + +@end + diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSessionTokenCachingStrategy.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSessionTokenCachingStrategy.h new file mode 100755 index 0000000..d5a405a --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSessionTokenCachingStrategy.h @@ -0,0 +1,161 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBAccessTokenData.h" +#import "FBSDKMacros.h" + +/*! + @class + + @abstract + The `FBSessionTokenCachingStrategy` class is responsible for persisting and retrieving cached data related to + an object, including the user's Facebook access token. + + @discussion + `FBSessionTokenCachingStrategy` is designed to be instantiated directly or used as a base class. Usually default + token caching behavior is sufficient, and you do not need to interface directly with `FBSessionTokenCachingStrategy` objects. + However, if you need to control where or how `FBSession` information is cached, then you may take one of two approaches. + + The first and simplest approach is to instantiate an instance of `FBSessionTokenCachingStrategy`, and then pass + the instance to `FBSession` class' `init` method. This enables your application to control the key name used in + `NSUserDefaults` to store session information. You may consider this approach if you plan to cache session information + for multiple users. + + The second and more advanced approached is to derive a custom class from `FBSessionTokenCachingStrategy`, which will + be responsible for caching behavior of your application. This approach is useful if you need to change where the + information is cached, for example if you prefer to use the filesystem or make a network connection to fetch and + persist cached tokens. Inheritors should override the cacheTokenInformation, fetchTokenInformation, and clearToken methods. + Doing this enables your application to implement any token caching scheme, including no caching at all (see + `[FBSessionTokenCachingStrategy nullCacheInstance]`. + + Direct use of `FBSessionTokenCachingStrategy`is an advanced technique. Most applications use objects without + passing an `FBSessionTokenCachingStrategy`, which yields default caching to `NSUserDefaults`. + */ +@interface FBSessionTokenCachingStrategy : NSObject + +/*! + @abstract Initializes and returns an instance + */ +- (instancetype)init; + +/*! + @abstract + Initializes and returns an instance + + @param tokenInformationKeyName Specifies a key name to use for cached token information in NSUserDefaults, nil + indicates a default value of @"FBAccessTokenInformationKey" + */ +- (instancetype)initWithUserDefaultTokenInformationKeyName:(NSString *)tokenInformationKeyName; + +/*! + @abstract + Called by (and overridden by inheritors), in order to cache token information. + + @param tokenInformation Dictionary containing token information to be cached by the method + @discussion You should favor overriding this instead of `cacheFBAccessTokenData` only if you intend + to cache additional data not captured by the FBAccessTokenData type. + */ +- (void)cacheTokenInformation:(NSDictionary *)tokenInformation; + +/*! + @abstract Cache the supplied token. + @param accessToken The token instance. + @discussion This essentially wraps a call to `cacheTokenInformation` so you should + override this when providing a custom token caching strategy. + */ +- (void)cacheFBAccessTokenData:(FBAccessTokenData *)accessToken; + +/*! + @abstract + Called by (and overridden by inheritors), in order to fetch cached token information + + @discussion + An overriding implementation should only return a token if it + can also return an expiration date, otherwise return nil. + You should favor overriding this instead of `fetchFBAccessTokenData` only if you intend + to cache additional data not captured by the FBAccessTokenData type. + + */ +- (NSDictionary *)fetchTokenInformation; + +/*! + @abstract + Fetches the cached token instance. + + @discussion + This essentially wraps a call to `fetchTokenInformation` so you should + override this when providing a custom token caching strategy. + + In order for an `FBSession` instance to be able to use a cached token, + the token must be not be expired (see `+isValidTokenInformation:`) and + must also contain all permissions in the initialized session instance. + */ +- (FBAccessTokenData *)fetchFBAccessTokenData; + +/*! + @abstract + Called by (and overridden by inheritors), in order delete any cached information for the current token + */ +- (void)clearToken; + +/*! + @abstract + Helper function called by the SDK as well as apps, in order to fetch the default strategy instance. + */ ++ (FBSessionTokenCachingStrategy *)defaultInstance; + +/*! + @abstract + Helper function to return a FBSessionTokenCachingStrategy instance that does not perform any caching. + */ ++ (FBSessionTokenCachingStrategy *)nullCacheInstance; + +/*! + @abstract + Helper function called by the SDK as well as application code, used to determine whether a given dictionary + contains the minimum token information usable by the . + + @param tokenInformation Dictionary containing token information to be validated + */ ++ (BOOL)isValidTokenInformation:(NSDictionary *)tokenInformation; + +@end + +// The key to use with token information dictionaries to get and set the token value +FBSDK_EXTERN NSString *const FBTokenInformationTokenKey; + +// The to use with token information dictionaries to get and set the expiration date +FBSDK_EXTERN NSString *const FBTokenInformationExpirationDateKey; + +// The to use with token information dictionaries to get and set the refresh date +FBSDK_EXTERN NSString *const FBTokenInformationRefreshDateKey; + +// The key to use with token information dictionaries to get the related user's fbid +FBSDK_EXTERN NSString *const FBTokenInformationUserFBIDKey; + +// The key to use with token information dictionaries to determine whether the token was fetched via Facebook Login +FBSDK_EXTERN NSString *const FBTokenInformationIsFacebookLoginKey; + +// The key to use with token information dictionaries to determine whether the token was fetched via the OS +FBSDK_EXTERN NSString *const FBTokenInformationLoginTypeLoginKey; + +// The key to use with token information dictionaries to get the latest known permissions +FBSDK_EXTERN NSString *const FBTokenInformationPermissionsKey; + +// The key to use with token information dictionaries to get the date the permissions were last refreshed. +FBSDK_EXTERN NSString *const FBTokenInformationPermissionsRefreshDateKey; diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSettings.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSettings.h new file mode 100755 index 0000000..216030f --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSettings.h @@ -0,0 +1,356 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBSDKMacros.h" + +/* + * Constants defining logging behavior. Use with <[FBSettings setLoggingBehavior]>. + */ + +/*! Log requests from FBRequest* classes */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorFBRequests; + +/*! Log requests from FBURLConnection* classes */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorFBURLConnections; + +/*! Include access token in logging. */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorAccessTokens; + +/*! Log session state transitions. */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorSessionStateTransitions; + +/*! Log performance characteristics */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorPerformanceCharacteristics; + +/*! Log FBAppEvents interactions */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorAppEvents; + +/*! Log Informational occurrences */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorInformational; + +/*! Log cache errors. */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorCacheErrors; + +/*! Log errors likely to be preventable by the developer. This is in the default set of enabled logging behaviors. */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorDeveloperErrors; + +@class FBGraphObject; + +/*! + @typedef + + @abstract Block type used to get install data that is returned by server when publishInstall is called + @discussion + */ +typedef void (^FBInstallResponseDataHandler)(FBGraphObject *response, NSError *error); + +/*! + @typedef + + @abstract A list of beta features that can be enabled for the SDK. Beta features are for evaluation only, + and are therefore only enabled for DEBUG builds. Beta features should not be enabled + in release builds. + */ +typedef enum : NSUInteger { + FBBetaFeaturesNone = 0, +#if defined(DEBUG) || defined(FB_BUILD_ONLY) + FBBetaFeaturesShareDialog = 1 << 0, + FBBetaFeaturesOpenGraphShareDialog = 1 << 1, + FBBetaFeaturesLikeButton = 1 << 2, +#endif +} FBBetaFeatures; + +/*! + @typedef + @abstract Indicates if this app should be restricted + */ +typedef NS_ENUM(NSUInteger, FBRestrictedTreatment) { + /*! The default treatment indicating the app is not restricted. */ + FBRestrictedTreatmentNO = 0, + + /*! Indicates the app is restricted. */ + FBRestrictedTreatmentYES = 1 +}; + +/*! + @class FBSettings + + @abstract Allows configuration of SDK behavior. +*/ +@interface FBSettings : NSObject + +/*! + @method + + @abstract Retrieve the current iOS SDK version. + + */ ++ (NSString *)sdkVersion; + +/*! + @method + + @abstract Retrieve the current Facebook SDK logging behavior. + + */ ++ (NSSet *)loggingBehavior; + +/*! + @method + + @abstract Set the current Facebook SDK logging behavior. This should consist of strings defined as + constants with FBLogBehavior*, and can be constructed with, e.g., [NSSet initWithObjects:]. + + @param loggingBehavior A set of strings indicating what information should be logged. If nil is provided, the logging + behavior is reset to the default set of enabled behaviors. Set in an empty set in order to disable all logging. + */ ++ (void)setLoggingBehavior:(NSSet *)loggingBehavior; + +/*! @abstract deprecated method */ ++ (BOOL)shouldAutoPublishInstall __attribute__ ((deprecated)); + +/*! @abstract deprecated method */ ++ (void)setShouldAutoPublishInstall:(BOOL)autoPublishInstall __attribute__ ((deprecated)); + +/*! + @method + + @abstract This method has been replaced by [FBAppEvents activateApp] */ ++ (void)publishInstall:(NSString *)appID __attribute__ ((deprecated("use [FBAppEvents activateApp] instead"))); + +/*! + @method + + @abstract Manually publish an attributed install to the Facebook graph, and return the server response back in + the supplied handler. Calling this method will implicitly turn off auto-publish. This method acquires the + current attribution id from the facebook application, queries the graph API to determine if the application + has install attribution enabled, publishes the id, and records success to avoid reporting more than once. + + @param appID A specific appID to publish an install for. If nil, uses [FBSession defaultAppID]. + @param handler A block to call with the server's response. + */ ++ (void)publishInstall:(NSString *)appID + withHandler:(FBInstallResponseDataHandler)handler __attribute__ ((deprecated)); + + +/*! + @method + + @abstract + Gets the application version to the provided string. `FBAppEvents`, for instance, attaches the app version to + events that it logs, which are then available in App Insights. + */ ++ (NSString *)appVersion; + +/*! + @method + + @abstract + Sets the application version to the provided string. `FBAppEvents`, for instance, attaches the app version to + events that it logs, which are then available in App Insights. + + @param appVersion The version identifier of the iOS app. + */ ++ (void)setAppVersion:(NSString *)appVersion; + +/*! + @method + + @abstract Retrieve the Client Token that has been set via [FBSettings setClientToken] + */ ++ (NSString *)clientToken; + +/*! + @method + + @abstract Sets the Client Token for the Facebook App. This is needed for certain API calls when made anonymously, + without a user-based Session. + + @param clientToken The Facebook App's "client token", which, for a given appid can be found in the Security + section of the Advanced tab of the Facebook App settings found at + + */ ++ (void)setClientToken:(NSString *)clientToken; + +/*! + @method + + @abstract Set the default Facebook Display Name to be used by the SDK. This should match + the Display Name that has been set for the app with the corresponding Facebook App ID, in + the Facebook App Dashboard + + @param displayName The default Facebook Display Name to be used by the SDK. + */ ++ (void)setDefaultDisplayName:(NSString *)displayName; + +/*! + @method + + @abstract Get the default Facebook Display Name used by the SDK. If not explicitly + set, the default will be read from the application's plist. + */ ++ (NSString *)defaultDisplayName; + +/*! + @method + + @abstract Set the default Facebook App ID to use for sessions. The SDK allows the appID + to be overridden per instance in certain cases (e.g. per instance of FBSession) + + @param appID The default Facebook App ID to be used by the SDK. + */ ++ (void)setDefaultAppID:(NSString *)appID; + +/*! + @method + + @abstract Get the default Facebook App ID used by the SDK. If not explicitly + set, the default will be read from the application's plist. The SDK allows the appID + to be overridden per instance in certain cases (e.g. per instance of FBSession) + */ ++ (NSString *)defaultAppID; + +/*! + @method + + @abstract Set the default url scheme suffix used by the SDK. + + @param urlSchemeSuffix The default url scheme suffix to be used by the SDK. + */ ++ (void)setDefaultUrlSchemeSuffix:(NSString *)urlSchemeSuffix; + +/*! + @method + + @abstract Get the default url scheme suffix used for sessions. If not + explicitly set, the default will be read from the application's plist value for 'FacebookUrlSchemeSuffix'. + */ ++ (NSString *)defaultUrlSchemeSuffix; + +/*! + @method + + @abstract Set the bundle name from the SDK will try and load overrides of images and text + + @param bundleName The name of the bundle (MyFBBundle). + */ ++ (void)setResourceBundleName:(NSString *)bundleName; + +/*! + @method + + @abstract Get the name of the bundle to override the SDK images and text + */ ++ (NSString *)resourceBundleName; + +/*! + @method + + @abstract Set the subpart of the facebook domain (e.g. @"beta") so that requests will be sent to graph.beta.facebook.com + + @param facebookDomainPart The domain part to be inserted into facebook.com + */ ++ (void)setFacebookDomainPart:(NSString *)facebookDomainPart; + +/*! + @method + + @abstract Get the Facebook domain part + */ ++ (NSString *)facebookDomainPart; + +/*! + @method + + @abstract Enables the specified beta features. Beta features are for evaluation only, + and are therefore only enabled for debug builds. Beta features should not be enabled + in release builds. + + @param betaFeatures The beta features to enable (expects a bitwise OR of FBBetaFeatures) + */ ++ (void)enableBetaFeatures:(NSUInteger)betaFeatures; + +/*! + @method + + @abstract Enables a beta feature. Beta features are for evaluation only, + and are therefore only enabled for debug builds. Beta features should not be enabled + in release builds. + + @param betaFeature The beta feature to enable. + */ ++ (void)enableBetaFeature:(FBBetaFeatures)betaFeature; + +/*! + @method + + @abstract Disables a beta feature. + + @param betaFeature The beta feature to disable. + */ ++ (void)disableBetaFeature:(FBBetaFeatures)betaFeature; + +/*! + @method + + @abstract Determines whether a beta feature is enabled or not. + + @param betaFeature The beta feature to check. + + @return YES if the beta feature is enabled, NO if not. + */ ++ (BOOL)isBetaFeatureEnabled:(FBBetaFeatures)betaFeature; + +/*! + @method + + @abstract + Gets whether data such as that generated through FBAppEvents and sent to Facebook should be restricted from being used for other than analytics and conversions. Defaults to NO. This value is stored on the device and persists across app launches. + */ ++ (BOOL)limitEventAndDataUsage; + +/*! + @method + + @abstract + Sets whether data such as that generated through FBAppEvents and sent to Facebook should be restricted from being used for other than analytics and conversions. Defaults to NO. This value is stored on the device and persists across app launches. + + @param limitEventAndDataUsage The desired value. + */ ++ (void)setLimitEventAndDataUsage:(BOOL)limitEventAndDataUsage; + +/*! + @method + @abstract Returns YES if the legacy Graph API mode is enabled +*/ ++ (BOOL)isPlatformCompatibilityEnabled; + +/*! + @method + @abstract Configures the SDK to use the legacy platform. + @param enable indicates whether to use the legacy mode + @discussion Setting this flag has several effects: + - FBRequests will target v1.0 of the Graph API. + - Login will use the prior behavior without abilities to decline permission. + - Specific new features such as `FBLikeButton` that require the current platform + will not work. +*/ ++ (void)enablePlatformCompatibility:(BOOL)enable; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBShareDialogParams.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBShareDialogParams.h new file mode 100755 index 0000000..7b828a8 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBShareDialogParams.h @@ -0,0 +1,29 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBLinkShareParams.h" + +/*! + @class FBShareDialogParams + + @abstract Deprecated. Use `FBLinkShareParams` instead. + */ +__attribute__((deprecated)) +@interface FBShareDialogParams : FBLinkShareParams + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBShareDialogPhotoParams.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBShareDialogPhotoParams.h new file mode 100755 index 0000000..a7f0b75 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBShareDialogPhotoParams.h @@ -0,0 +1,29 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBPhotoParams.h" + +/*! + @class FBShareDialogPhotoParams + + @abstract Deprecated. Use `FBPhotoParams` instead. +*/ +__attribute__((deprecated)) +@interface FBShareDialogPhotoParams : FBPhotoParams + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTestSession.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTestSession.h new file mode 100755 index 0000000..84dbd91 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTestSession.h @@ -0,0 +1,142 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FBSession.h" + +#import "FBSDKMacros.h" + +#if defined (DEBUG) +#define SAFE_TO_USE_FBTESTSESSION +#endif + +#if !defined(SAFE_TO_USE_FBTESTSESSION) +#pragma message ("warning: using FBTestSession, which is designed for unit-testing uses only, in non-DEBUG code -- ensure this is what you really want") +#endif + +/*! + Consider using this tag to pass to sessionWithSharedUserWithPermissions:uniqueUserTag: when + you need a second unique test user in a test case. Using the same tag each time reduces + the proliferation of test users. + */ +FBSDK_EXTERN NSString *kSecondTestUserTag; +/*! + Consider using this tag to pass to sessionWithSharedUserWithPermissions:uniqueUserTag: when + you need a third unique test user in a test case. Using the same tag each time reduces + the proliferation of test users. + */ +FBSDK_EXTERN NSString *kThirdTestUserTag; + +/*! + @class FBTestSession + + @abstract + Implements an FBSession subclass that knows about test users for a particular + application. This should never be used from a real application, but may be useful + for writing unit tests, etc. + + @discussion + Facebook allows developers to create test accounts for testing their applications' + Facebook integration (see https://developers.facebook.com/docs/test_users/). This class + simplifies use of these accounts for writing unit tests. It is not designed for use in + production application code. + + The main use case for this class is using sessionForUnitTestingWithPermissions:mode: + to create a session for a test user. Two modes are supported. In "shared" mode, an attempt + is made to find an existing test user that has the required permissions and, if it is not + currently in use by another FBTestSession, just use that user. If no such user is available, + a new one is created with the required permissions. In "private" mode, designed for + scenarios which require a new user in a known clean state, a new test user will always be + created, and it will be automatically deleted when the FBTestSession is closed. + + Note that the shared test user functionality depends on a naming convention for the test users. + It is important that any testing of functionality which will mutate the permissions for a + test user NOT use a shared test user, or this scheme will break down. If a shared test user + seems to be in an invalid state, it can be deleted manually via the Web interface at + https://developers.facebook.com/apps/APP_ID/permissions?role=test+users. + */ +@interface FBTestSession : FBSession + +/// The app access token (composed of app ID and secret) to use for accessing test users. +@property (readonly, copy) NSString *appAccessToken; +/// The ID of the test user associated with this session. +@property (readonly, copy) NSString *testUserID; +/// The name of the test user associated with this session. +@property (readonly, copy) NSString *testUserName; +/// The App ID of the test app as configured in the plist. +@property (readonly, copy) NSString *testAppID; +/// The App Secret of the test app as configured in the plist. +@property (readonly, copy) NSString *testAppSecret; +// Defaults to NO. If set to YES, reauthorize calls will fail with a nil token +// as if the user had cancelled it reauthorize. +@property (assign) BOOL disableReauthorize; + +/*! + @abstract + Constructor helper to create a session for use in unit tests + + @discussion + This method creates a session object which uses a shared test user with the right permissions, + creating one if necessary on open (but not deleting it on close, so it can be re-used in later + tests). Calling this method multiple times may return sessions with the same user. If this is not + desired, use the variant sessionWithSharedUserWithPermissions:uniqueUserTag:. + + This method should not be used in application code -- but is useful for creating unit tests + that use the Facebook SDK. + + @param permissions array of strings naming permissions to authorize; nil indicates + a common default set of permissions should be used for unit testing + */ ++ (instancetype)sessionWithSharedUserWithPermissions:(NSArray *)permissions; + +/*! + @abstract + Constructor helper to create a session for use in unit tests + + @discussion + This method creates a session object which uses a shared test user with the right permissions, + creating one if necessary on open (but not deleting it on close, so it can be re-used in later + tests). + + This method should not be used in application code -- but is useful for creating unit tests + that use the Facebook SDK. + + @param permissions array of strings naming permissions to authorize; nil indicates + a common default set of permissions should be used for unit testing + + @param uniqueUserTag a string which will be used to make this user unique among other + users with the same permissions. Useful for tests which require two or more users to interact + with each other, and which therefore must have sessions associated with different users. For + this case, consider using kSecondTestUserTag and kThirdTestUserTag so these users can be shared + with other, similar, tests. + */ ++ (instancetype)sessionWithSharedUserWithPermissions:(NSArray *)permissions + uniqueUserTag:(NSString *)uniqueUserTag; + +/*! + @abstract + Constructor helper to create a session for use in unit tests + + @discussion + This method creates a session object which creates a test user on open, and destroys the user on + close; This method should not be used in application code -- but is useful for creating unit tests + that use the Facebook SDK. + + @param permissions array of strings naming permissions to authorize; nil indicates + a common default set of permissions should be used for unit testing + */ ++ (instancetype)sessionWithPrivateUserWithPermissions:(NSArray *)permissions; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTooltipView.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTooltipView.h new file mode 100755 index 0000000..8f1c1d7 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTooltipView.h @@ -0,0 +1,134 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/*! + @typedef FBTooltipViewArrowDirection enum + + @abstract + Passed on construction to determine arrow orientation. + */ +typedef NS_ENUM(NSUInteger, FBTooltipViewArrowDirection) { + /*! View is located above given point, arrow is pointing down. */ + FBTooltipViewArrowDirectionDown = 0, + /*! View is located below given point, arrow is pointing up. */ + FBTooltipViewArrowDirectionUp = 1, +}; + +/*! + @typedef FBTooltipColorStyle enum + + @abstract + Passed on construction to determine color styling. + */ +typedef NS_ENUM(NSUInteger, FBTooltipColorStyle) { + /*! Light blue background, white text, faded blue close button. */ + FBTooltipColorStyleFriendlyBlue = 0, + /*! Dark gray background, white text, light gray close button. */ + FBTooltipColorStyleNeutralGray = 1, +}; + +/*! + @class FBTooltipView + + @abstract + Tooltip bubble with text in it used to display tips for UI elements, + with a pointed arrow (to refer to the UI element). + + @discussion + The tooltip fades in and will automatically fade out. See `displayDuration`. + */ +@interface FBTooltipView : UIView + +/*! + @abstract Gets or sets the amount of time in seconds the tooltip should be displayed. + @discussion Set this to zero to make the display permanent until explicitly dismissed. + Defaults to six seconds. +*/ +@property (nonatomic, assign) CFTimeInterval displayDuration; + +/*! + @abstract Gets or sets the color style after initialization. + @discussion Defaults to value passed to -initWithTagline:message:colorStyle:. + */ +@property (nonatomic, assign) FBTooltipColorStyle colorStyle; + +/*! + @abstract Gets or sets the message. +*/ +@property (nonatomic, copy) NSString *message; + +/*! + @abstract Gets or sets the optional phrase that comprises the first part of the label (and is highlighted differently). +*/ +@property (nonatomic, copy) NSString *tagline; + +/*! + @abstract + Designated initializer. + + @param tagline First part of the label, that will be highlighted with different color. Can be nil. + + @param message Main message to display. + + @param colorStyle Color style to use for tooltip. + + @discussion + If you need to show a tooltip for login, consider using the `FBLoginTooltipView` view. + + @see FBLoginTooltipView + */ +- (id)initWithTagline:(NSString *)tagline message:(NSString *)message colorStyle:(FBTooltipColorStyle)colorStyle; + +/*! + @abstract + Show tooltip at the top or at the bottom of given view. + Tooltip will be added to anchorView.superview + + @param anchorView sibling view to show at, must be already added to it's superview, in order to decide + where tooltip will be shown. (If there's not enough space at the top of the anchorView in superView's bounds - + tooltip will be shown at the bottom of it) + + @discussion + Use this method to present the tooltip with automatic positioning or + use -presentInView:withArrowPosition:direction: for manual positioning + */ +- (void)presentFromView:(UIView *) anchorView; + +/*! + @abstract + Adds tooltip to given view, with given position and arrow direction. + + @param view View to be used as superview. + + @param arrowPosition Point in view's cordinates, where arrow will be pointing + + @param arrowDirection whenever arrow should be pointing up (message bubble is below the arrow) or + down (message bubble is above the arrow). + */ +- (void)presentInView:(UIView *)view withArrowPosition:(CGPoint)arrowPosition direction:(FBTooltipViewArrowDirection)arrowDirection; + +/*! + @abstract + Remove tooltip manually. + + @discussion + Calling this method isn't necessary - tooltip will dismiss itself automatically after the `displayDuration`. + */ +- (void)dismiss; + +@end diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBUserSettingsViewController.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBUserSettingsViewController.h new file mode 100755 index 0000000..5df08e7 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBUserSettingsViewController.h @@ -0,0 +1,128 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSession.h" +#import "FBViewController.h" + +/*! + @protocol + + @abstract + The `FBUserSettingsDelegate` protocol defines the methods called by a . + */ +@protocol FBUserSettingsDelegate + +@optional + +/*! + @abstract + Called when the view controller will log the user out in response to a button press. + + @param sender The view controller sending the message. + */ +- (void)loginViewControllerWillLogUserOut:(id)sender; + +/*! + @abstract + Called after the view controller logged the user out in response to a button press. + + @param sender The view controller sending the message. + */ +- (void)loginViewControllerDidLogUserOut:(id)sender; + +/*! + @abstract + Called when the view controller will log the user in in response to a button press. + Note that logging in can fail for a number of reasons, so there is no guarantee that this + will be followed by a call to loginViewControllerDidLogUserIn:. Callers wanting more granular + notification of the session state changes can use KVO or the NSNotificationCenter to observe them. + + @param sender The view controller sending the message. + */ +- (void)loginViewControllerWillAttemptToLogUserIn:(id)sender; + +/*! + @abstract + Called after the view controller successfully logged the user in in response to a button press. + + @param sender The view controller sending the message. + */ +- (void)loginViewControllerDidLogUserIn:(id)sender; + +/*! + @abstract + Called if the view controller encounters an error while trying to log a user in. + + @param sender The view controller sending the message. + @param error The error encountered. + @discussion See https://developers.facebook.com/docs/technical-guides/iossdk/errors/ + for error handling best practices. + */ +- (void)loginViewController:(id)sender receivedError:(NSError *)error; + +@end + + +/*! + @class FBUserSettingsViewController + + @abstract + The `FBUserSettingsViewController` class provides a user interface exposing a user's + Facebook-related settings. Currently, this is limited to whether they are logged in or out + of Facebook. + + Because of the size of some graphics used in this view, its resources are packaged as a separate + bundle. In order to use `FBUserSettingsViewController`, drag the `FBUserSettingsViewResources.bundle` + from the SDK directory into your Xcode project. + */ +@interface FBUserSettingsViewController : FBViewController + +/*! + @abstract + The permissions to request if the user logs in via this view. + */ +@property (nonatomic, copy) NSArray *permissions __attribute__((deprecated)); + +/*! + @abstract + The read permissions to request if the user logs in via this view. + + @discussion + Note, that if read permissions are specified, then publish permissions should not be specified. + */ +@property (nonatomic, copy) NSArray *readPermissions; + +/*! + @abstract + The publish permissions to request if the user logs in via this view. + + @discussion + Note, that a defaultAudience value of FBSessionDefaultAudienceOnlyMe, FBSessionDefaultAudienceEveryone, or + FBSessionDefaultAudienceFriends should be set if publish permissions are specified. Additionally, when publish + permissions are specified, then read should not be specified. + */ +@property (nonatomic, copy) NSArray *publishPermissions; + +/*! + @abstract + The default audience to use, if publish permissions are requested at login time. + */ +@property (nonatomic, assign) FBSessionDefaultAudience defaultAudience; + +@end + diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBViewController.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBViewController.h new file mode 100755 index 0000000..fa33d21 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBViewController.h @@ -0,0 +1,118 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@class FBViewController; + +/*! + @typedef FBModalCompletionHandler + + @abstract + A block that is passed to [FBViewController presentModallyInViewController:animated:handler:] + and called when the view controller is dismissed via either Done or Cancel. + + @param sender The that is being dismissed. + + @param donePressed If YES, Done was pressed. If NO, Cancel was pressed. + */ +typedef void (^FBModalCompletionHandler)(FBViewController *sender, BOOL donePressed); + +/*! + @protocol + + @abstract + The `FBViewControllerDelegate` protocol defines the methods called when the Cancel or Done + buttons are pressed in a . + */ +@protocol FBViewControllerDelegate + +@optional + +/*! + @abstract + Called when the Cancel button is pressed on a modally-presented . + + @param sender The view controller sending the message. + */ +- (void)facebookViewControllerCancelWasPressed:(id)sender; + +/*! + @abstract + Called when the Done button is pressed on a modally-presented . + + @param sender The view controller sending the message. + */ +- (void)facebookViewControllerDoneWasPressed:(id)sender; + +@end + + +/*! + @class FBViewController + + @abstract + The `FBViewController` class is a base class encapsulating functionality common to several + other view controller classes. Specifically, it provides UI when a view controller is presented + modally, in the form of optional Cancel and Done buttons. + */ +@interface FBViewController : UIViewController + +/*! + @abstract + The Cancel button to display when presented modally. If nil, no Cancel button is displayed. + If this button is provided, its target and action will be redirected to internal handlers, replacing + any previous target that may have been set. + */ +@property (nonatomic, retain) IBOutlet UIBarButtonItem *cancelButton; + +/*! + @abstract + The Done button to display when presented modally. If nil, no Done button is displayed. + If this button is provided, its target and action will be redirected to internal handlers, replacing + any previous target that may have been set. + */ +@property (nonatomic, retain) IBOutlet UIBarButtonItem *doneButton; + +/*! + @abstract + The delegate that will be called when Cancel or Done is pressed. Derived classes may specify + derived types for their delegates that provide additional functionality. + */ +@property (nonatomic, assign) IBOutlet id delegate; + +/*! + @abstract + The view into which derived classes should put their subviews. This view will be resized correctly + depending on whether or not a toolbar is displayed. + */ +@property (nonatomic, readonly, retain) UIView *canvasView; + +/*! + @abstract + Provides a wrapper that presents the view controller modally and automatically dismisses it + when either the Done or Cancel button is pressed. + + @param viewController The view controller that is presenting this view controller. + @param animated If YES, presenting and dismissing the view controller is animated. + @param handler The block called when the Done or Cancel button is pressed. + */ +- (void)presentModallyFromViewController:(UIViewController *)viewController + animated:(BOOL)animated + handler:(FBModalCompletionHandler)handler; + +@end + diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBWebDialogs.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBWebDialogs.h new file mode 100755 index 0000000..5fdcedd --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBWebDialogs.h @@ -0,0 +1,236 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@class FBFrictionlessRecipientCache; +@class FBSession; +@protocol FBWebDialogsDelegate; + +/*! + @typedef NS_ENUM (NSUInteger, FBWebDialogResult) + + @abstract + Passed to a handler to indicate the result of a dialog being displayed to the user. + + @discussion Note `FBWebDialogResultDialogCompleted` is also used for cancelled operations. +*/ +typedef NS_ENUM(NSUInteger, FBWebDialogResult) { + /*! Indicates that the dialog action completed successfully. Note, that cancel operations represent completed dialog operations. + The url argument may be used to distinguish between success and user-cancelled cases */ + FBWebDialogResultDialogCompleted = 0, + /*! Indicates that the dialog operation was not completed. This occurs in cases such as the closure of the web-view using the X in the upper left corner. */ + FBWebDialogResultDialogNotCompleted +}; + +/*! + @typedef + + @abstract Defines a handler that will be called in response to the web dialog + being dismissed + */ +typedef void (^FBWebDialogHandler)( + FBWebDialogResult result, + NSURL *resultURL, + NSError *error); + +/*! + @class FBWebDialogs + + @abstract + Provides methods to display web based dialogs to the user. +*/ +@interface FBWebDialogs : NSObject + +/*! + @abstract + Presents a Facebook web dialog (https://developers.facebook.com/docs/reference/dialogs/ ) + such as feed or apprequest. + + @param session Represents the session to use for the dialog. May be nil, which uses + the active session if present, or returns NO, if not. + + @param dialog Represents the dialog or method name, such as @"feed" + + @param parameters A dictionary of parameters to be passed to the dialog + + @param handler An optional handler that will be called when the dialog is dismissed. Note, + that if the method returns NO, the handler is not called. May be nil. + */ ++ (void)presentDialogModallyWithSession:(FBSession *)session + dialog:(NSString *)dialog + parameters:(NSDictionary *)parameters + handler:(FBWebDialogHandler)handler; + +/*! + @abstract + Presents a Facebook web dialog (https://developers.facebook.com/docs/reference/dialogs/ ) + such as feed or apprequest. + + @param session Represents the session to use for the dialog. May be nil, which uses + the active session if present, or returns NO, if not. + + @param dialog Represents the dialog or method name, such as @"feed" + + @param parameters A dictionary of parameters to be passed to the dialog + + @param handler An optional handler that will be called when the dialog is dismissed. Note, + that if the method returns NO, the handler is not called. May be nil. + + @param delegate An optional delegate to allow for advanced processing of web based + dialogs. See 'FBWebDialogsDelegate' for more details. + */ ++ (void)presentDialogModallyWithSession:(FBSession *)session + dialog:(NSString *)dialog + parameters:(NSDictionary *)parameters + handler:(FBWebDialogHandler)handler + delegate:(id)delegate; + +/*! + @abstract + Presents a Facebook apprequest dialog. + + @param session Represents the session to use for the dialog. May be nil, which uses + the active session if present. + + @param message The required message for the dialog. + + @param title An optional title for the dialog. + + @param parameters A dictionary of additional parameters to be passed to the dialog. May be nil + + @param handler An optional handler that will be called when the dialog is dismissed. May be nil. + */ ++ (void)presentRequestsDialogModallyWithSession:(FBSession *)session + message:(NSString *)message + title:(NSString *)title + parameters:(NSDictionary *)parameters + handler:(FBWebDialogHandler)handler; + +/*! + @abstract + Presents a Facebook apprequest dialog. + + @param session Represents the session to use for the dialog. May be nil, which uses + the active session if present. + + @param message The required message for the dialog. + + @param title An optional title for the dialog. + + @param parameters A dictionary of additional parameters to be passed to the dialog. May be nil + + @param handler An optional handler that will be called when the dialog is dismissed. May be nil. + + @param friendCache An optional cache object used to enable frictionless sharing for a known set of friends. The + cache instance should be preserved for the life of the session and reused for multiple calls to the present method. + As the users set of friends enabled for frictionless sharing changes, this method auto-updates the cache. + */ ++ (void)presentRequestsDialogModallyWithSession:(FBSession *)session + message:(NSString *)message + title:(NSString *)title + parameters:(NSDictionary *)parameters + handler:(FBWebDialogHandler)handler + friendCache:(FBFrictionlessRecipientCache *)friendCache; + +/*! + @abstract + Presents a Facebook feed dialog. + + @param session Represents the session to use for the dialog. May be nil, which uses + the active session if present. + + @param parameters A dictionary of additional parameters to be passed to the dialog. May be nil + + @param handler An optional handler that will be called when the dialog is dismissed. May be nil. + */ ++ (void)presentFeedDialogModallyWithSession:(FBSession *)session + parameters:(NSDictionary *)parameters + handler:(FBWebDialogHandler)handler; + +@end + +/*! + @protocol + + @abstract + The `FBWebDialogsDelegate` protocol enables the plugging of advanced behaviors into + the presentation flow of a Facebook web dialog. Advanced uses include modification + of parameters and application-level handling of links on the dialog. The + `FBFrictionlessRequestFriendCache` class implements this protocol to add frictionless + behaviors to a presentation of the request dialog. + */ +@protocol FBWebDialogsDelegate + +@optional + +/*! + @abstract + Called prior to the presentation of a web dialog + + @param dialog A string representing the method or dialog name of the dialog being presented. + + @param parameters A mutable dictionary of parameters which will be sent to the dialog. + + @param session The session object to use with the dialog. + */ +- (void)webDialogsWillPresentDialog:(NSString *)dialog + parameters:(NSMutableDictionary *)parameters + session:(FBSession *)session; + +/*! + @abstract + Called when the user of a dialog clicks a link that would cause a transition away from the application. + Your application may handle this method, and return NO if the URL handling will be performed by the application. + + @param dialog A string representing the method or dialog name of the dialog being presented. + + @param parameters A dictionary of parameters which were sent to the dialog. + + @param session The session object to use with the dialog. + + @param url The url in question, which will not be handled by the SDK if this method NO + */ +- (BOOL)webDialogsDialog:(NSString *)dialog + parameters:(NSDictionary *)parameters + session:(FBSession *)session + shouldAutoHandleURL:(NSURL *)url; + +/*! + @abstract + Called when the dialog is about to be dismissed + + @param dialog A string representing the method or dialog name of the dialog being presented. + + @param parameters A dictionary of parameters which were sent to the dialog. + + @param session The session object to use with the dialog. + + @param result A pointer to a result, which may be read or changed by the handling method as needed + + @param url A pointer to a pointer to a URL representing the URL returned by the dialog, which may be read or changed by this mehthod + + @param error A pointer to a pointer to an error object which may be read or changed by this method as needed + */ +- (void)webDialogsWillDismissDialog:(NSString *)dialog + parameters:(NSDictionary *)parameters + session:(FBSession *)session + result:(FBWebDialogResult *)result + url:(NSURL **)url + error:(NSError **)error; + +@end + diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/Facebook.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/Facebook.h new file mode 100755 index 0000000..b8c8922 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/Facebook.h @@ -0,0 +1,269 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FBFrictionlessRequestSettings.h" +#import "FBLoginDialog.h" +#import "FBRequest.h" +#import "FBSessionManualTokenCachingStrategy.h" +#import "FacebookSDK.h" + +//////////////////////////////////////////////////////////////////////////////// +// deprecated API +// +// Summary +// The classes, protocols, etc. in this header are provided for backward +// compatibility and migration; for new code, use FacebookSDK.h, and/or the +// public headers that it imports; for existing code under active development, +// Facebook.h imports FacebookSDK.h, and updates should favor the new interfaces +// whenever possible + +// up-front decl's +@class FBFrictionlessRequestSettings; +@protocol FBRequestDelegate; +@protocol FBSessionDelegate; + +/** + * Main Facebook interface for interacting with the Facebook developer API. + * Provides methods to log in and log out a user, make requests using the REST + * and Graph APIs, and start user interface interactions (such as + * pop-ups promoting for credentials, permissions, stream posts, etc.) + */ +@interface Facebook : NSObject + +@property (nonatomic, copy) NSString *accessToken; +@property (nonatomic, copy) NSDate *expirationDate; +@property (nonatomic, assign) id sessionDelegate; +@property (nonatomic, copy) NSString *urlSchemeSuffix; +@property (nonatomic, readonly) BOOL isFrictionlessRequestsEnabled; +@property (nonatomic, readonly, retain) FBSession *session; + +- (instancetype)initWithAppId:(NSString *)appId + andDelegate:(id)delegate; + +- (instancetype)initWithAppId:(NSString *)appId + urlSchemeSuffix:(NSString *)urlSchemeSuffix + andDelegate:(id)delegate; + +- (void)authorize:(NSArray *)permissions; + +- (void)extendAccessToken; + +- (void)extendAccessTokenIfNeeded; + +- (BOOL)shouldExtendAccessToken; + +- (BOOL)handleOpenURL:(NSURL *)url; + +- (void)logout; + +- (void)logout:(id)delegate; + +- (FBRequest *)requestWithParams:(NSMutableDictionary *)params + andDelegate:(id)delegate; + +- (FBRequest *)requestWithMethodName:(NSString *)methodName + andParams:(NSMutableDictionary *)params + andHttpMethod:(NSString *)httpMethod + andDelegate:(id)delegate; + +- (FBRequest *)requestWithGraphPath:(NSString *)graphPath + andDelegate:(id)delegate; + +- (FBRequest *)requestWithGraphPath:(NSString *)graphPath + andParams:(NSMutableDictionary *)params + andDelegate:(id)delegate; + +- (FBRequest *)requestWithGraphPath:(NSString *)graphPath + andParams:(NSMutableDictionary *)params + andHttpMethod:(NSString *)httpMethod + andDelegate:(id)delegate; + +- (void)dialog:(NSString *)action + andDelegate:(id)delegate; + +- (void)dialog:(NSString *)action + andParams:(NSMutableDictionary *)params + andDelegate:(id)delegate; + +- (BOOL)isSessionValid; + +- (void)enableFrictionlessRequests; + +- (void)reloadFrictionlessRecipientCache; + +- (BOOL)isFrictionlessEnabledForRecipient:(id)fbid; + +- (BOOL)isFrictionlessEnabledForRecipients:(NSArray *)fbids; + +@end + +//////////////////////////////////////////////////////////////////////////////// + +/** + * Your application should implement this delegate to receive session callbacks. + */ +@protocol FBSessionDelegate + +/** + * Called when the user successfully logged in. + */ +- (void)fbDidLogin; + +/** + * Called when the user dismissed the dialog without logging in. + */ +- (void)fbDidNotLogin:(BOOL)cancelled; + +/** + * Called after the access token was extended. If your application has any + * references to the previous access token (for example, if your application + * stores the previous access token in persistent storage), your application + * should overwrite the old access token with the new one in this method. + * See extendAccessToken for more details. + */ +- (void)fbDidExtendToken:(NSString *)accessToken + expiresAt:(NSDate *)expiresAt; + +/** + * Called when the user logged out. + */ +- (void)fbDidLogout; + +/** + * Called when the current session has expired. This might happen when: + * - the access token expired + * - the app has been disabled + * - the user revoked the app's permissions + * - the user changed his or her password + */ +- (void)fbSessionInvalidated; + +@end + +@protocol FBRequestDelegate; + +enum { + kFBRequestStateReady, + kFBRequestStateLoading, + kFBRequestStateComplete, + kFBRequestStateError +}; + +// FBRequest(Deprecated) +// +// Summary +// The deprecated category is used to maintain back compat and ease migration +// to the revised SDK for iOS + +/** + * Do not use this interface directly, instead, use method in Facebook.h + */ +@interface FBRequest (Deprecated) + +@property (nonatomic, assign) id delegate; + +/** + * The URL which will be contacted to execute the request. + */ +@property (nonatomic, copy) NSString *url; + +/** + * The API method which will be called. + */ +@property (nonatomic, copy) NSString *httpMethod; + +/** + * The dictionary of parameters to pass to the method. + * + * These values in the dictionary will be converted to strings using the + * standard Objective-C object-to-string conversion facilities. + */ +@property (nonatomic, retain) NSMutableDictionary *params; +@property (nonatomic, retain) NSURLConnection *connection; +@property (nonatomic, retain) NSMutableData *responseText; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +@property (nonatomic) FBRequestState state; +#pragma GCC diagnostic pop +@property (nonatomic) BOOL sessionDidExpire; + +/** + * Error returned by the server in case of request's failure (or nil otherwise). + */ +@property (nonatomic, retain) NSError *error; + +- (BOOL)loading; + ++ (NSString *)serializeURL:(NSString *)baseUrl + params:(NSDictionary *)params; + ++ (NSString *)serializeURL:(NSString *)baseUrl + params:(NSDictionary *)params + httpMethod:(NSString *)httpMethod; + +@end + +//////////////////////////////////////////////////////////////////////////////// + +/* + *Your application should implement this delegate + */ +@protocol FBRequestDelegate + +@optional + +/** + * Called just before the request is sent to the server. + */ +- (void)requestLoading:(FBRequest *)request; + +/** + * Called when the Facebook API request has returned a response. + * + * This callback gives you access to the raw response. It's called before + * (void)request:(FBRequest *)request didLoad:(id)result, + * which is passed the parsed response object. + */ +- (void)request:(FBRequest *)request didReceiveResponse:(NSURLResponse *)response; + +/** + * Called when an error prevents the request from completing successfully. + */ +- (void)request:(FBRequest *)request didFailWithError:(NSError *)error; + +/** + * Called when a request returns and its response has been parsed into + * an object. + * + * The resulting object may be a dictionary, an array or a string, depending + * on the format of the API response. If you need access to the raw response, + * use: + * + * (void)request:(FBRequest *)request + * didReceiveResponse:(NSURLResponse *)response + */ +- (void)request:(FBRequest *)request didLoad:(id)result; + +/** + * Called when a request returns a response. + * + * The result object is the raw response from the server of type NSData + */ +- (void)request:(FBRequest *)request didLoadRawResponse:(NSData *)data; + +@end + + diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FacebookSDK.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FacebookSDK.h new file mode 100755 index 0000000..6b7b8cc --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FacebookSDK.h @@ -0,0 +1,142 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// core +#import "FBAccessTokenData.h" +#import "FBAppCall.h" +#import "FBAppEvents.h" +#import "FBCacheDescriptor.h" +#import "FBDialogs.h" +#import "FBError.h" +#import "FBErrorUtility.h" +#import "FBFrictionlessRecipientCache.h" +#import "FBFriendPickerViewController.h" +#import "FBGraphLocation.h" +#import "FBGraphObject.h" // + design summary for graph component-group +#import "FBGraphPlace.h" +#import "FBGraphUser.h" +#import "FBInsights.h" +#import "FBLikeControl.h" +#import "FBLoginView.h" +#import "FBNativeDialogs.h" // deprecated, use FBDialogs.h +#import "FBOpenGraphAction.h" +#import "FBOpenGraphActionShareDialogParams.h" +#import "FBOpenGraphObject.h" +#import "FBPlacePickerViewController.h" +#import "FBProfilePictureView.h" +#import "FBRequest.h" +#import "FBSession.h" +#import "FBSessionTokenCachingStrategy.h" +#import "FBSettings.h" +#import "FBShareDialogParams.h" +#import "FBShareDialogPhotoParams.h" +#import "FBUserSettingsViewController.h" +#import "FBWebDialogs.h" +#import "NSError+FBError.h" + +/*! + @header + + @abstract Library header, import this to import all of the public types + in the Facebook SDK + + @discussion + +//////////////////////////////////////////////////////////////////////////////// + + + Summary: this header summarizes the structure and goals of the Facebook SDK for iOS. + Goals: + * Leverage and work well with modern features of iOS (e.g. blocks, ARC, etc.) + * Patterned after best of breed iOS frameworks (e.g. naming, pattern-use, etc.) + * Common integration experience is simple & easy to describe + * Factored to enable a growing list of scenarios over time + + Notes on approaches: + 1. We use a key scenario to drive prioritization of work for a given update + 2. We are building-atop and refactoring, rather than replacing, existing iOS SDK releases + 3. We use take an incremental approach where we can choose to maintain as little or as much compatibility with the existing SDK needed + a) and so we will be developing to this approach + b) and then at push-time for a release we will decide when/what to break + on a feature by feature basis + 4. Some light but critical infrastructure is needed to support both the goals + and the execution of this change (e.g. a build/package/deploy process) + + Design points: + We will move to a more object-oriented approach, in order to facilitate the + addition of a different class of objects, such as controls and visual helpers + (e.g. FBLikeView, FBPersonView), as well as sub-frameworks to enable scenarios + such (e.g. FBOpenGraphEntity, FBLocalEntityCache, etc.) + + As we add features, it will no longer be appropriate to host all functionality + in the Facebook class, though it will be maintained for some time for migration + purposes. Instead functionality lives in related collections of classes. + +
+ @textblock
+
+               *------------* *----------*  *----------------* *---*
+  Scenario --> |FBPersonView| |FBLikeView|  | FBPlacePicker  | | F |
+               *------------* *----------*  *----------------* | a |
+               *-------------------*  *----------*  *--------* | c |
+ Component --> |   FBGraphObject   |  | FBDialog |  | FBView | | e |
+               *-------------------*  *----------*  *--------* | b |
+               *---------* *---------* *---------------------* | o |
+      Core --> |FBSession| |FBRequest| |Utilities (e.g. JSON)| | o |
+               *---------* *---------* *---------------------* * k *
+
+ @/textblock
+ 
+ + The figure above describes three layers of functionality, with the existing + Facebook on the side as a helper proxy to a subset of the overall SDK. The + layers loosely organize the SDK into *Core Objects* necessary to interface + with Facebook, higher-level *Framework Components* that feel like natural + extensions to existing frameworks such as UIKit and Foundation, but which + surface behavior broadly applicable to Facebook, and finally the + *Scenario Objects*, which provide deeper turn-key capibilities for useful + mobile scenarios. + + Use example (low barrier use case): + +
+ @textblock
+
+// log on to Facebook
+[FBSession sessionOpenWithPermissions:nil
+                    completionHandler:^(FBSession *session,
+                                        FBSessionState status,
+                                        NSError *error) {
+                        if (session.isOpen) {
+                            // request basic information for the user
+                            [FBRequestConnection startWithGraphPath:@"me"
+                                                  completionHandler:^void(FBRequestConnection *request,
+                                                                          id result,
+                                                                          NSError *error) {
+                                                      if (!error) {
+                                                          // get json from result
+                                                      }
+                                                  }];
+                        }
+                    }];
+ @/textblock
+ 
+ + */ + +#define FB_IOS_SDK_VERSION_STRING @"3.14.0" +#define FB_IOS_SDK_TARGET_PLATFORM_VERSION @"v2.0" + diff --git a/FacebookSDK.framework/Versions/A/DeprecatedHeaders/NSError+FBError.h b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/NSError+FBError.h new file mode 100755 index 0000000..61659a5 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/DeprecatedHeaders/NSError+FBError.h @@ -0,0 +1,59 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FBError.h" + +/*! + @category NSError(FBError) + + @abstract + Adds additional properties to NSError to provide more information for Facebook related errors. + */ +@interface NSError (FBError) + +/*! + @abstract + Categorizes the error, if it is Facebook related, to simplify application mitigation behavior + + @discussion + In general, in response to an error connecting to Facebook, an application should, retry the + operation, request permissions, reconnect the application, or prompt the user to take an action. + The error category can be used to understand the class of error received from Facebook. For more infomation on this + see https://developers.facebook.com/docs/reference/api/errors/ + */ +@property (readonly) FBErrorCategory fberrorCategory; + +/*! + @abstract + If YES indicates that a user action is required in order to successfully continue with the facebook operation + + @discussion + In general if fberrorShouldNotifyUser is NO, then the application has a straightforward mitigation, such as + retry the operation or request permissions from the user, etc. In some cases it is necessary for the user to + take an action before the application continues to attempt a Facebook connection. For more infomation on this + see https://developers.facebook.com/docs/reference/api/errors/ + */ +@property (readonly) BOOL fberrorShouldNotifyUser; + +/*! + @abstract + A message suitable for display to the user, describing a user action necessary to enable Facebook functionality. + Not all Facebook errors yield a message suitable for user display; however in all cases where + fberrorShouldNotifyUser is YES, this property returns a localizable message suitable for display. + */ +@property (readonly, copy) NSString *fberrorUserMessage; + +@end diff --git a/FacebookSDK.framework/Versions/A/FacebookSDK b/FacebookSDK.framework/Versions/A/FacebookSDK new file mode 100755 index 0000000..20bf9f5 Binary files /dev/null and b/FacebookSDK.framework/Versions/A/FacebookSDK differ diff --git a/FacebookSDK.framework/Versions/A/Headers/FBAccessTokenData.h b/FacebookSDK.framework/Versions/A/Headers/FBAccessTokenData.h new file mode 100755 index 0000000..9ab0c28 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBAccessTokenData.h @@ -0,0 +1,140 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSession.h" + +/*! + @class FBAccessTokenData + + @abstract Represents an access token used for the Facebook login flow + and includes associated metadata such as expiration date and permissions. + You should use factory methods (createToken...) to construct instances + and should be treated as immutable. + + @discussion For more information, see + https://developers.facebook.com/docs/concepts/login/access-tokens-and-types/. + */ +@interface FBAccessTokenData : NSObject + +/*! + @method + + @abstract Creates an FBAccessTokenData from an App Link provided by the Facebook application + or nil if the url is not valid. + + @param url The url provided. + @param appID needed in order to verify URL format. + @param urlSchemeSuffix needed in order to verify URL format. + + */ ++ (FBAccessTokenData *)createTokenFromFacebookURL:(NSURL *)url appID:(NSString *)appID urlSchemeSuffix:(NSString *)urlSchemeSuffix; + +/*! + @method + + @abstract Creates an FBAccessTokenData from a dictionary or returns nil if required data is missing. + @param dictionary the dictionary with FBSessionTokenCachingStrategy keys. + */ ++ (FBAccessTokenData *)createTokenFromDictionary:(NSDictionary *)dictionary; + +/*! + @method + + @abstract Creates an FBAccessTokenData from existing information or returns nil if required data is missing. + + @param accessToken The token string. If nil or empty, this method will return nil. + @param permissions The permissions set. A value of nil indicates basic permissions. + @param expirationDate The expiration date. A value of nil defaults to `[NSDate distantFuture]`. + @param loginType The login source of the token. + @param refreshDate The date that token was last refreshed. A value of nil defaults to `[NSDate date]`. + */ ++ (FBAccessTokenData *)createTokenFromString:(NSString *)accessToken + permissions:(NSArray *)permissions + expirationDate:(NSDate *)expirationDate + loginType:(FBSessionLoginType)loginType + refreshDate:(NSDate *)refreshDate; + +/*! + @method + + @abstract Creates an FBAccessTokenData from existing information or returns nil if required data is missing. + + @param accessToken The token string. If nil or empty, this method will return nil. + @param permissions The permissions set. A value of nil indicates basic permissions. + @param expirationDate The expiration date. A value of nil defaults to `[NSDate distantFuture]`. + @param loginType The login source of the token. + @param refreshDate The date that token was last refreshed. A value of nil defaults to `[NSDate date]`. + @param permissionsRefreshDate The date the permissions were last refreshed. A value of nil defaults to `[NSDate distantPast]`. + */ ++ (FBAccessTokenData *)createTokenFromString:(NSString *)accessToken + permissions:(NSArray *)permissions + expirationDate:(NSDate *)expirationDate + loginType:(FBSessionLoginType)loginType + refreshDate:(NSDate *)refreshDate + permissionsRefreshDate:(NSDate *)permissionsRefreshDate; + +/*! + @method + + @abstract Returns a dictionary representation of this instance. + + @discussion This is provided for backwards compatibility with previous + access token related APIs that used a NSDictionary (see `FBSessionTokenCachingStrategy`). + */ +- (NSMutableDictionary *)dictionary; + +/*! + @method + + @abstract Returns a Boolean value that indicates whether a given object is an FBAccessTokenData object and exactly equal the receiver. + + @param accessTokenData the data to compare to the receiver. + */ +- (BOOL)isEqualToAccessTokenData:(FBAccessTokenData *)accessTokenData; + +/*! + @abstract returns the access token NSString. + */ +@property (readonly, nonatomic, copy) NSString *accessToken; + +/*! + @abstract returns the permissions associated with the access token. + */ +@property (readonly, nonatomic, copy) NSArray *permissions; + +/*! + @abstract returns the expiration date of the access token. + */ +@property (readonly, nonatomic, copy) NSDate *expirationDate; + +/*! + @abstract returns the login type associated with the token. + */ +@property (readonly, nonatomic) FBSessionLoginType loginType; + +/*! + @abstract returns the date the token was last refreshed. + */ +@property (readonly, nonatomic, copy) NSDate *refreshDate; + +/*! + @abstract returns the date the permissions were last refreshed. + */ +@property (readonly, nonatomic, copy) NSDate *permissionsRefreshDate; + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBAppCall.h b/FacebookSDK.framework/Versions/A/Headers/FBAppCall.h new file mode 100755 index 0000000..e741bad --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBAppCall.h @@ -0,0 +1,232 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBAccessTokenData.h" +#import "FBAppLinkData.h" +#import "FBDialogsData.h" +#import "FBSession.h" + +@class FBAppCall; + +/*! + @typedef FBAppCallHandler + + @abstract + A block that is passed to performAppCall to register for a callback with the results + of that AppCall + + @discussion + Pass a block of this type when calling performAppCall. This will be called on the UI + thread, once the AppCall completes. + + @param call The `FBAppCall` that was completed. + + */ +typedef void (^FBAppCallHandler)(FBAppCall *call); + +/*! + @typedef FBAppLinkFallbackHandler + + @abstract + See `+openDeferredAppLink`. + */ +typedef void (^FBAppLinkFallbackHandler)(NSError *error); + +/*! + @class FBAppCall + + @abstract + The FBAppCall object is used to encapsulate state when the app performs an + action that requires switching over to the native Facebook app, or when the app + receives an App Link. + + @discussion + - Each FBAppCall instance will have a unique ID + - This object is passed into an FBAppCallHandler for context + - dialogData will be present if this AppCall is for a Native Dialog + - appLinkData will be present if this AppCall is for an App Link + - accessTokenData will be present if this AppCall contains an access token. + */ +@interface FBAppCall : NSObject + +/*! @abstract The ID of this FBAppCall instance */ +@property (nonatomic, readonly) NSString *ID; + +/*! @abstract Error that occurred in processing this AppCall */ +@property (nonatomic, readonly) NSError *error; + +/*! @abstract Data related to a Dialog AppCall */ +@property (nonatomic, readonly) FBDialogsData *dialogData; + +/*! @abstract Data for native app link */ +@property (nonatomic, readonly) FBAppLinkData *appLinkData; + +/*! @abstract Access Token that was returned in this AppCall */ +@property (nonatomic, readonly) FBAccessTokenData *accessTokenData; + +/*! + @abstract + Returns an FBAppCall instance from a url, if applicable. Otherwise, returns nil. + + @param url The url. + + @return an FBAppCall instance if the url is valid; nil otherwise. + + @discussion This is typically used for App Link URLs. + */ ++ (FBAppCall *)appCallFromURL:(NSURL *)url; + +/*! + @abstract + Compares the receiving FBAppCall to the passed in FBAppCall + + @param appCall the other FBAppCall to compare to. + + @return YES if the AppCalls can be considered to be the same; NO if otherwise. + */ +- (BOOL)isEqualToAppCall:(FBAppCall *)appCall; + +/*! + @abstract + Call this method from the [UIApplicationDelegate application:openURL:sourceApplication:annotation:] method + of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction + with the native Facebook app or as part of SSO authorization flow. + + @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param sourceApplication The sourceApplication as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @return YES if the url was intended for the Facebook SDK, NO if not. + */ ++ (BOOL)handleOpenURL:(NSURL *)url + sourceApplication:(NSString *)sourceApplication; + +/*! + @abstract + Call this method from the [UIApplicationDelegate application:openURL:sourceApplication:annotation:] method + of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction + with the native Facebook app or as part of SSO authorization flow. + + @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param sourceApplication The sourceApplication as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param handler Optional handler that gives the app the opportunity to do some further processing on urls + that the SDK could not completely process. A fallback handler is not a requirement for such a url to be considered + handled. The fallback handler, if specified, is only ever called sychronously, before the method returns. + + @return YES if the url was intended for the Facebook SDK, NO if not. + */ ++ (BOOL)handleOpenURL:(NSURL *)url + sourceApplication:(NSString *)sourceApplication + fallbackHandler:(FBAppCallHandler)handler; + +/*! + @abstract + Call this method from the [UIApplicationDelegate application:openURL:sourceApplication:annotation:] method + of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction + with the native Facebook app or as part of SSO authorization flow. + + @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param sourceApplication The sourceApplication as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param session If this url is being sent back to this app as part of SSO authorization flow, then pass in the + session that was being opened. A nil value defaults to FBSession.activeSession + + @return YES if the url was intended for the Facebook SDK, NO if not. + */ ++ (BOOL)handleOpenURL:(NSURL *)url + sourceApplication:(NSString *)sourceApplication + withSession:(FBSession *)session; + +/*! + @abstract + Call this method from the [UIApplicationDelegate application:openURL:sourceApplication:annotation:] method + of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction + with the native Facebook app or as part of SSO authorization flow. + + @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param sourceApplication The sourceApplication as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param session If this url is being sent back to this app as part of SSO authorization flow, then pass in the + session that was being opened. A nil value defaults to FBSession.activeSession + + @param handler Optional handler that gives the app the opportunity to do some further processing on urls + that the SDK could not completely process. A fallback handler is not a requirement for such a url to be considered + handled. The fallback handler, if specified, is only ever called sychronously, before the method returns. + + @return YES if the url was intended for the Facebook SDK, NO if not. + */ ++ (BOOL)handleOpenURL:(NSURL *)url + sourceApplication:(NSString *)sourceApplication + withSession:(FBSession *)session + fallbackHandler:(FBAppCallHandler)handler; + +/*! + @abstract + Call this method when the application's applicationDidBecomeActive: is invoked. + This ensures proper state management of any pending FBAppCalls or pending login flow for the + FBSession.activeSession. If any pending FBAppCalls are found, their registered callbacks + will be invoked with appropriate state + */ ++ (void)handleDidBecomeActive; + +/*! + @abstract + Call this method when the application's applicationDidBecomeActive: is invoked. + This ensures proper state management of any pending FBAppCalls or a pending open for the + passed in FBSession. If any pending FBAppCalls are found, their registered callbacks will + be invoked with appropriate state + + @param session Session that is currently being used. Any pending calls to open will be cancelled. + If no session is provided, then the activeSession (if present) is used. + */ ++ (void)handleDidBecomeActiveWithSession:(FBSession *)session; + +/*! + @abstract + Call this method from the main thread to fetch deferred applink data. This may require + a network round trip. If successful, [+UIApplication openURL:] is invoked with the link + data. Otherwise, the fallbackHandler will be dispatched to the main thread. + + @param fallbackHandler the handler to be invoked if applink data could not be opened. + + @discussion the fallbackHandler may contain an NSError instance to capture any errors. In the + common case where there simply was no app link data, the NSError instance will be nil. + + This method should only be called from a location that occurs after any launching URL has + been processed (e.g., you should call this method from your application delegate's applicationDidBecomeActive:) + to avoid duplicate invocations of openURL:. + + If you must call this from the delegate's didFinishLaunchingWithOptions: you should + only do so if the application is not being launched by a URL. For example, + + if (launchOptions[UIApplicationLaunchOptionsURLKey] == nil) { + [FBAppCall openDeferredAppLink:^(NSError *error) { + // .... + } + } + */ ++ (void)openDeferredAppLink:(FBAppLinkFallbackHandler)fallbackHandler; + +@end + + + diff --git a/FacebookSDK.framework/Versions/A/Headers/FBAppEvents.h b/FacebookSDK.framework/Versions/A/Headers/FBAppEvents.h new file mode 100755 index 0000000..d4cb649 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBAppEvents.h @@ -0,0 +1,452 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSDKMacros.h" +#import "FBSession.h" + +/*! + + @typedef NS_ENUM (NSUInteger, FBAppEventsFlushBehavior) + + @abstract + Control when sends log events to the server + + @discussion + + */ +typedef NS_ENUM(NSUInteger, FBAppEventsFlushBehavior) { + + /*! Flush automatically: periodically (once a minute or every 100 logged events) and always at app reactivation. */ + FBAppEventsFlushBehaviorAuto = 0, + + /*! Only flush when the `flush` method is called. When an app is moved to background/terminated, the + events are persisted and re-established at activation, but they will only be written with an + explicit call to `flush`. */ + FBAppEventsFlushBehaviorExplicitOnly, + +}; + +/* + * Constant used by NSNotificationCenter for results of flushing AppEvents event logs + */ + +/*! NSNotificationCenter name indicating a result of a failed log flush attempt */ +FBSDK_EXTERN NSString *const FBAppEventsLoggingResultNotification; + + +// Predefined event names for logging events common to many apps. Logging occurs through the `logEvent` family of methods on `FBAppEvents`. +// Common event parameters are provided in the `FBAppEventsParameterNames*` constants. + +// General purpose + +/*! Log this event when an app is being activated, typically in the AppDelegate's applicationDidBecomeActive. */ +FBSDK_EXTERN NSString *const FBAppEventNameActivatedApp; + +/*! Log this event when a user has completed registration with the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameCompletedRegistration; + +/*! Log this event when a user has viewed a form of content in the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameViewedContent; + +/*! Log this event when a user has performed a search within the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameSearched; + +/*! Log this event when the user has rated an item in the app. The valueToSum passed to logEvent should be the numeric rating. */ +FBSDK_EXTERN NSString *const FBAppEventNameRated; + +/*! Log this event when the user has completed a tutorial in the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameCompletedTutorial; + +// Ecommerce related + +/*! Log this event when the user has added an item to their cart. The valueToSum passed to logEvent should be the item's price. */ +FBSDK_EXTERN NSString *const FBAppEventNameAddedToCart; + +/*! Log this event when the user has added an item to their wishlist. The valueToSum passed to logEvent should be the item's price. */ +FBSDK_EXTERN NSString *const FBAppEventNameAddedToWishlist; + +/*! Log this event when the user has entered the checkout process. The valueToSum passed to logEvent should be the total price in the cart. */ +FBSDK_EXTERN NSString *const FBAppEventNameInitiatedCheckout; + +/*! Log this event when the user has entered their payment info. */ +FBSDK_EXTERN NSString *const FBAppEventNameAddedPaymentInfo; + +/*! Log this event when the user has completed a purchase. The `[FBAppEvents logPurchase]` method is a shortcut for logging this event. */ +FBSDK_EXTERN NSString *const FBAppEventNamePurchased; + +// Gaming related + +/*! Log this event when the user has achieved a level in the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameAchievedLevel; + +/*! Log this event when the user has unlocked an achievement in the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameUnlockedAchievement; + +/*! Log this event when the user has spent app credits. The valueToSum passed to logEvent should be the number of credits spent. */ +FBSDK_EXTERN NSString *const FBAppEventNameSpentCredits; + + + +// Predefined event name parameters for common additional information to accompany events logged through the `logEvent` family +// of methods on `FBAppEvents`. Common event names are provided in the `FBAppEventName*` constants. + +/*! Parameter key used to specify currency used with logged event. E.g. "USD", "EUR", "GBP". See ISO-4217 for specific values. One reference for these is . */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameCurrency; + +/*! Parameter key used to specify method user has used to register for the app, e.g., "Facebook", "email", "Twitter", etc */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameRegistrationMethod; + +/*! Parameter key used to specify a generic content type/family for the logged event, e.g. "music", "photo", "video". Options to use will vary based upon what the app is all about. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameContentType; + +/*! Parameter key used to specify an ID for the specific piece of content being logged about. Could be an EAN, article identifier, etc., depending on the nature of the app. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameContentID; + +/*! Parameter key used to specify the string provided by the user for a search operation. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameSearchString; + +/*! Parameter key used to specify whether the activity being logged about was successful or not. `FBAppEventParameterValueYes` and `FBAppEventParameterValueNo` are good canonical values to use for this parameter. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameSuccess; + +/*! Parameter key used to specify the maximum rating available for the `FBAppEventNameRate` event. E.g., "5" or "10". */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameMaxRatingValue; + +/*! Parameter key used to specify whether payment info is available for the `FBAppEventNameInitiatedCheckout` event. `FBAppEventParameterValueYes` and `FBAppEventParameterValueNo` are good canonical values to use for this parameter. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNamePaymentInfoAvailable; + +/*! Parameter key used to specify how many items are being processed for an `FBAppEventNameInitiatedCheckout` or `FBAppEventNamePurchased` event. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameNumItems; + +/*! Parameter key used to specify the level achieved in a `FBAppEventNameAchieved` event. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameLevel; + +/*! Parameter key used to specify a description appropriate to the event being logged. E.g., the name of the achievement unlocked in the `FBAppEventNameAchievementUnlocked` event. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameDescription; + + + +// Predefined values to assign to event parameters that accompany events logged through the `logEvent` family +// of methods on `FBAppEvents`. Common event parameters are provided in the `FBAppEventParameterName*` constants. + +/*! Yes-valued parameter value to be used with parameter keys that need a Yes/No value */ +FBSDK_EXTERN NSString *const FBAppEventParameterValueYes; + +/*! No-valued parameter value to be used with parameter keys that need a Yes/No value */ +FBSDK_EXTERN NSString *const FBAppEventParameterValueNo; + + +/*! + + @class FBAppEvents + + @abstract + Client-side event logging for specialized application analytics available through Facebook App Insights + and for use with Facebook Ads conversion tracking and optimization. + + @discussion + The `FBAppEvents` static class has a few related roles: + + + Logging predefined and application-defined events to Facebook App Insights with a + numeric value to sum across a large number of events, and an optional set of key/value + parameters that define "segments" for this event (e.g., 'purchaserStatus' : 'frequent', or + 'gamerLevel' : 'intermediate') + + + Logging events to later be used for ads optimization around lifetime value. + + + Methods that control the way in which events are flushed out to the Facebook servers. + + Here are some important characteristics of the logging mechanism provided by `FBAppEvents`: + + + Events are not sent immediately when logged. They're cached and flushed out to the Facebook servers + in a number of situations: + - when an event count threshold is passed (currently 100 logged events). + - when a time threshold is passed (currently 60 seconds). + - when an app has gone to background and is then brought back to the foreground. + + + Events will be accumulated when the app is in a disconnected state, and sent when the connection is + restored and one of the above 'flush' conditions are met. + + + The `FBAppEvents` class in thread-safe in that events may be logged from any of the app's threads. + + + The developer can set the `flushBehavior` on `FBAppEvents` to force the flushing of events to only + occur on an explicit call to the `flush` method. + + + The developer can turn on console debug output for event logging and flushing to the server by using + the `FBLoggingBehaviorAppEvents` value in `[FBSettings setLoggingBehavior:]`. + + Some things to note when logging events: + + + There is a limit on the number of unique event names an app can use, on the order of 300. + + There is a limit to the number of unique parameter names in the provided parameters that can + be used per event, on the order of 25. This is not just for an individual call, but for all + invocations for that eventName. + + Event names and parameter names (the keys in the NSDictionary) must be between 2 and 40 characters, and + must consist of alphanumeric characters, _, -, or spaces. + + The length of each parameter value can be no more than on the order of 100 characters. + + */ +@interface FBAppEvents : NSObject + +/* + * Basic event logging + */ + +/*! + + @method + + @abstract + Log an event with just an eventName. + + @param eventName The name of the event to record. Limitations on number of events and name length + are given in the `FBAppEvents` documentation. + + */ ++ (void)logEvent:(NSString *)eventName; + +/*! + + @method + + @abstract + Log an event with an eventName and a numeric value to be aggregated with other events of this name. + + @param eventName The name of the event to record. Limitations on number of events and name length + are given in the `FBAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. + + @param valueToSum Amount to be aggregated into all events of this eventName, and App Insights will report + the cumulative and average value of this amount. + */ ++ (void)logEvent:(NSString *)eventName + valueToSum:(double)valueToSum; + + +/*! + + @method + + @abstract + Log an event with an eventName and a set of key/value pairs in the parameters dictionary. + Parameter limitations are described above. + + @param eventName The name of the event to record. Limitations on number of events and name construction + are given in the `FBAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBAppEvents` documentation. Commonly used parameter names + are provided in `FBAppEventParameterName*` constants. + */ ++ (void)logEvent:(NSString *)eventName + parameters:(NSDictionary *)parameters; + +/*! + + @method + + @abstract + Log an event with an eventName, a numeric value to be aggregated with other events of this name, + and a set of key/value pairs in the parameters dictionary. + + @param eventName The name of the event to record. Limitations on number of events and name construction + are given in the `FBAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. + + @param valueToSum Amount to be aggregated into all events of this eventName, and App Insights will report + the cumulative and average value of this amount. + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBAppEvents` documentation. Commonly used parameter names + are provided in `FBAppEventParameterName*` constants. + + */ ++ (void)logEvent:(NSString *)eventName + valueToSum:(double)valueToSum + parameters:(NSDictionary *)parameters; + + +/*! + + @method + + @abstract + Log an event with an eventName, a numeric value to be aggregated with other events of this name, + and a set of key/value pairs in the parameters dictionary. Providing session lets the developer + target a particular . If nil is provided, then `[FBSession activeSession]` will be used. + + @param eventName The name of the event to record. Limitations on number of events and name construction + are given in the `FBAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. + + @param valueToSum Amount to be aggregated into all events of this eventName, and App Insights will report + the cumulative and average value of this amount. Note that this is an NSNumber, and a value of `nil` denotes + that this event doesn't have a value associated with it for summation. + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBAppEvents` documentation. Commonly used parameter names + are provided in `FBAppEventParameterName*` constants. + + @param session to direct the event logging to, and thus be logged with whatever user (if any) + is associated with that . + */ ++ (void)logEvent:(NSString *)eventName + valueToSum:(NSNumber *)valueToSum + parameters:(NSDictionary *)parameters + session:(FBSession *)session; + + +/* + * Purchase logging + */ + +/*! + + @method + + @abstract + Log a purchase of the specified amount, in the specified currency. + + @param purchaseAmount Purchase amount to be logged, as expressed in the specified currency. This value + will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346). + + @param currency Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for + specific values. One reference for these is . + + @discussion This event immediately triggers a flush of the `FBAppEvents` event queue, unless the `flushBehavior` is set + to `FBAppEventsFlushBehaviorExplicitOnly`. + + */ ++ (void)logPurchase:(double)purchaseAmount + currency:(NSString *)currency; + +/*! + + @method + + @abstract + Log a purchase of the specified amount, in the specified currency, also providing a set of + additional characteristics describing the purchase. + + @param purchaseAmount Purchase amount to be logged, as expressed in the specified currency.This value + will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346). + + @param currency Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for + specific values. One reference for these is . + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBAppEvents` documentation. Commonly used parameter names + are provided in `FBAppEventParameterName*` constants. + + @discussion This event immediately triggers a flush of the `FBAppEvents` event queue, unless the `flushBehavior` is set + to `FBAppEventsFlushBehaviorExplicitOnly`. + + */ ++ (void)logPurchase:(double)purchaseAmount + currency:(NSString *)currency + parameters:(NSDictionary *)parameters; + +/*! + + @method + + @abstract + Log a purchase of the specified amount, in the specified currency, also providing a set of + additional characteristics describing the purchase, as well as an to log to. + + @param purchaseAmount Purchase amount to be logged, as expressed in the specified currency.This value + will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346). + + @param currency Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for + specific values. One reference for these is . + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBAppEvents` documentation. Commonly used parameter names + are provided in `FBAppEventParameterName*` constants. + + @param session to direct the event logging to, and thus be logged with whatever user (if any) + is associated with that . A value of `nil` will use `[FBSession activeSession]`. + + @discussion This event immediately triggers a flush of the `FBAppEvents` event queue, unless the `flushBehavior` is set + to `FBAppEventsFlushBehaviorExplicitOnly`. + + */ ++ (void)logPurchase:(double)purchaseAmount + currency:(NSString *)currency + parameters:(NSDictionary *)parameters + session:(FBSession *)session; + +/*! + @method + + @abstract This method has been replaced by [FBSettings limitEventAndDataUsage] */ ++ (BOOL)limitEventUsage __attribute__ ((deprecated("use [FBSettings limitEventAndDataUsage] instead"))); + +/*! + @method + + @abstract This method has been replaced by [FBSettings setLimitEventUsage] */ ++ (void)setLimitEventUsage:(BOOL)limitEventUsage __attribute__ ((deprecated("use [FBSettings setLimitEventAndDataUsage] instead"))); + +/*! + + @method + + @abstract + Notifies the events system that the app has launched & logs an activatedApp event. Should typically be placed in the app delegates' `applicationDidBecomeActive:` method. + */ ++ (void)activateApp; + +/* + * Control over event batching/flushing + */ + +/*! + + @method + + @abstract + Get the current event flushing behavior specifying when events are sent back to Facebook servers. + */ ++ (FBAppEventsFlushBehavior)flushBehavior; + +/*! + + @method + + @abstract + Set the current event flushing behavior specifying when events are sent back to Facebook servers. + + @param flushBehavior The desired `FBAppEventsFlushBehavior` to be used. + */ ++ (void)setFlushBehavior:(FBAppEventsFlushBehavior)flushBehavior; + + +/*! + + @method + + @abstract + Explicitly kick off flushing of events to Facebook. This is an asynchronous method, but it does initiate an immediate + kick off. Server failures will be reported through the NotificationCenter with notification ID `FBAppEventsLoggingResultNotification`. + */ ++ (void)flush; + + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBAppLinkData.h b/FacebookSDK.framework/Versions/A/Headers/FBAppLinkData.h new file mode 100755 index 0000000..dfdcd2e --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBAppLinkData.h @@ -0,0 +1,51 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/*! + @abstract This class contains information that represents an App Link from Facebook. + */ +@interface FBAppLinkData : NSObject + +/*! @abstract The target */ +@property (readonly) NSURL *targetURL; + +/*! @abstract List of the types of actions for this target */ +@property (readonly) NSArray *actionTypes; + +/*! @abstract List of the ids of the actions for this target */ +@property (readonly) NSArray *actionIDs; + +/*! @abstract Reference breadcrumb provided during creation of story */ +@property (readonly) NSString *ref; + +/*! @abstract User Agent string set by the referer */ +@property (readonly) NSString *userAgent; + +/*! @abstract Referer data is a JSON object set by the referer with referer-specific content */ +@property (readonly) NSDictionary *refererData; + +/*! @abstract Full set of query parameters for this app link */ +@property (readonly) NSDictionary *originalQueryParameters; + +/*! @abstract Original url from which applinkData was extracted */ +@property (readonly) NSURL *originalURL; + +/*! @abstract Addtional arguments supplied with the App Link data. */ +@property (readonly) NSDictionary *arguments; + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBAppLinkResolver.h b/FacebookSDK.framework/Versions/A/Headers/FBAppLinkResolver.h new file mode 100755 index 0000000..570be4a --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBAppLinkResolver.h @@ -0,0 +1,51 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import + +/*! + @class FBAppLinkResolver + + @abstract + Provides an implementation of the BFAppLinkResolving protocol that uses the Facebook app link + index to resolve App Links given a URL. It also provides an additional helper method that can resolve + multiple App Links in a single call. + + @discussion + Usage of this type requires a client token. See `[FBSettings setClientToken:]`. + */ +@interface FBAppLinkResolver : NSObject + +/*! + @abstract Asynchronously resolves App Link data for multiple URLs. + + @param urls An array of NSURLs to resolve into App Links. + @returns A BFTask that will return dictionary mapping input NSURLs to their + corresponding BFAppLink. + + @discussion + You should set the client token before making this call. See `[FBSettings setClientToken:]` + */ +- (BFTask *)appLinksFromURLsInBackground:(NSArray *)urls; + +/*! + @abstract Allocates and initializes a new instance of FBAppLinkResolver. + */ ++ (instancetype)resolver; + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBCacheDescriptor.h b/FacebookSDK.framework/Versions/A/Headers/FBCacheDescriptor.h new file mode 100755 index 0000000..2cea86e --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBCacheDescriptor.h @@ -0,0 +1,43 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSession.h" + +/*! + @class + + @abstract + Base class from which CacheDescriptors derive, provides a method to fetch data for later use + + @discussion + Cache descriptors allow your application to specify the arguments that will be + later used with another object, such as the FBFriendPickerViewController. By using a cache descriptor + instance, an application can choose to fetch data ahead of the point in time where the data is needed. + */ +@interface FBCacheDescriptor : NSObject + +/*! + @method + @abstract + Fetches and caches the data described by the cache descriptor instance, for the given session. + + @param session the to use for fetching data + */ +- (void)prefetchAndCacheForSession:(FBSession *)session; + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBColor.h b/FacebookSDK.framework/Versions/A/Headers/FBColor.h new file mode 100755 index 0000000..2c461f1 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBColor.h @@ -0,0 +1,20 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +UIColor *FBUIColorWithRGBA(uint8_t r, uint8_t g, uint8_t b, CGFloat a); +UIColor *FBUIColorWithRGB(uint8_t r, uint8_t g, uint8_t b); diff --git a/FacebookSDK.framework/Versions/A/Headers/FBDialogs.h b/FacebookSDK.framework/Versions/A/Headers/FBDialogs.h new file mode 100755 index 0000000..cb93d6d --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBDialogs.h @@ -0,0 +1,996 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBAppCall.h" +#import "FBLinkShareParams.h" +#import "FBOpenGraphActionParams.h" +#import "FBPhotoParams.h" + +@class FBSession; +@protocol FBOpenGraphAction; + +/*! + @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. */ + FBOSIntegratedShareDialogResultSucceeded = 0, + /*! Indicates that the dialog action was cancelled (either by the user or the system). */ + FBOSIntegratedShareDialogResultCancelled = 1, + /*! Indicates that the dialog could not be shown (because not on ios6 or ios6 auth was not used). */ + FBOSIntegratedShareDialogResultError = 2 +} FBOSIntegratedShareDialogResult; + +/*! + @typedef + + @abstract Defines a handler that will be called in response to the native share dialog + being displayed. + */ +typedef void (^FBOSIntegratedShareDialogHandler)(FBOSIntegratedShareDialogResult result, NSError *error); + +/*! + @typedef FBDialogAppCallCompletionHandler + + @abstract + A block that when passed to a method in FBDialogs is called back + with the results of the AppCall for that dialog. + + @discussion + This will be called on the UI thread, once the AppCall completes. + + @param call The `FBAppCall` that was completed. + + @param results The results of the AppCall for the dialog. This parameters is present + purely for convenience, and is the exact same value as call.dialogData.results. + + @param error The `NSError` representing any error that occurred. This parameters is + present purely for convenience, and is the exact same value as call.error. + + */ +typedef void (^FBDialogAppCallCompletionHandler)( + FBAppCall *call, + NSDictionary *results, + NSError *error); + +/*! + @class FBDialogs + + @abstract + Provides methods to display native (i.e., non-Web-based) dialogs to the user. + + @discussion + If you are building an app with a urlSchemeSuffix, you should also set the appropriate + plist entry. See `[FBSettings defaultUrlSchemeSuffix]`. + */ +@interface FBDialogs : NSObject + +#pragma mark - OSIntegratedShareDialog + +/*! + @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)presentOSIntegratedShareDialogModallyFrom:(UIViewController *)viewController + initialText:(NSString *)initialText + image:(UIImage *)image + url:(NSURL *)url + handler:(FBOSIntegratedShareDialogHandler)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)presentOSIntegratedShareDialogModallyFrom:(UIViewController *)viewController + initialText:(NSString *)initialText + images:(NSArray *)images + urls:(NSArray *)urls + handler:(FBOSIntegratedShareDialogHandler)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 + 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 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)presentOSIntegratedShareDialogModallyFrom:(UIViewController *)viewController + session:(FBSession *)session + initialText:(NSString *)initialText + images:(NSArray *)images + urls:(NSArray *)urls + handler:(FBOSIntegratedShareDialogHandler)handler; + +/*! + @abstract + Determines whether a call to presentShareDialogModallyFrom: will successfully present + a dialog. This is useful for applications that need to modify the available UI controls + depending on whether the dialog is available on the current platform and for the current + user. + + @param session The 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. + + @return YES if the dialog would be presented for the session, and NO if not + */ ++ (BOOL)canPresentOSIntegratedShareDialogWithSession:(FBSession *)session; + +#pragma mark - Native Share Dialog + +/*! + @abstract + Determines whether a call to presentShareDialogWithOpenGraphActionParams:clientState:handler: + will successfully present a dialog in the Facebook application. This is useful for applications + that need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @param params The parameters for the FB share dialog. + + @return YES if the dialog would be presented, and NO if not + + @discussion A return value of YES here indicates that the corresponding + presentShareDialogWithOpenGraphActionParams method will return a non-nil FBAppCall for + the same params. And vice versa. +*/ ++ (BOOL)canPresentShareDialogWithOpenGraphActionParams:(FBOpenGraphActionParams *)params; + +/*! + @abstract + Determines whether a call to presentShareDialogWithTarget: will successfully + present a dialog in the Facebook application. This is useful for applications that + need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @param params The parameters for the FB share dialog. + + @return YES if the dialog would be presented, and NO if not + + @discussion A return value of YES here indicates that the corresponding + presentShareDialogWithParams method will return a non-nil FBAppCall for the same + params. And vice versa. +*/ ++ (BOOL)canPresentShareDialogWithParams:(FBLinkShareParams *)params; + +/*! + @abstract + Determines whether a call to presentShareDialogWithPhotoParams: will successfully + present a dialog in the Facebook application. This is useful for applications that + need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @return YES if the dialog would be presented, and NO if not + + @discussion A return value of YES here indicates that the corresponding + presentShareDialogWithPhotoParams method will return a non-nil FBAppCall. +*/ ++ (BOOL)canPresentShareDialogWithPhotos; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share a status + update that may include text, images, or URLs. No session is required, and the app + does not need to be authorized to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the FB share dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithParams:(FBLinkShareParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithLink:(NSURL *)link + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param name The name, or title associated with the link. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithLink:(NSURL *)link + name:(NSString *)name + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param name The name, or title associated with the link. May be nil. + + @param caption The caption to be used with the link. May be nil. + + @param description The description associated with the link. May be nil. + + @param picture The link to a thumbnail to associate with the link. May be nil. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithLink:(NSURL *)link + name:(NSString *)name + caption:(NSString *)caption + description:(NSString *)description + picture:(NSURL *)picture + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the FB share dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithPhotoParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithPhotoParams:(FBPhotoParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param photos An NSArray containing UIImages to be shared. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithPhotoParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithPhotos:(NSArray *)photos + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param photos An NSArray containing UIImages to be shared. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithPhotoParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithPhotos:(NSArray *)photos + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to publish an Open + Graph action. No session is required, and the app does not need to be authorized to call + this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the Open Graph action dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithOpenGraphActionParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithOpenGraphActionParams:(FBOpenGraphActionParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to publish the + supplied Open Graph action. No session is required, and the app does not need to be + authorized to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param action The Open Graph action to be published. May not be nil. + + @param actionType the fully-specified Open Graph action type of the action (e.g., + my_app_namespace:my_action). + + @param previewPropertyName the name of the property on the action that represents the + primary Open Graph object associated with the action; this object will be displayed in the + preview portion of the share dialog. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithOpenGraphActionParams method is also returning YES for the same params. + */+ (FBAppCall *)presentShareDialogWithOpenGraphAction:(id)action + actionType:(NSString *)actionType + previewPropertyName:(NSString *)previewPropertyName + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to publish the + supplied Open Graph action. No session is required, and the app does not need to be + authorized to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param action The Open Graph action to be published. May not be nil. + + @param actionType the fully-specified Open Graph action type of the action (e.g., + my_app_namespace:my_action). + + @param previewPropertyName the name of the property on the action that represents the + primary Open Graph object associated with the action; this object will be displayed in the + preview portion of the share dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithOpenGraphActionParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithOpenGraphAction:(id)action + actionType:(NSString *)actionType + previewPropertyName:(NSString *)previewPropertyName + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +#pragma mark - Message Dialog + +/*! + @abstract + Determines whether a call to `presentMessageDialogWithOpenGraphActionParams:...` will + successfully present a dialog in the Facebook Messenger app. This is useful for applications + that need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @param params the dialog parameters + + @return YES if the dialog would be presented, and NO if not +*/ ++ (BOOL)canPresentMessageDialogWithOpenGraphActionParams:(FBOpenGraphActionParams *)params; + +/*! + @abstract + Determines whether a call to `presentMessageDialogWithParams:...` will successfully + present a dialog in the Facebook Messenger app. This is useful for applications that + need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @param params the dialog parameters + + @return YES if the dialog would be presented, and NO if not +*/ ++ (BOOL)canPresentMessageDialogWithParams:(FBLinkShareParams *)params; + +/*! + @abstract + Determines whether a call to `presentMessageDialogWithPhotos:...` will successfully + present a dialog in the Facebook Messenger app. This is useful for applications that + need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @return YES if the dialog would be presented, and NO if not +*/ ++ (BOOL)canPresentMessageDialogWithPhotos; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to publish an Open + Graph action. No session is required, and the app does not need to be authorized to call + this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the Open Graph action dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + `canPresentMessageDialogWithOpenGraphActionParams:` method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithOpenGraphActionParams:(FBOpenGraphActionParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to publish the + supplied Open Graph action. No session is required, and the app does not need to be + authorized to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param action The Open Graph action to be published. May not be nil. + + @param actionType the fully-specified Open Graph action type of the action (e.g., + my_app_namespace:my_action). + + @param previewPropertyName the name of the property on the action that represents the + primary Open Graph object associated with the action; this object will be displayed in the + preview portion of the share dialog. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentMessageDialogWithOpenGraphActionParams method is also returning YES for the same params. + */+ (FBAppCall *)presentMessageDialogWithOpenGraphAction:(id)action + actionType:(NSString *)actionType + previewPropertyName:(NSString *)previewPropertyName + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to publish the + supplied Open Graph action. No session is required, and the app does not need to be + authorized to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param action The Open Graph action to be published. May not be nil. + + @param actionType the fully-specified Open Graph action type of the action (e.g., + my_app_namespace:my_action). + + @param previewPropertyName the name of the property on the action that represents the + primary Open Graph object associated with the action; this object will be displayed in the + preview portion of the share dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentMessageDialogWithOpenGraphActionParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithOpenGraphAction:(id)action + actionType:(NSString *)actionType + previewPropertyName:(NSString *)previewPropertyName + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to send the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the Message Dialog + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + `canPresentMessageDialogWithPhotos` method is also returning YES. + */ ++ (FBAppCall *)presentMessageDialogWithPhotoParams:(FBPhotoParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to send the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param photos An NSArray containing UIImages to be shared. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + `canPresentMessageDialogWithPhotos` method is also returning YES. + */ ++ (FBAppCall *)presentMessageDialogWithPhotos:(NSArray *)photos + handler:(FBDialogAppCallCompletionHandler)handler; +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to send the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param photos An NSArray containing UIImages to be shared. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + `canPresentMessageDialogWithPhotos` method is also returning YES. +*/ ++ (FBAppCall *)presentMessageDialogWithPhotos:(NSArray *)photos + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to share a status + update that may include text, images, or URLs. No session is required, and the app + does not need to be authorized to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the Message Dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + `canPresentMessageDialogWithParams:` method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithParams:(FBLinkShareParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentMessageDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithLink:(NSURL *)link + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param name The name, or title associated with the link. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentMessageDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithLink:(NSURL *)link + name:(NSString *)name + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param name The name, or title associated with the link. May be nil. + + @param caption The caption to be used with the link. May be nil. + + @param description The description associated with the link. May be nil. + + @param picture The link to a thumbnail to associate with the link. May be nil. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentMessageDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithLink:(NSURL *)link + name:(NSString *)name + caption:(NSString *)caption + description:(NSString *)description + picture:(NSURL *)picture + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBDialogsData.h b/FacebookSDK.framework/Versions/A/Headers/FBDialogsData.h new file mode 100755 index 0000000..bffbc46 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBDialogsData.h @@ -0,0 +1,35 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/*! + @abstract + This class encapsulates state and data related to the presentation and completion + of a dialog. + */ +@interface FBDialogsData : NSObject + +/*! @abstract The method being performed */ +@property (nonatomic, readonly) NSString *method; +/*! @abstract The arguments being passed to the entity that will show the dialog */ +@property (nonatomic, readonly) NSDictionary *arguments; +/*! @abstract Client JSON state that is passed through to the completion handler for context */ +@property (nonatomic, readonly) NSDictionary *clientState; +/*! @abstract Results of this FBAppCall that are only set before calling an FBAppCallHandler */ +@property (nonatomic, readonly) NSDictionary *results; + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBDialogsParams.h b/FacebookSDK.framework/Versions/A/Headers/FBDialogsParams.h new file mode 100755 index 0000000..9197de5 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBDialogsParams.h @@ -0,0 +1,28 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/*! + @class FBDialogsParams + + @abstract + This object is used as a base class for parameters passed to native dialogs that + open in the Facebook app. + */ +@interface FBDialogsParams : NSObject + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBError.h b/FacebookSDK.framework/Versions/A/Headers/FBError.h new file mode 100755 index 0000000..a2716e2 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBError.h @@ -0,0 +1,389 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSDKMacros.h" + +/*! + The NSError domain of all errors returned by the Facebook SDK. +*/ +FBSDK_EXTERN NSString *const FacebookSDKDomain; + +/*! + The NSError domain of all errors surfaced by the Facebook SDK that + were returned by the Facebook Application + */ +FBSDK_EXTERN NSString *const FacebookNativeApplicationDomain; + +/*! + The key in the userInfo NSDictionary of NSError where you can find + the inner NSError (if any). +*/ +FBSDK_EXTERN NSString *const FBErrorInnerErrorKey; + +/*! + The key in the userInfo NSDictionary of NSError for the parsed JSON response + from the server. In case of a batch, includes the JSON for a single FBRequest. +*/ +FBSDK_EXTERN NSString *const FBErrorParsedJSONResponseKey; + +/*! + The key in the userInfo NSDictionary of NSError indicating + the HTTP status code of the response (if any). +*/ +FBSDK_EXTERN NSString *const FBErrorHTTPStatusCodeKey; + +/*! + @typedef NS_ENUM (NSUInteger, FBErrorCode) + @abstract Error codes returned by the Facebook SDK in NSError. + + @discussion + These are valid only in the scope of FacebookSDKDomain. + */ +typedef NS_ENUM(NSUInteger, FBErrorCode) { + /*! + Like nil for FBErrorCode values, represents an error code that + has not been initialized yet. + */ + FBErrorInvalid = 0, + + /*! The operation failed because it was cancelled. */ + FBErrorOperationCancelled, + + /*! A login attempt failed */ + FBErrorLoginFailedOrCancelled, + + /*! The graph API returned an error for this operation. */ + FBErrorRequestConnectionApi, + + /*! + The operation failed because the server returned an unexpected + response. You can get this error if you are not using the most + recent SDK, or if you set your application's migration settings + incorrectly for the version of the SDK you are using. + + If this occurs on the current SDK with proper app migration + settings, you may need to try changing to one request per batch. + */ + FBErrorProtocolMismatch, + + /*! Non-success HTTP status code was returned from the operation. */ + FBErrorHTTPError, + + /*! An endpoint that returns a binary response was used with FBRequestConnection. + Endpoints that return image/jpg, etc. should be accessed using NSURLRequest */ + FBErrorNonTextMimeTypeReturned, + + /*! An error occurred while trying to display a native dialog */ + FBErrorDialog, + + /*! An error occurred using the FBAppEvents class */ + FBErrorAppEvents, + + /*! An error occurred related to an iOS API call */ + FBErrorSystemAPI, + + /*! An error occurred while trying to fetch publish install response data */ + FBErrorPublishInstallResponse, + + /*! + The application had its applicationDidBecomeActive: method called while waiting + on a response from the native Facebook app for a pending FBAppCall. + */ + FBErrorAppActivatedWhilePendingAppCall, + + /*! + The application had its openURL: method called from a source that was not a + Facebook app and with a URL that was intended for the AppBridge + */ + FBErrorUntrustedURL, + + /*! + The URL passed to FBAppCall, was not able to be parsed + */ + FBErrorMalformedURL, + + /*! + The operation failed because the session is currently busy reconnecting. + */ + FBErrorSessionReconnectInProgess, + + /*! + Reserved for future use. + */ + FBErrorOperationDisallowedForRestrictedTreament, +}; + +/*! + @typedef NS_ENUM (NSUInteger, FBNativeApplicationErrorCode) + @abstract Error codes returned by the Facebook SDK in NSError. + + @discussion + These are valid only in the scope of FacebookNativeApplicationDomain. + */ +typedef NS_ENUM(NSUInteger, FBNativeApplicationErrorCode) { + /*! A general error in processing an FBAppCall, without a known cause. Unhandled exceptions are a good example */ + FBAppCallErrorUnknown = 1, + + /*! The FBAppCall cannot be processed for some reason */ + FBAppCallErrorUnsupported = 2, + + /*! The FBAppCall is for a method that does not exist (or is turned off) */ + FBAppCallErrorUnknownMethod = 3, + + /*! The FBAppCall cannot be processed at the moment, but can be retried at a later time. */ + FBAppCallErrorServiceBusy = 4, + + /*! Share was called in the native Facebook app with incomplete or incorrect arguments */ + FBShareErrorInvalidParam = 100, + + /*! A server error occurred while calling Share in the native Facebook app. */ + FBShareErrorServer = 102, + + /*! An unknown error occurred while calling Share in the native Facebook app. */ + FBShareErrorUnknown = 103, + + /*! Disallowed from calling Share in the native Facebook app. */ + FBShareErrorDenied = 104, +}; + +/*! + @typedef NS_ENUM (NSInteger, FBErrorCategory) + + @abstract Indicates the Facebook SDK classification for the error + + @discussion + */ +typedef NS_ENUM(NSInteger, FBErrorCategory) { + /*! Indicates that the error category is invalid and likely represents an error that + is unrelated to Facebook or the Facebook SDK */ + FBErrorCategoryInvalid = 0, + /*! Indicates that the error may be authentication related but the application should retry the operation. + This case may involve user action that must be taken, and so the application should also test + the fberrorShouldNotifyUser property and if YES display fberrorUserMessage to the user before retrying.*/ + FBErrorCategoryRetry = 1, + /*! Indicates that the error is authentication related and the application should reopen the session */ + FBErrorCategoryAuthenticationReopenSession = 2, + /*! Indicates that the error is permission related */ + FBErrorCategoryPermissions = 3, + /*! Indicates that the error implies that the server had an unexpected failure or may be temporarily down */ + FBErrorCategoryServer = 4, + /*! Indicates that the error results from the server throttling the client */ + FBErrorCategoryThrottling = 5, + /*! Indicates the user cancelled the operation */ + FBErrorCategoryUserCancelled = 6, + /*! Indicates that the error is Facebook-related but is uncategorizable, and likely newer than the + current version of the SDK */ + FBErrorCategoryFacebookOther = -1, + /*! Indicates that the error is an application error resulting in a bad or malformed request to the server. */ + FBErrorCategoryBadRequest = -2, +}; + +/*! + The key in the userInfo NSDictionary of NSError where you can find + the inner NSError (if any). + */ +FBSDK_EXTERN NSString *const FBErrorInnerErrorKey; + +/*! + The key in the userInfo NSDictionary of NSError where you can find + the session associated with the error (if any). +*/ +FBSDK_EXTERN NSString *const FBErrorSessionKey; + +/*! + The key in the userInfo NSDictionary of NSError that points to the URL + that caused an error, in its processing by FBAppCall. + */ +FBSDK_EXTERN NSString *const FBErrorUnprocessedURLKey; + +/*! + The key in the userInfo NSDictionary of NSError for unsuccessful + logins (error.code equals FBErrorLoginFailedOrCancelled). If present, + the value will be one of the constants prefixed by FBErrorLoginFailedReason*. +*/ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReason; + +/*! + The key in the userInfo NSDictionary of NSError for unsuccessful + logins (error.code equals FBErrorLoginFailedOrCancelled). If present, + the value indicates an original login error code wrapped by this error. + This is only used in the web dialog login flow. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedOriginalErrorCode; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates the user + cancelled a web dialog auth. +*/ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonInlineCancelledValue; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates the user + did not cancel a web dialog auth. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonInlineNotCancelledValue; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates the user + cancelled a non-iOS 6 SSO (either Safari or Facebook App) login. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonUserCancelledValue; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates the user + cancelled an iOS system login. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonUserCancelledSystemValue; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates an error + condition. You may inspect the rest of userInfo for other data. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonOtherError; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates the app's + slider in iOS 6 (device Settings -> Privacy -> Facebook {app}) has + been disabled. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonSystemDisallowedWithoutErrorValue; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates an error + has occurred when requesting Facebook account acccess in iOS 6 that was + not `FBErrorLoginFailedReasonSystemDisallowedWithoutErrorValue` nor + a user cancellation. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonSystemError; +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonUnitTestResponseUnrecognized; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key when requesting new permissions fails. Indicates + the request for new permissions has failed because the session was closed. + */ +FBSDK_EXTERN NSString *const FBErrorReauthorizeFailedReasonSessionClosed; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key when requesting new permissions fails. Indicates + the request for new permissions has failed because the user cancelled. + */ +FBSDK_EXTERN NSString *const FBErrorReauthorizeFailedReasonUserCancelled; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key when requesting new permissions fails on + iOS 6 with the Facebook account. Indicates the request for new permissions has + failed because the user cancelled. + */ +FBSDK_EXTERN NSString *const FBErrorReauthorizeFailedReasonUserCancelledSystem; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key when requesting new permissions fails. Indicates + the request for new permissions has failed because the request was + for a different user than the original permission set. + */ +FBSDK_EXTERN NSString *const FBErrorReauthorizeFailedReasonWrongUser; + +/*! + The key in the userInfo NSDictionary of NSError for errors + encountered with `FBDialogs` operations. (error.code equals FBErrorDialog). + If present, the value will be one of the constants prefixed by FBErrorDialog *. +*/ +FBSDK_EXTERN NSString *const FBErrorDialogReasonKey; + +/*! + A value that may appear in the NSError userInfo dictionary under the +`FBErrorDialogReasonKey` key. Indicates that a native dialog is not supported + in the current OS. +*/ +FBSDK_EXTERN NSString *const FBErrorDialogNotSupported; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorDialogReasonKey` key. Indicates that a native dialog cannot be + displayed because it is not appropriate for the current session. +*/ +FBSDK_EXTERN NSString *const FBErrorDialogInvalidForSession; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorDialogReasonKey` key. Indicates that a native dialog cannot be + displayed for some other reason. + */ +FBSDK_EXTERN NSString *const FBErrorDialogCantBeDisplayed; + +/*! + A value that may appear in the NSError userInfo ditionary under the + `FBErrorDialogReasonKey` key. Indicates that a native dialog cannot be + displayed because an Open Graph object that was passed was not configured + correctly. The object must either (a) exist by having an 'id' or 'url' value; + or, (b) configured for creation (by setting the 'type' value and + provisionedForPost property) +*/ +FBSDK_EXTERN NSString *const FBErrorDialogInvalidOpenGraphObject; + +/*! + A value that may appear in the NSError userInfo ditionary under the + `FBErrorDialogReasonKey` key. Indicates that a native dialog cannot be + displayed because the parameters for sharing an Open Graph action were + not configured. The parameters must include an 'action', 'actionType', and + 'previewPropertyName'. + */ +FBSDK_EXTERN NSString *const FBErrorDialogInvalidOpenGraphActionParameters; + +/*! + A value that may appear in the NSError userInfo ditionary under the + `FBErrorDialogReasonKey` key. Indicates that a native dialog cannot be + displayed because the parameters for sharing a status update, link, or photo were + not configured. The parameters must not include both 'photos' and a 'link'. */ +FBSDK_EXTERN NSString *const FBErrorDialogInvalidShareParameters; + +/*! + A value that may appear in the NSError userInfo ditionary under the + `FBErrorDialogReasonKey` key. Indicates that a like dialog cannot be + displayed because the objectID parameter value is invalid. + */ +FBSDK_EXTERN NSString *const FBErrorDialogInvalidLikeObjectID; + +/*! + The key in the userInfo NSDictionary of NSError for errors + encountered with `FBAppEvents` operations (error.code equals FBErrorAppEvents). +*/ +FBSDK_EXTERN NSString *const FBErrorAppEventsReasonKey; + +// Exception strings raised by the Facebook SDK + +/*! + This exception is raised by methods in the Facebook SDK to indicate + that an attempted operation is invalid + */ +FBSDK_EXTERN NSString *const FBInvalidOperationException; + +// Facebook SDK also raises exceptions the following common exceptions: +// NSInvalidArgumentException + diff --git a/FacebookSDK.framework/Versions/A/Headers/FBErrorUtility.h b/FacebookSDK.framework/Versions/A/Headers/FBErrorUtility.h new file mode 100755 index 0000000..4e4c7e0 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBErrorUtility.h @@ -0,0 +1,67 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FBError.h" + +/*! + @class FBErrorUtility + + @abstract A utility class with methods to provide more information for Facebook + related errors if you do not want to use the NSError(FBError) category. + + */ +@interface FBErrorUtility : NSObject + +/*! + @abstract + Categorizes the error, if it is Facebook related, to simplify application mitigation behavior + + @discussion + In general, in response to an error connecting to Facebook, an application should, retry the + operation, request permissions, reconnect the application, or prompt the user to take an action. + The error category can be used to understand the class of error received from Facebook. For more infomation on this + see https://developers.facebook.com/docs/reference/api/errors/ + + @param error the error to be categorized. + */ ++ (FBErrorCategory)errorCategoryForError:(NSError *)error; + +/*! + @abstract + If YES indicates that a user action is required in order to successfully continue with the facebook operation + + @discussion + In general if this returns NO, then the application has a straightforward mitigation, such as + retry the operation or request permissions from the user, etc. In some cases it is necessary for the user to + take an action before the application continues to attempt a Facebook connection. For more infomation on this + see https://developers.facebook.com/docs/reference/api/errors/ + + @param error the error to inspect. + */ ++ (BOOL)shouldNotifyUserForError:(NSError *)error; + +/*! + @abstract + A message suitable for display to the user, describing a user action necessary to enable Facebook functionality. + Not all Facebook errors yield a message suitable for user display; however in all cases where + fberrorShouldNotifyUser is YES, this property returns a localizable message suitable for display. + + @param error the error to inspect. + */ ++ (NSString *)userMessageForError:(NSError *)error; + + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBFrictionlessRecipientCache.h b/FacebookSDK.framework/Versions/A/Headers/FBFrictionlessRecipientCache.h new file mode 100755 index 0000000..cfca124 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBFrictionlessRecipientCache.h @@ -0,0 +1,81 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#import + +#import "FBCacheDescriptor.h" +#import "FBRequest.h" +#import "FBWebDialogs.h" + +/*! + @class FBFrictionlessRecipientCache + + @abstract + Maintains a cache of friends that can recieve application requests from the user in + using the frictionless feature of the requests web dialog. + + This class follows the `FBCacheDescriptor` pattern used elsewhere in the SDK, and applications may call + one of the prefetchAndCacheForSession methods to fetch a friend list prior to the + point where a dialog is presented. The cache is also updated with each presentation of the request + dialog using the cache instance. + */ +@interface FBFrictionlessRecipientCache : FBCacheDescriptor + +/*! @abstract An array containing the list of known FBIDs for recipients enabled for frictionless requests */ +@property (nonatomic, readwrite, copy) NSArray *recipientIDs; + +/*! + @abstract + Checks to see if a given user or FBID for a user is known to be enabled for + frictionless requestests + + @param user An NSString, NSNumber of `FBGraphUser` representing a user to check + */ +- (BOOL)isFrictionlessRecipient:(id)user; + +/*! + @abstract + Checks to see if a collection of users or FBIDs for users are known to be enabled for + frictionless requestests + + @param users An NSArray of NSString, NSNumber of `FBGraphUser` objects + representing users to check + */ +- (BOOL)areFrictionlessRecipients:(NSArray *)users; + +/*! + @abstract + Issues a request and fills the cache with a list of users to use for frictionless requests + + @param session The session to use for the request; nil indicates that the Active Session should + be used + */ +- (void)prefetchAndCacheForSession:(FBSession *)session; + +/*! + @abstract + Issues a request and fills the cache with a list of users to use for frictionless requests + + @param session The session to use for the request; nil indicates that the Active Session should + be used + + @param handler An optional completion handler, called when the request for cached users has + completed. It can be useful to use the handler to enable UI or perform other request-related + operations, after the cache is populated. + */ +- (void)prefetchAndCacheForSession:(FBSession *)session + completionHandler:(FBRequestHandler)handler; + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBFriendPickerViewController.h b/FacebookSDK.framework/Versions/A/Headers/FBFriendPickerViewController.h new file mode 100755 index 0000000..187ad25 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBFriendPickerViewController.h @@ -0,0 +1,290 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBCacheDescriptor.h" +#import "FBGraphUser.h" +#import "FBSession.h" +#import "FBViewController.h" + +@protocol FBFriendPickerDelegate; +@class FBFriendPickerCacheDescriptor; + +/*! + @typedef NS_ENUM (NSUInteger, FBFriendSortOrdering) + + @abstract Indicates the order in which friends should be listed in the friend picker. + + @discussion + */ +typedef NS_ENUM(NSUInteger, FBFriendSortOrdering) { + /*! Sort friends by first, middle, last names. */ + FBFriendSortByFirstName = 0, + /*! Sort friends by last, first, middle names. */ + FBFriendSortByLastName +}; + +/*! + @typedef NS_ENUM (NSUInteger, FBFriendDisplayOrdering) + + @abstract Indicates whether friends should be displayed first-name-first or last-name-first. + + @discussion + */ +typedef NS_ENUM(NSUInteger, FBFriendDisplayOrdering) { + /*! Display friends as First Middle Last. */ + FBFriendDisplayByFirstName = 0, + /*! Display friends as Last First Middle. */ + FBFriendDisplayByLastName, +}; + + +/*! + @class + + @abstract + The `FBFriendPickerViewController` class creates a controller object that manages + the user interface for displaying and selecting Facebook friends. + + @discussion + When the `FBFriendPickerViewController` view loads it creates a `UITableView` object + where the friends will be displayed. You can access this view through the `tableView` + property. The friend display can be sorted by first name or last name. Friends' + names can be displayed with the first name first or the last name first. + + The friend data can be pre-fetched and cached prior to using the view controller. The + cache is setup using an object that can trigger the + data fetch. Any friend data requests will first check the cache and use that data. + If the friend picker is being displayed cached data will initially be shown before + a fresh copy is retrieved. + + The `delegate` property may be set to an object that conforms to the + protocol. The `delegate` object will receive updates related to friend selection and + data changes. The delegate can also be used to filter the friends to display in the + picker. + */ +@interface FBFriendPickerViewController : FBViewController + +/*! + @abstract + Returns an outlet for the spinner used in the view controller. + */ +@property (nonatomic, retain) IBOutlet UIActivityIndicatorView *spinner; + +/*! + @abstract + Returns an outlet for the table view managed by the view controller. + */ +@property (nonatomic, retain) IBOutlet UITableView *tableView; + +/*! + @abstract + A Boolean value that specifies whether multi-select is enabled. + */ +@property (nonatomic) BOOL allowsMultipleSelection; + +/*! + @abstract + A Boolean value that indicates whether friend profile pictures are displayed. + */ +@property (nonatomic) BOOL itemPicturesEnabled; + +/*! + @abstract + Addtional fields to fetch when making the Graph API call to get friend data. + */ +@property (nonatomic, copy) NSSet *fieldsForRequest; + +/*! + @abstract + The session that is used in the request for friend data. + */ +@property (nonatomic, retain) FBSession *session; + +/*! + @abstract + The profile ID of the user whose friends are being viewed. + */ +@property (nonatomic, copy) NSString *userID; + +/*! + @abstract + The list of friends that are currently selected in the veiw. + The items in the array are objects. + + @discussion + You can set this this array to pre-select items in the picker. The objects in the array + must be complete id objects (i.e., fetched from a Graph query or from a + previous picker's selection, with id and appropriate name fields). + */ +@property (nonatomic, copy) NSArray *selection; + +/*! + @abstract + The order in which friends are sorted in the display. + */ +@property (nonatomic) FBFriendSortOrdering sortOrdering; + +/*! + @abstract + The order in which friends' names are displayed. + */ +@property (nonatomic) FBFriendDisplayOrdering displayOrdering; + +/*! + @abstract + Initializes a friend picker view controller. + + @param aDecoder An unarchiver object. + */ +- (instancetype)initWithCoder:(NSCoder *)aDecoder; + +/*! + @abstract + Used to initialize the object + + @param nibNameOrNil The name of the nib file to associate with the view controller. The nib file name should not contain any leading path information. If you specify nil, the nibName property is set to nil. + @param nibBundleOrNil The bundle in which to search for the nib file. This method looks for the nib file in the bundle's language-specific project directories first, followed by the Resources directory. If nil, this method looks for the nib file in the main bundle. + */ +- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil; + +/*! + @abstract + Configures the properties used in the caching data queries. + + @discussion + Cache descriptors are used to fetch and cache the data used by the view controller. + If the view controller finds a cached copy of the data, it will + first display the cached content then fetch a fresh copy from the server. + + @param cacheDescriptor The containing the cache query properties. + */ +- (void)configureUsingCachedDescriptor:(FBCacheDescriptor *)cacheDescriptor; + +/*! + @abstract + Initiates a query to get friend data. + + @discussion + A cached copy will be returned if available. The cached view is temporary until a fresh copy is + retrieved from the server. It is legal to call this more than once. + */ +- (void)loadData; + +/*! + @abstract + Updates the view locally without fetching data from the server or from cache. + + @discussion + Use this if the filter or sort properties change. This may affect the order or + display of friend information but should not need require new data. + */ +- (void)updateView; + +/*! + @abstract + Clears the current selection, so the picker is ready for a fresh use. + */ +- (void)clearSelection; + +/*! + @method + + @abstract + Creates a cache descriptor based on default settings of the `FBFriendPickerViewController` object. + + @discussion + An `FBCacheDescriptor` object may be used to pre-fetch data before it is used by + the view controller. It may also be used to configure the `FBFriendPickerViewController` + object. + */ ++ (FBCacheDescriptor *)cacheDescriptor; + +/*! + @method + + @abstract + Creates a cache descriptor with additional fields and a profile ID for use with the `FBFriendPickerViewController` object. + + @discussion + An `FBCacheDescriptor` object may be used to pre-fetch data before it is used by + the view controller. It may also be used to configure the `FBFriendPickerViewController` + object. + + @param userID The profile ID of the user whose friends will be displayed. A nil value implies a "me" alias. + @param fieldsForRequest The set of additional fields to include in the request for friend data. + */ ++ (FBCacheDescriptor *)cacheDescriptorWithUserID:(NSString *)userID fieldsForRequest:(NSSet *)fieldsForRequest; + +@end + +/*! + @protocol + + @abstract + The `FBFriendPickerDelegate` protocol defines the methods used to receive event + notifications and allow for deeper control of the + view. + */ +@protocol FBFriendPickerDelegate +@optional + +/*! + @abstract + Tells the delegate that data has been loaded. + + @discussion + The object's `tableView` property is automatically + reloaded when this happens. However, if another table view, for example the + `UISearchBar` is showing data, then it may also need to be reloaded. + + @param friendPicker The friend picker view controller whose data changed. + */ +- (void)friendPickerViewControllerDataDidChange:(FBFriendPickerViewController *)friendPicker; + +/*! + @abstract + Tells the delegate that the selection has changed. + + @param friendPicker The friend picker view controller whose selection changed. + */ +- (void)friendPickerViewControllerSelectionDidChange:(FBFriendPickerViewController *)friendPicker; + +/*! + @abstract + Asks the delegate whether to include a friend in the list. + + @discussion + This can be used to implement a search bar that filters the friend list. + + @param friendPicker The friend picker view controller that is requesting this information. + @param user An object representing the friend. + */ +- (BOOL)friendPickerViewController:(FBFriendPickerViewController *)friendPicker + shouldIncludeUser:(id)user; + +/*! + @abstract + Tells the delegate that there is a communication error. + + @param friendPicker The friend picker view controller that encountered the error. + @param error An error object containing details of the error. + */ +- (void)friendPickerViewController:(FBFriendPickerViewController *)friendPicker + handleError:(NSError *)error; + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBGraphLocation.h b/FacebookSDK.framework/Versions/A/Headers/FBGraphLocation.h new file mode 100755 index 0000000..7f71ce6 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBGraphLocation.h @@ -0,0 +1,78 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphObject.h" + +/*! + @protocol + + @abstract + The `FBGraphLocation` protocol enables typed access to the `location` property + of a Facebook place object. + + + @discussion + The `FBGraphLocation` protocol represents the most commonly used properties of a + location object. It may be used to access an `NSDictionary` object that has + been wrapped with an facade. + */ +@protocol FBGraphLocation + +/*! + @property + @abstract Typed access to a location's street. + */ +@property (retain, nonatomic) NSString *street; + +/*! + @property + @abstract Typed access to a location's city. + */ +@property (retain, nonatomic) NSString *city; + +/*! + @property + @abstract Typed access to a location's state. + */ +@property (retain, nonatomic) NSString *state; + +/*! + @property + @abstract Typed access to a location's country. + */ +@property (retain, nonatomic) NSString *country; + +/*! + @property + @abstract Typed access to a location's zip code. + */ +@property (retain, nonatomic) NSString *zip; + +/*! + @property + @abstract Typed access to a location's latitude. + */ +@property (retain, nonatomic) NSNumber *latitude; + +/*! + @property + @abstract Typed access to a location's longitude. + */ +@property (retain, nonatomic) NSNumber *longitude; + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBGraphObject.h b/FacebookSDK.framework/Versions/A/Headers/FBGraphObject.h new file mode 100755 index 0000000..005aa99 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBGraphObject.h @@ -0,0 +1,269 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@protocol FBOpenGraphObject; +@protocol FBOpenGraphAction; + +/*! + @protocol + + @abstract + The `FBGraphObject` protocol is the base protocol which enables typed access to graph objects and + open graph objects. Inherit from this protocol or a sub-protocol in order to introduce custom types + for typed access to Facebook objects. + + @discussion + The `FBGraphObject` protocol is the core type used by the Facebook SDK for iOS to + represent objects in the Facebook Social Graph and the Facebook Open Graph (OG). + The `FBGraphObject` class implements useful default functionality, but is rarely + used directly by applications. The `FBGraphObject` protocol, in contrast is the + base protocol for all graph object access via the SDK. + + Goals of the FBGraphObject types: +
    +
  • Lightweight/maintainable/robust
  • +
  • Extensible and resilient to change, both by Facebook and third party (OG)
  • +
  • Simple and natural extension to Objective-C
  • +
+ + The FBGraphObject at its core is a duck typed (if it walks/swims/quacks... + its a duck) model which supports an optional static facade. Duck-typing achieves + the flexibility necessary for Social Graph and OG uses, and the static facade + increases discoverability, maintainability, robustness and simplicity. + The following excerpt from the PlacePickerSample shows a simple use of the + a facade protocol `FBGraphPlace` by an application: + +
+ ‐ (void)placePickerViewControllerSelectionDidChange:(FBPlacePickerViewController *)placePicker
+ {
+ id<FBGraphPlace> place = placePicker.selection;
+
+ // we'll use logging to show the simple typed property access to place and location info
+ NSLog(@"place=%@, city=%@, state=%@, lat long=%@ %@",
+ place.name,
+ place.location.city,
+ place.location.state,
+ place.location.latitude,
+ place.location.longitude);
+ }
+ 
+ + Note that in this example, access to common place information is available through typed property + syntax. But if at some point places in the Social Graph supported additional fields "foo" and "bar", not + reflected in the `FBGraphPlace` protocol, the application could still access the values like so: + +
+ NSString *foo = [place objectForKey:@"foo"]; // perhaps located at the ... in the preceding example
+ NSNumber *bar = [place objectForKey:@"bar"]; // extensibility applies to Social and Open graph uses
+ 
+ + In addition to untyped access, applications and future revisions of the SDK may add facade protocols by + declaring a protocol inheriting the `FBGraphObject` protocol, like so: + +
+ @protocol MyGraphThing<FBGraphObject>
+ @property (copy, nonatomic) NSString *id;
+ @property (copy, nonatomic) NSString *name;
+ @end
+ 
+ + Important: facade implementations are inferred by graph objects returned by the methods of the SDK. This + means that no explicit implementation is required by application or SDK code. Any `FBGraphObject` instance + may be cast to any `FBGraphObject` facade protocol, and accessed via properties. If a field is not present + for a given facade property, the property will return nil. + + The following layer diagram depicts some of the concepts discussed thus far: + +
+                        *-------------* *------------* *-------------**--------------------------*
+ Facade -->             | FBGraphUser | |FBGraphPlace| | MyGraphThing|| MyGraphPersonExtentension| ...
+                        *-------------* *------------* *-------------**--------------------------*
+                        *------------------------------------* *--------------------------------------*
+ Transparent impl -->   |     FBGraphObject (instances)      | |      CustomClass<FBGraphObject>      |
+                        *------------------------------------* *--------------------------------------*
+                        *-------------------**------------------------* *-----------------------------*
+ Apparent impl -->      |NSMutableDictionary||FBGraphObject (protocol)| |FBGraphObject (class methods)|
+                        *-------------------**------------------------* *-----------------------------*
+ 
+ + The *Facade* layer is meant for typed access to graph objects. The *Transparent impl* layer (more + specifically, the instance capabilities of `FBGraphObject`) are used by the SDK and app logic + internally, but are not part of the public interface between application and SDK. The *Apparent impl* + layer represents the lower-level "duck-typed" use of graph objects. + + Implementation note: the SDK returns `NSMutableDictionary` derived instances with types declared like + one of the following: + +
+ NSMutableDictionary<FBGraphObject> *obj;     // no facade specified (still castable by app)
+ NSMutableDictionary<FBGraphPlace> *person;   // facade specified when possible
+ 
+ + However, when passing a graph object to the SDK, `NSMutableDictionary` is not assumed; only the + FBGraphObject protocol is assumed, like so: + +
+ id<FBGraphObject> anyGraphObj;
+ 
+ + As such, the methods declared on the `FBGraphObject` protocol represent the methods used by the SDK to + consume graph objects. While the `FBGraphObject` class implements the full `NSMutableDictionary` and KVC + interfaces, these are not consumed directly by the SDK, and are optional for custom implementations. + */ +@protocol FBGraphObject + +/*! + @method + @abstract + Returns the number of properties on this `FBGraphObject`. + */ +- (NSUInteger)count; +/*! + @method + @abstract + Returns a property on this `FBGraphObject`. + + @param aKey name of the property to return + */ +- (id)objectForKey:(id)aKey; +/*! + @method + @abstract + Returns an enumerator of the property naems on this `FBGraphObject`. + */ +- (NSEnumerator *)keyEnumerator; +/*! + @method + @abstract + Removes a property on this `FBGraphObject`. + + @param aKey name of the property to remove + */ +- (void)removeObjectForKey:(id)aKey; +/*! + @method + @abstract + Sets the value of a property on this `FBGraphObject`. + + @param anObject the new value of the property + @param aKey name of the property to set + */ +- (void)setObject:(id)anObject forKey:(id)aKey; + +@optional + +/*! + @abstract + This property signifies that the current graph object is provisioned for POST (as a definition + for a new or updated graph object), and should be posted AS-IS in its JSON encoded form, whereas + some graph objects (usually those embedded in other graph objects as references to existing objects) + may only have their "id" or "url" posted. + */ +@property (nonatomic, assign) BOOL provisionedForPost; + +@end + +/*! + @class + + @abstract + Static class with helpers for use with graph objects + + @discussion + The public interface of this class is useful for creating objects that have the same graph characteristics + of those returned by methods of the SDK. This class also represents the internal implementation of the + `FBGraphObject` protocol, used by the Facebook SDK. Application code should not use the `FBGraphObject` class to + access instances and instance members, favoring the protocol. + */ +@interface FBGraphObject : NSMutableDictionary + +/*! + @method + @abstract + Used to create a graph object, usually for use in posting a new graph object or action. + */ ++ (NSMutableDictionary *)graphObject; + +/*! + @method + @abstract + Used to wrap an existing dictionary with a `FBGraphObject` facade + + @discussion + Normally you will not need to call this method, as the Facebook SDK already "FBGraphObject-ifys" json objects + fetch via `FBRequest` and `FBRequestConnection`. However, you may have other reasons to create json objects in your + application, which you would like to treat as a graph object. The pattern for doing this is that you pass the root + node of the json to this method, to retrieve a wrapper. From this point, if you traverse the graph, any other objects + deeper in the hierarchy will be wrapped as `FBGraphObject`'s in a lazy fashion. + + This method is designed to avoid unnecessary memory allocations, and object copying. Due to this, the method does + not copy the source object if it can be avoided, but rather wraps and uses it as is. The returned object derives + callers shoudl use the returned object after calls to this method, rather than continue to call methods on the original + object. + + @param jsonDictionary the dictionary representing the underlying object to wrap + */ ++ (NSMutableDictionary *)graphObjectWrappingDictionary:(NSDictionary *)jsonDictionary; + +/*! + @method + @abstract + Used to create a graph object that's provisioned for POST, usually for use in posting a new Open Graph Action. + */ ++ (NSMutableDictionary *)openGraphActionForPost; + +/*! + @method + @abstract + Used to create a graph object that's provisioned for POST, usually for use in posting a new Open Graph object. + */ ++ (NSMutableDictionary *)openGraphObjectForPost; + +/*! + @method + @abstract + Used to create a graph object that's provisioned for POST, usually for use in posting a new Open Graph object. + + @param type the object type name, in the form namespace:typename + @param title a title for the object + @param image the image property for the object + @param url the url property for the object + @param description the description for the object + */ ++ (NSMutableDictionary *)openGraphObjectForPostWithType:(NSString *)type + title:(NSString *)title + image:(id)image + url:(id)url + description:(NSString *)description; + +/*! + @method + @abstract + Used to compare two `FBGraphObject`s to determine if represent the same object. We do not overload + the concept of equality as there are various types of equality that may be important for an `FBGraphObject` + (for instance, two different `FBGraphObject`s could represent the same object, but contain different + subsets of fields). + + @param anObject an `FBGraphObject` to test + + @param anotherObject the `FBGraphObject` to compare it against + */ ++ (BOOL)isGraphObjectID:(id)anObject sameAs:(id)anotherObject; + + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBGraphPlace.h b/FacebookSDK.framework/Versions/A/Headers/FBGraphPlace.h new file mode 100755 index 0000000..40e144f --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBGraphPlace.h @@ -0,0 +1,61 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphLocation.h" +#import "FBGraphObject.h" + +/*! + @protocol + + @abstract + The `FBGraphPlace` protocol enables typed access to a place object + as represented in the Graph API. + + + @discussion + The `FBGraphPlace` protocol represents the most commonly used properties of a + Facebook place object. It may be used to access an `NSDictionary` object that has + been wrapped with an facade. + */ +@protocol FBGraphPlace + +/*! + @property + @abstract Typed access to the place ID. + */ +@property (retain, nonatomic) NSString *id; + +/*! + @property + @abstract Typed access to the place name. + */ +@property (retain, nonatomic) NSString *name; + +/*! + @property + @abstract Typed access to the place category. + */ +@property (retain, nonatomic) NSString *category; + +/*! + @property + @abstract Typed access to the place location. + */ +@property (retain, nonatomic) id location; + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBGraphUser.h b/FacebookSDK.framework/Versions/A/Headers/FBGraphUser.h new file mode 100755 index 0000000..645ea1d --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBGraphUser.h @@ -0,0 +1,91 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphObject.h" +#import "FBGraphPlace.h" + +/*! + @protocol + + @abstract + The `FBGraphUser` protocol enables typed access to a user object + as represented in the Graph API. + + + @discussion + The `FBGraphUser` protocol represents the most commonly used properties of a + Facebook user object. It may be used to access an `NSDictionary` object that has + been wrapped with an facade. + */ +@protocol FBGraphUser + +/*! + @property + @abstract Typed access to the user's ID. + */ +@property (retain, nonatomic) NSString *id; + +/*! + @property + @abstract Typed access to the user's name. + */ +@property (retain, nonatomic) NSString *name; + +/*! + @property + @abstract Typed access to the user's first name. + */ +@property (retain, nonatomic) NSString *first_name; + +/*! + @property + @abstract Typed access to the user's middle name. + */ +@property (retain, nonatomic) NSString *middle_name; + +/*! + @property + @abstract Typed access to the user's last name. + */ +@property (retain, nonatomic) NSString *last_name; + +/*! + @property + @abstract Typed access to the user's profile URL. + */ +@property (retain, nonatomic) NSString *link; + +/*! + @property + @abstract Typed access to the user's username. + */ +@property (retain, nonatomic) NSString *username; + +/*! + @property + @abstract Typed access to the user's birthday. + */ +@property (retain, nonatomic) NSString *birthday; + +/*! + @property + @abstract Typed access to the user's current city. + */ +@property (retain, nonatomic) id location; + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBInsights.h b/FacebookSDK.framework/Versions/A/Headers/FBInsights.h new file mode 100755 index 0000000..10aedac --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBInsights.h @@ -0,0 +1,58 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSDKMacros.h" +#import "FBSession.h" + +/*! + @typedef FBInsightsFlushBehavior enum + + @abstract This enum has been deprecated in favor of FBAppEventsFlushBehavior. + */ +__attribute__ ((deprecated("use FBAppEventsFlushBehavior instead"))) +typedef enum { + FBInsightsFlushBehaviorAuto __attribute__ ((deprecated("use FBAppEventsFlushBehaviorAuto instead"))), + FBInsightsFlushBehaviorExplicitOnly __attribute__ ((deprecated("use FBAppEventsFlushBehaviorExplicitOnly instead"))), +} FBInsightsFlushBehavior; + +FBSDK_EXTERN NSString *const FBInsightsLoggingResultNotification __attribute__((deprecated)); + +/*! + @class FBInsights + + @abstract This class has been deprecated in favor of FBAppEvents. + */ +__attribute__ ((deprecated("Use the FBAppEvents class instead"))) +@interface FBInsights : NSObject + ++ (NSString *)appVersion __attribute__((deprecated)); ++ (void)setAppVersion:(NSString *)appVersion __attribute__((deprecated("use [FBSettings setAppVersion] instead"))); + ++ (void)logPurchase:(double)purchaseAmount currency:(NSString *)currency __attribute__((deprecated("use [FBAppEvents logPurchase] instead"))); ++ (void)logPurchase:(double)purchaseAmount currency:(NSString *)currency parameters:(NSDictionary *)parameters __attribute__((deprecated("use [FBAppEvents logPurchase] instead"))); ++ (void)logPurchase:(double)purchaseAmount currency:(NSString *)currency parameters:(NSDictionary *)parameters session:(FBSession *)session __attribute__((deprecated("use [FBAppEvents logPurchase] instead"))); + ++ (void)logConversionPixel:(NSString *)pixelID valueOfPixel:(double)value __attribute__((deprecated)); ++ (void)logConversionPixel:(NSString *)pixelID valueOfPixel:(double)value session:(FBSession *)session __attribute__((deprecated)); + ++ (FBInsightsFlushBehavior)flushBehavior __attribute__((deprecated("use [FBAppEvents flushBehavior] instead"))); ++ (void)setFlushBehavior:(FBInsightsFlushBehavior)flushBehavior __attribute__((deprecated("use [FBAppEvents setFlushBehavior] instead"))); + ++ (void)flush __attribute__((deprecated("use [FBAppEvents flush] instead"))); + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBLikeControl.h b/FacebookSDK.framework/Versions/A/Headers/FBLikeControl.h new file mode 100755 index 0000000..636ff1b --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBLikeControl.h @@ -0,0 +1,126 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/*! + @typedef NS_ENUM (NSUInteger, FBLikeControlAuxiliaryPosition) + + @abstract Specifies the position of the auxiliary view relative to the like button. + */ +typedef NS_ENUM(NSUInteger, FBLikeControlAuxiliaryPosition) +{ + /*! The auxiliary view is inline with the like button. */ + FBLikeControlAuxiliaryPositionInline, + /*! The auxiliary view is above the like button. */ + FBLikeControlAuxiliaryPositionTop, + /*! The auxiliary view is below the like button. */ + FBLikeControlAuxiliaryPositionBottom, +}; + +/*! + @typedef NS_ENUM(NSUInteger, FBLikeControlHorizontalAlignment) + + @abstract Specifies the horizontal alignment for FBLikeControlStyleStandard with + FBLikeControlAuxiliaryPositionTop or FBLikeControlAuxiliaryPositionBottom. + */ +typedef NS_ENUM(NSUInteger, FBLikeControlHorizontalAlignment) +{ + /*! The subviews are left aligned. */ + FBLikeControlHorizontalAlignmentLeft, + /*! The subviews are center aligned. */ + FBLikeControlHorizontalAlignmentCenter, + /*! The subviews are right aligned. */ + FBLikeControlHorizontalAlignmentRight, +}; + +/*! + @typedef NS_ENUM (NSUInteger, FBLikeControlStyle) + + @abstract Specifies the style of a like control. + */ +typedef NS_ENUM(NSUInteger, FBLikeControlStyle) +{ + /*! Displays the button and the social sentence. */ + FBLikeControlStyleStandard = 0, + /*! Displays the button and a box that contains the like count. */ + FBLikeControlStyleBoxCount, + /*! Displays the button only. */ + FBLikeControlStyleButton, +}; + +/*! + @class FBLikeControl + + @abstract UI control to like an object in the Facebook graph. + + @discussion Taps on the like button within this control will invoke an API call to the Facebook app through a + fast-app-switch that allows the user to like the object. Upon return to the calling app, the view will update + with the new state and send actions for the UIControlEventValueChanged event. + */ +@interface FBLikeControl : UIControl + +/*! + @abstract The foreground color to use for the content of the receiver. + */ +@property (nonatomic, strong) UIColor *foregroundColor; + +/*! + @abstract The position for the auxiliary view for the receiver. + + @see FBLikeControlAuxiliaryPosition + */ +@property (nonatomic, assign) FBLikeControlAuxiliaryPosition likeControlAuxiliaryPosition; + +/*! + @abstract The text alignment of the social sentence. + + @discussion This value is only valid for FBLikeControlStyleStandard with FBLikeControlAuxiliaryPositionTop|Bottom. + */ +@property (nonatomic, assign) FBLikeControlHorizontalAlignment likeControlHorizontalAlignment; + +/*! + @abstract The style to use for the receiver. + + @see FBLikeControlStyle + */ +@property (nonatomic, assign) FBLikeControlStyle likeControlStyle; + +/*! + @abstract The objectID for the object to like. + + @discussion This value may be an Open Graph object ID or a string representation of an URL that describes an + Open Graph object. The objects may be public objects, like pages, or objects that are defined by your application. + */ +@property (nonatomic, copy) NSString *objectID; + +/*! + @abstract The preferred maximum width (in points) for autolayout. + + @discussion This property affects the size of the receiver when layout constraints are applied to it. During layout, + if the text extends beyond the width specified by this property, the additional text is flowed to one or more new + lines, thereby increasing the height of the receiver. + */ +@property (nonatomic, assign) CGFloat preferredMaxLayoutWidth; + +/*! + @abstract If YES, a sound is played when the receiver is toggled. + + @default YES + */ +@property (nonatomic, assign, getter = isSoundEnabled) BOOL soundEnabled; + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBLinkShareParams.h b/FacebookSDK.framework/Versions/A/Headers/FBLinkShareParams.h new file mode 100755 index 0000000..22a6f1c --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBLinkShareParams.h @@ -0,0 +1,81 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBDialogsParams.h" + +/*! + @class FBLinkShareParams + + @abstract + This object is used to encapsulate state for parameters to a share a link, + typically with the Facebook Native Share Dialog or the Message Dialog. + */ +@interface FBLinkShareParams : FBDialogsParams + +/*! @abstract The URL link to be attached to the post. Only "http" or "https" + schemes are supported. */ +@property (nonatomic, copy) NSURL *link; + +/*! @abstract The name, or title associated with the link. Is only used if the + link is non-nil. */ +@property (nonatomic, copy) NSString *name; + +/*! @abstract The caption to be used with the link. Is only used if the link is + non-nil. */ +@property (nonatomic, copy) NSString *caption; + +/*! @abstract The description associated with the link. Is only used if the + link is non-nil. */ +@property (nonatomic, copy) NSString *description; + +/*! @abstract The link to a thumbnail to associate with the post. Is only used + if the link is non-nil. Only "http" or "https" schemes are supported. Note that this + property should not be used to share photos; see the photos property. */ +@property (nonatomic, copy) NSURL *picture; + +/*! @abstract An array of NSStrings or FBGraphUsers to tag in the post. + If using NSStrings, the values must represent the IDs of the users to tag. */ +@property (nonatomic, copy) NSArray *friends; + +/*! @abstract An NSString or FBGraphPlace to tag in the status update. If + NSString, the value must be the ID of the place to tag. */ +@property (nonatomic, copy) id place; + +/*! @abstract A text reference for the category of the post, used on Facebook + Insights. */ +@property (nonatomic, copy) NSString *ref; + +/*! @abstract If YES, treats any data failures (e.g. failures when getting + data for IDs passed through "friends" or "place") as a fatal error, and will not + continue with the status update. */ +@property (nonatomic, assign) BOOL dataFailuresFatal; + +/*! + @abstract Designated initializer + @param link the required link to share + @param name the optional name to describe the share + @param caption the optional caption to describe the share + @param description the optional description to describe the share + @param picture the optional url to use as the share's image +*/ +- (instancetype)initWithLink:(NSURL *)link + name:(NSString *)name + caption:(NSString *)caption + description:(NSString *)description + picture:(NSURL *)picture; +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBLoginTooltipView.h b/FacebookSDK.framework/Versions/A/Headers/FBLoginTooltipView.h new file mode 100755 index 0000000..8f9fcbd --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBLoginTooltipView.h @@ -0,0 +1,92 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBTooltipView.h" + +@protocol FBLoginTooltipViewDelegate; + +/*! + @class FBLoginTooltipView + + @abstract Represents a tooltip to be displayed next to a Facebook login button + to highlight features for new users. + + @discussion The `FBLoginView` may display this view automatically. If you do + not use the `FBLoginView`, you can manually call one of the `present*` methods + as appropriate and customize behavior via `FBLoginTooltipViewDelegate` delegate. + + By default, the `FBLoginTooltipView` is not added to the superview until it is + determined the app has migrated to the new login experience. You can override this + (e.g., to test the UI layout) by implementing the delegate or setting `forceDisplay` to YES. + + */ +@interface FBLoginTooltipView : FBTooltipView + +/*! @abstract the delegate */ +@property (nonatomic, assign) id delegate; + +/*! @abstract if set to YES, the view will always be displayed and the delegate's + `loginTooltipView:shouldAppear:` will NOT be called. */ +@property (nonatomic, assign) BOOL forceDisplay; + +@end + +/*! + @protocol + + @abstract + The `FBLoginTooltipViewDelegate` protocol defines the methods used to receive event + notifications from `FBLoginTooltipView` objects. + */ +@protocol FBLoginTooltipViewDelegate + +@optional + +/*! + @abstract + Asks the delegate if the tooltip view should appear + + @param view The tooltip view. + @param appIsEligible The value fetched from the server identifying if the app + is eligible for the new login experience. + + @discussion Use this method to customize display behavior. + */ +- (BOOL)loginTooltipView:(FBLoginTooltipView *)view shouldAppear:(BOOL)appIsEligible; + +/*! + @abstract + Tells the delegate the tooltip view will appear, specifically after it's been + added to the super view but before the fade in animation. + + @param view The tooltip view. + */ +- (void)loginTooltipViewWillAppear:(FBLoginTooltipView *)view; + +/*! + @abstract + Tells the delegate the tooltip view will not appear (i.e., was not + added to the super view). + + @param view The tooltip view. + */ +- (void)loginTooltipViewWillNotAppear:(FBLoginTooltipView *)view; + + +@end + diff --git a/FacebookSDK.framework/Versions/A/Headers/FBLoginView.h b/FacebookSDK.framework/Versions/A/Headers/FBLoginView.h new file mode 100755 index 0000000..8e2ed93 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBLoginView.h @@ -0,0 +1,224 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphUser.h" +#import "FBSession.h" +#import "FBTooltipView.h" + +@protocol FBLoginViewDelegate; + +/*! + @typedef + @abstract Indicates the desired login tooltip behavior. + */ +typedef NS_ENUM(NSUInteger, FBLoginViewTooltipBehavior) { + /*! The default behavior. The tooltip will only be displayed if + the app is eligible (determined by server round trip) */ + FBLoginViewTooltipBehaviorDefault = 0, + /*! Force display of the tooltip (typically for UI testing) */ + FBLoginViewTooltipBehaviorForceDisplay = 1, + /*! Force disable. In this case you can still exert more refined + control by manually constructing a `FBLoginTooltipView` instance. */ + FBLoginViewTooltipBehaviorDisable = 2 +}; + +/*! + @class FBLoginView + @abstract FBLoginView is a custom UIView that renders a button to login or logout based on the + state of `FBSession.activeSession` + + @discussion This view is closely associated with `FBSession.activeSession`. Upon initialization, + it will attempt to open an active session without UI if the current active session is not open. + + The FBLoginView instance also monitors for changes to the active session. + + Please note: Since FBLoginView observes the active session, using multiple FBLoginView instances + in different parts of your app can result in each instance's delegates being notified of changes + for one event. + */ +@interface FBLoginView : UIView + +/*! + @abstract + The permissions to login with. Defaults to nil, meaning basic permissions. + + @discussion Methods and properties that specify permissions without a read or publish + qualification are deprecated; use of a read-qualified or publish-qualified alternative is preferred. + */ +@property (readwrite, copy) NSArray *permissions __attribute__((deprecated)); + +/*! + @abstract + The read permissions to request if the user logs in via this view. + + @discussion + Note, that if read permissions are specified, then publish permissions should not be specified. + */ +@property (nonatomic, copy) NSArray *readPermissions; + +/*! + @abstract + The publish permissions to request if the user logs in via this view. + + @discussion + Note, that a defaultAudience value of FBSessionDefaultAudienceOnlyMe, FBSessionDefaultAudienceEveryone, or + FBSessionDefaultAudienceFriends should be set if publish permissions are specified. Additionally, when publish + permissions are specified, then read should not be specified. + */ +@property (nonatomic, copy) NSArray *publishPermissions; + +/*! + @abstract + The default audience to use, if publish permissions are requested at login time. + */ +@property (nonatomic, assign) FBSessionDefaultAudience defaultAudience; + +/*! + @abstract + The login behavior for the active session if the user logs in via this view + + @discussion + The default value is FBSessionLoginBehaviorWithFallbackToWebView. + */ +@property (nonatomic) FBSessionLoginBehavior loginBehavior; + +/*! + @abstract + Gets or sets the desired tooltip behavior. + */ +@property (nonatomic, assign) FBLoginViewTooltipBehavior tooltipBehavior; + +/*! + @abstract + Gets or sets the desired tooltip color style. + */ +@property (nonatomic, assign) FBTooltipColorStyle tooltipColorStyle; + +/*! + @abstract + Initializes and returns an `FBLoginView` object. The underlying session has basic permissions granted to it. + */ +- (instancetype)init; + +/*! + @method + + @abstract + Initializes and returns an `FBLoginView` object constructed with the specified permissions. + + @param permissions An array of strings representing the permissions to request during the + authentication flow. A value of nil will indicates basic permissions. + + @discussion Methods and properties that specify permissions without a read or publish + qualification are deprecated; use of a read-qualified or publish-qualified alternative is preferred. + */ +- (instancetype)initWithPermissions:(NSArray *)permissions __attribute__((deprecated)); + +/*! + @method + + @abstract + Initializes and returns an `FBLoginView` object constructed with the specified permissions. + + @param readPermissions An array of strings representing the read permissions to request during the + authentication flow. A value of nil will indicates basic permissions. + + */ +- (instancetype)initWithReadPermissions:(NSArray *)readPermissions; + +/*! + @method + + @abstract + Initializes and returns an `FBLoginView` object constructed with the specified permissions. + + @param publishPermissions An array of strings representing the publish permissions to request during the + authentication flow. + + @param defaultAudience An audience for published posts; note that FBSessionDefaultAudienceNone is not valid + for permission requests that include publish or manage permissions. + + */ +- (instancetype)initWithPublishPermissions:(NSArray *)publishPermissions + defaultAudience:(FBSessionDefaultAudience)defaultAudience; + +/*! + @abstract + The delegate object that receives updates for selection and display control. + */ +@property (nonatomic, assign) IBOutlet id delegate; + +@end + +/*! + @protocol + + @abstract + The `FBLoginViewDelegate` protocol defines the methods used to receive event + notifications from `FBLoginView` objects. + + @discussion + Please note: Since FBLoginView observes the active session, using multiple FBLoginView instances + in different parts of your app can result in each instance's delegates being notified of changes + for one event. + */ +@protocol FBLoginViewDelegate + +@optional + +/*! + @abstract + Tells the delegate that the view is now in logged in mode + + @param loginView The login view that transitioned its view mode + */ +- (void)loginViewShowingLoggedInUser:(FBLoginView *)loginView; + +/*! + @abstract + Tells the delegate that the view is has now fetched user info + + @param loginView The login view that transitioned its view mode + + @param user The user info object describing the logged in user + */ +- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView + user:(id)user; + +/*! + @abstract + Tells the delegate that the view is now in logged out mode + + @param loginView The login view that transitioned its view mode + */ +- (void)loginViewShowingLoggedOutUser:(FBLoginView *)loginView; + +/*! + @abstract + Tells the delegate that there is a communication or authorization error. + + @param loginView The login view that transitioned its view mode + @param error An error object containing details of the error. + @discussion See https://developers.facebook.com/docs/technical-guides/iossdk/errors/ + for error handling best practices. + */ +- (void)loginView:(FBLoginView *)loginView + handleError:(NSError *)error; + +@end + diff --git a/FacebookSDK.framework/Versions/A/Headers/FBNativeDialogs.h b/FacebookSDK.framework/Versions/A/Headers/FBNativeDialogs.h new file mode 100755 index 0000000..a6c79f1 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBNativeDialogs.h @@ -0,0 +1,109 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBAppCall.h" +#import "FBOpenGraphActionShareDialogParams.h" +#import "FBShareDialogParams.h" + +@class FBSession; +@protocol FBOpenGraphAction; + +// note that the following class and types are deprecated in favor of FBDialogs and its methods + +/*! + @typedef FBNativeDialogResult enum + + @abstract + Please note that this enum and its related methods have been deprecated, please migrate your + code to use `FBOSIntegratedShareDialogResult` and its related methods. + */ +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 could not be shown (because not on ios6 or ios6 auth was not used). */ + FBNativeDialogResultError +} FBNativeDialogResult +__attribute__((deprecated)); + +/*! + @typedef + + @abstract + Please note that `FBShareDialogHandler` and its related methods have been deprecated, please migrate your + code to use `FBOSIntegratedShareDialogHandler` and its related methods. + */ +typedef void (^FBShareDialogHandler)(FBNativeDialogResult result, NSError *error) +__attribute__((deprecated)); + +/*! + @class FBNativeDialogs + + @abstract + Please note that `FBNativeDialogs` has been deprecated, please migrate your + code to use `FBDialogs`. + */ +@interface FBNativeDialogs : NSObject + +/*! + @abstract + Please note that this method has been deprecated, please migrate your + code to use `FBDialogs` and the related method `presentOSIntegratedShareDialogModallyFrom`. + */ ++ (BOOL)presentShareDialogModallyFrom:(UIViewController *)viewController + initialText:(NSString *)initialText + image:(UIImage *)image + url:(NSURL *)url + handler:(FBShareDialogHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Please note that this method has been deprecated, please migrate your + code to use `FBDialogs` and the related method `presentOSIntegratedShareDialogModallyFrom`. + */ ++ (BOOL)presentShareDialogModallyFrom:(UIViewController *)viewController + initialText:(NSString *)initialText + images:(NSArray *)images + urls:(NSArray *)urls + handler:(FBShareDialogHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Please note that this method has been deprecated, please migrate your + code to use `FBDialogs` and the related method `presentOSIntegratedShareDialogModallyFrom`. + */ ++ (BOOL)presentShareDialogModallyFrom:(UIViewController *)viewController + session:(FBSession *)session + initialText:(NSString *)initialText + images:(NSArray *)images + urls:(NSArray *)urls + handler:(FBShareDialogHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Please note that this method has been deprecated, please migrate your + code to use `FBDialogs` and the related method `canPresentOSIntegratedShareDialogWithSession`. + */ ++ (BOOL)canPresentShareDialogWithSession:(FBSession *)session __attribute__((deprecated)); + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphAction.h b/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphAction.h new file mode 100755 index 0000000..adc5ef4 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphAction.h @@ -0,0 +1,128 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphObject.h" + +@protocol FBGraphPlace; +@protocol FBGraphUser; + +/*! + @protocol + + @abstract + The `FBOpenGraphAction` protocol is the base protocol for use in posting and retrieving Open Graph actions. + It inherits from the `FBGraphObject` protocol; you may derive custome protocols from `FBOpenGraphAction` in order + implement typed access to your application's custom actions. + + @discussion + Represents an Open Graph custom action, to be used directly, or from which to + derive custom action protocols with custom properties. + */ +@protocol FBOpenGraphAction + +/*! + @property + @abstract Typed access to action's id + */ +@property (retain, nonatomic) NSString *id; + +/*! + @property + @abstract Typed access to action's start time + */ +@property (retain, nonatomic) NSString *start_time; + +/*! + @property + @abstract Typed access to action's end time + */ +@property (retain, nonatomic) NSString *end_time; + +/*! + @property + @abstract Typed access to action's publication time + */ +@property (retain, nonatomic) NSString *publish_time; + +/*! + @property + @abstract Typed access to action's creation time + */ +@property (retain, nonatomic) NSString *created_time; + +/*! + @property + @abstract Typed access to action's expiration time + */ +@property (retain, nonatomic) NSString *expires_time; + +/*! + @property + @abstract Typed access to action's ref + */ +@property (retain, nonatomic) NSString *ref; + +/*! + @property + @abstract Typed access to action's user message + */ +@property (retain, nonatomic) NSString *message; + +/*! + @property + @abstract Typed access to action's place + */ +@property (retain, nonatomic) id place; + +/*! + @property + @abstract Typed access to action's tags + */ +@property (retain, nonatomic) NSArray *tags; + +/*! + @property + @abstract Typed access to action's image(s) + */ +@property (retain, nonatomic) id image; + +/*! + @property + @abstract Typed access to action's from-user + */ +@property (retain, nonatomic) id from; + +/*! + @property + @abstract Typed access to action's likes + */ +@property (retain, nonatomic) NSArray *likes; + +/*! + @property + @abstract Typed access to action's application + */ +@property (retain, nonatomic) id application; + +/*! + @property + @abstract Typed access to action's comments + */ +@property (retain, nonatomic) NSArray *comments; + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphActionParams.h b/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphActionParams.h new file mode 100755 index 0000000..b96ee0c --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphActionParams.h @@ -0,0 +1,54 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBDialogsParams.h" +#import "FBOpenGraphAction.h" +#import "FBSDKMacros.h" + +FBSDK_EXTERN NSString *const FBPostObject; + +/*! + @class FBOpenGraphActionParams + + @abstract + This object is used to encapsulate state for parameters to an Open Graph share, + typically used with the Native Share Dialog or Message Dialog. + */ +@interface FBOpenGraphActionParams : FBDialogsParams + +/*! @abstract The Open Graph action to be published. */ +@property (nonatomic, retain) id action; + +/*! @abstract The name of the property representing the primary target of the Open + Graph action, which will be displayed as a preview in the dialog. */ +@property (nonatomic, copy) NSString *previewPropertyName; + +/*! @abstract The fully qualified type of the Open Graph action. */ +@property (nonatomic, copy) NSString *actionType; + +/*! + @abstract Designated initializer + @param action The action object, typically a dictionary based object created + from `[FBGraphObject openGraphActionForPost]`. + @param actionType The open graph action type defined in your application settings. + Typically, either a common open graph type like "books.reads", or a custom ":". + @param previewPropertyName The identifier for object in the open graph action. For example, for books.reads + this would be "book". +*/ +- (instancetype)initWithAction:(id)action actionType:(NSString *)actionType previewPropertyName:(NSString *)previewPropertyName; +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphActionShareDialogParams.h b/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphActionShareDialogParams.h new file mode 100755 index 0000000..19f11a9 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphActionShareDialogParams.h @@ -0,0 +1,29 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBOpenGraphActionParams.h" + +/*! + @class FBOpenGraphActionShareDialogParams + + @abstract Deprecated. Use `FBOpenGraphActionParams` instead. + */ +__attribute__((deprecated)) +@interface FBOpenGraphActionShareDialogParams : FBOpenGraphActionParams + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphObject.h b/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphObject.h new file mode 100755 index 0000000..be73a3b --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphObject.h @@ -0,0 +1,77 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphObject.h" + +/*! + @protocol + + @abstract + The `FBOpenGraphObject` protocol is the base protocol for use in posting and retrieving Open Graph objects. + It inherits from the `FBGraphObject` protocol; you may derive custome protocols from `FBOpenGraphObject` in order + implement typed access to your application's custom objects. + + @discussion + Represents an Open Graph custom object, to be used directly, or from which to + derive custom action protocols with custom properties. + */ +@protocol FBOpenGraphObject + +/*! + @property + @abstract Typed access to the object's id + */ +@property (retain, nonatomic) NSString *id; + +/*! + @property + @abstract Typed access to the object's type, which is a string in the form mynamespace:mytype + */ +@property (retain, nonatomic) NSString *type; + +/*! + @property + @abstract Typed access to object's title + */ +@property (retain, nonatomic) NSString *title; + +/*! + @property + @abstract Typed access to the object's image property + */ +@property (retain, nonatomic) id image; + +/*! + @property + @abstract Typed access to the object's url property + */ +@property (retain, nonatomic) id url; + +/*! + @property + @abstract Typed access to the object's description property + */ +@property (retain, nonatomic) id description; + +/*! + @property + @abstract Typed access to action's data, which is a dictionary of custom properties + */ +@property (retain, nonatomic) id data; + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBPhotoParams.h b/FacebookSDK.framework/Versions/A/Headers/FBPhotoParams.h new file mode 100755 index 0000000..4c389fd --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBPhotoParams.h @@ -0,0 +1,51 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBDialogsParams.h" + +/*! + @class FBPhotoParams + + @abstract + This object is used to encapsulate state for parameters to share photos, + typically with the Facebook Native Share Dialog or Message Dialog + */ +@interface FBPhotoParams : FBDialogsParams + +/*! @abstract An array of NSStrings or FBGraphUsers to tag in the post. + If using NSStrings, the values must represent the IDs of the users to tag. */ +@property (nonatomic, copy) NSArray *friends; + +/*! @abstract An NSString or FBGraphPlace to tag in the status update. If + NSString, the value must be the ID of the place to tag. */ +@property (nonatomic, copy) id place; + +/*! @abstract If YES, treats any data failures (e.g. failures when getting + data for IDs passed through "friends" or "place") as a fatal error, and will not + continue with the status update. */ +@property (nonatomic, assign) BOOL dataFailuresFatal; + +/*! @abstract An array of UIImages representing photos to be shared. Only + six or fewer images are supported. */ +@property (nonatomic, copy) NSArray *photos; + +/*! @abstract Designated initializer. + @param photos the array of UIImages +*/ +- (instancetype)initWithPhotos:(NSArray *)photos; +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBPlacePickerViewController.h b/FacebookSDK.framework/Versions/A/Headers/FBPlacePickerViewController.h new file mode 100755 index 0000000..3d8c6f0 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBPlacePickerViewController.h @@ -0,0 +1,258 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBCacheDescriptor.h" +#import "FBGraphPlace.h" +#import "FBSession.h" +#import "FBViewController.h" + +@protocol FBPlacePickerDelegate; + +/*! + @class FBPlacePickerViewController + + @abstract + The `FBPlacePickerViewController` class creates a controller object that manages + the user interface for displaying and selecting nearby places. + + @discussion + When the `FBPlacePickerViewController` view loads it creates a `UITableView` object + where the places near a given location will be displayed. You can access this view + through the `tableView` property. + + The place data can be pre-fetched and cached prior to using the view controller. The + cache is setup using an object that can trigger the + data fetch. Any place data requests will first check the cache and use that data. + If the place picker is being displayed cached data will initially be shown before + a fresh copy is retrieved. + + The `delegate` property may be set to an object that conforms to the + protocol. The `delegate` object will receive updates related to place selection and + data changes. The delegate can also be used to filter the places to display in the + picker. + */ +@interface FBPlacePickerViewController : FBViewController + +/*! + @abstract + Returns an outlet for the spinner used in the view controller. + */ +@property (nonatomic, retain) IBOutlet UIActivityIndicatorView *spinner; + +/*! + @abstract + Returns an outlet for the table view managed by the view controller. + */ +@property (nonatomic, retain) IBOutlet UITableView *tableView; + +/*! + @abstract + Addtional fields to fetch when making the Graph API call to get place data. + */ +@property (nonatomic, copy) NSSet *fieldsForRequest; + +/*! + @abstract + A Boolean value that indicates whether place profile pictures are displayed. + */ +@property (nonatomic) BOOL itemPicturesEnabled; + +/*! + @abstract + The coordinates to use for place discovery. + */ +@property (nonatomic) CLLocationCoordinate2D locationCoordinate; + +/*! + @abstract + The radius to use for place discovery. + */ +@property (nonatomic) NSInteger radiusInMeters; + +/*! + @abstract + The maximum number of places to fetch. + */ +@property (nonatomic) NSInteger resultsLimit; + +/*! + @abstract + The search words used to narrow down the results returned. + */ +@property (nonatomic, copy) NSString *searchText; + +/*! + @abstract + The session that is used in the request for place data. + */ +@property (nonatomic, retain) FBSession *session; + +/*! + @abstract + The place that is currently selected in the view. This is nil + if nothing is selected. + */ +@property (nonatomic, retain, readonly) id selection; + +/*! + @abstract + Clears the current selection, so the picker is ready for a fresh use. + */ +- (void)clearSelection; + +/*! + @abstract + Initializes a place picker view controller. + */ +- (instancetype)init; + +/*! + @abstract + Initializes a place picker view controller. + + @param aDecoder An unarchiver object. + */ +- (instancetype)initWithCoder:(NSCoder *)aDecoder; + +/*! + @abstract + Initializes a place picker view controller. + + @param nibNameOrNil The name of the nib file to associate with the view controller. The nib file name should not contain any leading path information. If you specify nil, the nibName property is set to nil. + @param nibBundleOrNil The bundle in which to search for the nib file. This method looks for the nib file in the bundle's language-specific project directories first, followed by the Resources directory. If nil, this method looks for the nib file in the main bundle. + */ +- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil; + +/*! + @abstract + Configures the properties used in the caching data queries. + + @discussion + Cache descriptors are used to fetch and cache the data used by the view controller. + If the view controller finds a cached copy of the data, it will + first display the cached content then fetch a fresh copy from the server. + + @param cacheDescriptor The containing the cache query properties. + */ +- (void)configureUsingCachedDescriptor:(FBCacheDescriptor *)cacheDescriptor; + +/*! + @abstract + Initiates a query to get place data the first time or in response to changes in + the search criteria, filter, or location information. + + + @discussion + A cached copy will be returned if available. The cached view is temporary until a fresh copy is + retrieved from the server. It is legal to call this more than once. + */ +- (void)loadData; + +/*! + @abstract + Updates the view locally without fetching data from the server or from cache. + + @discussion + Use this if the filter properties change. This may affect the order or + display of information. + */ +- (void)updateView; + +/*! + @method + + @abstract + Creates a cache descriptor with additional fields and a profile ID for use with the + `FBPlacePickerViewController` object. + + @discussion + An `FBCacheDescriptor` object may be used to pre-fetch data before it is used by + the view controller. It may also be used to configure the `FBPlacePickerViewController` + object. + + @param locationCoordinate The coordinates to use for place discovery. + @param radiusInMeters The radius to use for place discovery. + @param searchText The search words used to narrow down the results returned. + @param resultsLimit The maximum number of places to fetch. + @param fieldsForRequest Addtional fields to fetch when making the Graph API call to get place data. + */ ++ (FBCacheDescriptor *)cacheDescriptorWithLocationCoordinate:(CLLocationCoordinate2D)locationCoordinate + radiusInMeters:(NSInteger)radiusInMeters + searchText:(NSString *)searchText + resultsLimit:(NSInteger)resultsLimit + fieldsForRequest:(NSSet *)fieldsForRequest; + +@end + +/*! + @protocol + + @abstract + The `FBPlacePickerDelegate` protocol defines the methods used to receive event + notifications and allow for deeper control of the + view. + */ +@protocol FBPlacePickerDelegate +@optional + +/*! + @abstract + Tells the delegate that data has been loaded. + + @discussion + The object's `tableView` property is automatically + reloaded when this happens. However, if another table view, for example the + `UISearchBar` is showing data, then it may also need to be reloaded. + + @param placePicker The place picker view controller whose data changed. + */ +- (void)placePickerViewControllerDataDidChange:(FBPlacePickerViewController *)placePicker; + +/*! + @abstract + Tells the delegate that the selection has changed. + + @param placePicker The place picker view controller whose selection changed. + */ +- (void)placePickerViewControllerSelectionDidChange:(FBPlacePickerViewController *)placePicker; + +/*! + @abstract + Asks the delegate whether to include a place in the list. + + @discussion + This can be used to implement a search bar that filters the places list. + + @param placePicker The place picker view controller that is requesting this information. + @param place An object representing the place. + */ +- (BOOL)placePickerViewController:(FBPlacePickerViewController *)placePicker + shouldIncludePlace:(id)place; + +/*! + @abstract + Called if there is a communication error. + + @param placePicker The place picker view controller that encountered the error. + @param error An error object containing details of the error. + */ +- (void)placePickerViewController:(FBPlacePickerViewController *)placePicker + handleError:(NSError *)error; + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBProfilePictureView.h b/FacebookSDK.framework/Versions/A/Headers/FBProfilePictureView.h new file mode 100755 index 0000000..8859dea --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBProfilePictureView.h @@ -0,0 +1,79 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/*! + @typedef FBProfilePictureCropping enum + + @abstract + Type used to specify the cropping treatment of the profile picture. + + @discussion + */ +typedef enum { + + /*! Square (default) - the square version that the Facebook user defined. */ + FBProfilePictureCroppingSquare = 0, + + /*! Original - the original profile picture, as uploaded. */ + FBProfilePictureCroppingOriginal = 1 + +} FBProfilePictureCropping; + +/*! + @class + @abstract + An instance of `FBProfilePictureView` is used to display a profile picture. + + The default behavior of this control is to center the profile picture + in the view and shrinks it, if necessary, to the view's bounds, preserving the aspect ratio. The smallest + possible image is downloaded to ensure that scaling up never happens. Resizing the view may result in + a different size of the image being loaded. Canonical image sizes are documented in the "Pictures" section + of https://developers.facebook.com/docs/reference/api. + */ +@interface FBProfilePictureView : UIView + +/*! + @abstract + The Facebook ID of the user, place or object for which a picture should be fetched and displayed. + */ +@property (copy, nonatomic) NSString *profileID; + +/*! + @abstract + The cropping to use for the profile picture. + */ +@property (nonatomic) FBProfilePictureCropping pictureCropping; + +/*! + @abstract + Initializes and returns a profile view object. + */ +- (instancetype)init; + + +/*! + @abstract + Initializes and returns a profile view object for the given Facebook ID and cropping. + + @param profileID The Facebook ID of the user, place or object for which a picture should be fetched and displayed. + @param pictureCropping The cropping to use for the profile picture. + */ +- (instancetype)initWithProfileID:(NSString *)profileID + pictureCropping:(FBProfilePictureCropping)pictureCropping; + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBRequest.h b/FacebookSDK.framework/Versions/A/Headers/FBRequest.h new file mode 100755 index 0000000..719f267 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBRequest.h @@ -0,0 +1,690 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBGraphObject.h" +#import "FBOpenGraphAction.h" +#import "FBOpenGraphObject.h" +#import "FBRequestConnection.h" +#import "FBSDKMacros.h" + +/*! The base URL used for graph requests */ +FBSDK_EXTERN NSString *const FBGraphBasePath __attribute__((deprecated)); + +// up-front decl's +@protocol FBRequestDelegate; +@class FBSession; +@class UIImage; + +/*! + @typedef FBRequestState + + @abstract + Deprecated - do not use in new code. + + @discussion + FBRequestState is retained from earlier versions of the SDK to give existing + apps time to remove dependency on this. + + @deprecated + */ +typedef NSUInteger FBRequestState __attribute__((deprecated)); + +/*! + @class FBRequest + + @abstract + The `FBRequest` object is used to setup and manage requests to Facebook Graph + and REST APIs. This class provides helper methods that simplify the connection + and response handling. + + @discussion + An object is required for all authenticated uses of `FBRequest`. + Requests that do not require an unauthenticated user are also supported and + do not require an object to be passed in. + + An instance of `FBRequest` represents the arguments and setup for a connection + to Facebook. After creating an `FBRequest` object it can be used to setup a + connection to Facebook through the object. The + object is created to manage a single connection. To + cancel a connection use the instance method in the class. + + An `FBRequest` object may be reused to issue multiple connections to Facebook. + However each instance will manage one connection. + + Class and instance methods prefixed with **start* ** can be used to perform the + request setup and initiate the connection in a single call. + + */ +@interface FBRequest : NSObject { +@private + id _delegate; + NSString * _url; + NSString * _versionPart; + NSURLConnection * _connection; + NSMutableData * _responseText; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + FBRequestState _state; +#pragma GCC diagnostic pop + NSError * _error; + BOOL _sessionDidExpire; + id _graphObject; +} + +/*! + @methodgroup Creating a request + + @method + Calls with the default parameters. + */ +- (instancetype)init; + +/*! + @method + Calls with default parameters + except for the ones provided to this method. + + @param session The session object representing the identity of the Facebook user making + the request. A nil value indicates a request that requires no token; to + use the active session pass `[FBSession activeSession]`. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + */ +- (instancetype)initWithSession:(FBSession *)session + graphPath:(NSString *)graphPath; + +/*! + @method + + @abstract + Initializes an `FBRequest` object for a Graph API request call. + + @discussion + Note that this only sets properties on the `FBRequest` object. + + To send the request, initialize an object, add this request, + and send <[FBRequestConnection start]>. See other methods on this + class for shortcuts to simplify this process. + + @param session The session object representing the identity of the Facebook user making + the request. A nil value indicates a request that requires no token; to + use the active session pass `[FBSession activeSession]`. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param parameters The parameters for the request. A value of nil sends only the automatically handled + parameters, for example, the access token. The default is nil. + + @param HTTPMethod The HTTP method to use for the request. The default is value of nil implies a GET. + */ +- (instancetype)initWithSession:(FBSession *)session + graphPath:(NSString *)graphPath + parameters:(NSDictionary *)parameters + HTTPMethod:(NSString *)HTTPMethod; + +/*! + @method + @abstract + Initialize a `FBRequest` object that will do a graph request. + + @discussion + Note that this only sets properties on the `FBRequest`. + + To send the request, initialize a , add this request, + and send <[FBRequestConnection start]>. See other methods on this + class for shortcuts to simplify this process. + + @param session The session object representing the identity of the Facebook user making + the request. A nil value indicates a request that requires no token; to + use the active session pass `[FBSession activeSession]`. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param graphObject An object or open graph action to post. + */ +- (instancetype)initForPostWithSession:(FBSession *)session + graphPath:(NSString *)graphPath + graphObject:(id)graphObject; + +/*! + @method + @abstract + Initialize a `FBRequest` object that will do a rest API request. + + @discussion + Prefer to use graph requests instead of this where possible. + + Note that this only sets properties on the `FBRequest`. + + To send the request, initialize a , add this request, + and send <[FBRequestConnection start]>. See other methods on this + class for shortcuts to simplify this process. + + @param session The session object representing the identity of the Facebook user making + the request. A nil value indicates a request that requires no token; to + use the active session pass `[FBSession activeSession]`. + + @param restMethod A valid REST API method. + + @param parameters The parameters for the request. A value of nil sends only the automatically handled + parameters, for example, the access token. The default is nil. + + @param HTTPMethod The HTTP method to use for the request. The default is value of nil implies a GET. + + */ +- (instancetype)initWithSession:(FBSession *)session + restMethod:(NSString *)restMethod + parameters:(NSDictionary *)parameters + HTTPMethod:(NSString *)HTTPMethod; + +/*! + @abstract + The parameters for the request. + + @discussion + May be used to read the parameters that were automatically set during + the object initiliazation. Make any required modifications prior to + sending the request. + + `NSString` parameters are used to generate URL parameter values or JSON + parameters. `NSData` and `UIImage` parameters are added as attachments + to the HTTP body and referenced by name in the URL and/or JSON. + */ +@property (nonatomic, retain, readonly) NSMutableDictionary *parameters; + +/*! + @abstract + The session object to use for the request. + + @discussion + May be used to read the session that was automatically set during + the object initiliazation. Make any required modifications prior to + sending the request. + */ +@property (nonatomic, retain) FBSession *session; + +/*! + @abstract + The Graph API endpoint to use for the request, for example "me". + + @discussion + May be used to read the Graph API endpoint that was automatically set during + the object initiliazation. Make any required modifications prior to + sending the request. + */ +@property (nonatomic, copy) NSString *graphPath; + +/*! + @abstract + A valid REST API method. + + @discussion + May be used to read the REST method that was automatically set during + the object initiliazation. Make any required modifications prior to + sending the request. + + Use the Graph API equivalent of the API if it exists as the REST API + method is deprecated if there is a Graph API equivalent. + */ +@property (nonatomic, copy) NSString *restMethod; + +/*! + @abstract + The HTTPMethod to use for the request, for example "GET" or "POST". + + @discussion + May be used to read the HTTP method that was automatically set during + the object initiliazation. Make any required modifications prior to + sending the request. + */ +@property (nonatomic, copy) NSString *HTTPMethod; + +/*! + @abstract + The graph object to post with the request. + + @discussion + May be used to read the graph object that was automatically set during + the object initiliazation. Make any required modifications prior to + sending the request. + */ +@property (nonatomic, retain) id graphObject; + +/*! + @methodgroup Instance methods + */ + +/*! + @method + + @abstract + Overrides the default version for a single request + + @discussion + The SDK automatically prepends a version part, such as "v2.0" to API paths in order to simplify API versioning + for applications. Sometimes it is preferable to explicitly set the version for a request, which can be + accomplished in one of two ways. The first is to call this method and set an override version part. The second + is approach is to include the version part in the api path, for example @"v2.0/me/friends" + + @param version This is a string in the form @"v2.0" which will be used for the version part of an API path + */ +- (void)overrideVersionPartWith:(NSString *)version; + +/*! + @method + + @abstract + Starts a connection to the Facebook API. + + @discussion + This is used to start an API call to Facebook and call the block when the + request completes with a success, error, or cancel. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + The handler will be invoked on the main thread. + */ +- (FBRequestConnection *)startWithCompletionHandler:(FBRequestHandler)handler; + +/*! + @methodgroup FBRequestConnection start methods + + @abstract + These methods start an . + + @discussion + These methods simplify the process of preparing a request and starting + the connection. The methods handle initializing an `FBRequest` object, + initializing a object, adding the `FBRequest` + object to the to the , and finally starting the + connection. + */ + +/*! + @methodgroup FBRequest factory methods + + @abstract + These methods initialize a `FBRequest` for common scenarios. + + @discussion + These simplify the process of preparing a request to send. These + initialize a `FBRequest` based on strongly typed parameters that are + specific to the scenario. + + These method do not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + */ + +// request +// +// Summary: +// Helper methods used to create common request objects which can be used to create single or batch connections +// +// session: - the session object representing the identity of the +// Facebook user making the request; nil implies an +// unauthenticated request; default=nil + +/*! + @method + + @abstract + Creates a request representing a Graph API call to the "me" endpoint, using the active session. + + @discussion + Simplifies preparing a request to retrieve the user's identity. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + A successful Graph API call will return an object representing the + user's identity. + + Note you may change the session property after construction if a session other than + the active session is preferred. + */ ++ (FBRequest *)requestForMe; + +/*! + @method + + @abstract + Creates a request representing a Graph API call to the "me/friends" endpoint using the active session. + + @discussion + Simplifies preparing a request to retrieve the user's friends. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + A successful Graph API call will return an array of objects representing the + user's friends. + */ ++ (FBRequest *)requestForMyFriends; + +/*! + @method + + @abstract + Creates a request representing a Graph API call to upload a photo to the app's album using the active session. + + @discussion + Simplifies preparing a request to post a photo. + + To post a photo to a specific album, get the `FBRequest` returned from this method + call, then modify the request parameters by adding the album ID to an "album" key. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param photo A `UIImage` for the photo to upload. + */ ++ (FBRequest *)requestForUploadPhoto:(UIImage *)photo; + +/*! + @method + + @abstract + Creates a request representing a status update. + + @discussion + Simplifies preparing a request to post a status update. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param message The message to post. + */ ++ (FBRequest *)requestForPostStatusUpdate:(NSString *)message; + +/*! + @method + + @abstract + Creates a request representing a status update. + + @discussion + Simplifies preparing a request to post a status update. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param message The message to post. + @param place The place to checkin with, or nil. Place may be an fbid or a + graph object representing a place. + @param tags Array of friends to tag in the status update, each element + may be an fbid or a graph object representing a user. + */ ++ (FBRequest *)requestForPostStatusUpdate:(NSString *)message + place:(id)place + tags:(id)tags; + +/*! + @method + + @abstract + Creates a request representing a Graph API call to the "search" endpoint + for a given location using the active session. + + @discussion + Simplifies preparing a request to search for places near a coordinate. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + A successful Graph API call will return an array of objects representing + the nearby locations. + + @param coordinate The search coordinates. + + @param radius The search radius in meters. + + @param limit The maxiumum number of results to return. It is + possible to receive fewer than this because of the radius and because of server limits. + + @param searchText The text to use in the query to narrow the set of places + returned. + */ ++ (FBRequest *)requestForPlacesSearchAtCoordinate:(CLLocationCoordinate2D)coordinate + radiusInMeters:(NSInteger)radius + resultsLimit:(NSInteger)limit + searchText:(NSString *)searchText; + +/*! + @method + + @abstract + Creates a request representing the Graph API call to retrieve a Custom Audience "thirdy party ID" for the app's Facebook user. + Callers will send this ID back to their own servers, collect up a set to create a Facebook Custom Audience with, + and then use the resultant Custom Audience to target ads. + + @param session The FBSession to use to establish the user's identity for users logged into Facebook through this app. + If `nil`, then the activeSession is used. + + @discussion + This method will throw an exception if <[FBSettings defaultAppID]> is `nil`. The appID won't be nil when the pList + includes the appID, or if it's explicitly set. + + The JSON in the request's response will include an "custom_audience_third_party_id" key/value pair, with the value being the ID retrieved. + This ID is an encrypted encoding of the Facebook user's ID and the invoking Facebook app ID. + Multiple calls with the same user will return different IDs, thus these IDs cannot be used to correlate behavior + across devices or applications, and are only meaningful when sent back to Facebook for creating Custom Audiences. + + The ID retrieved represents the Facebook user identified in the following way: if the specified session (or activeSession if the specified + session is `nil`) is open, the ID will represent the user associated with the activeSession; otherwise the ID will represent the user logged into the + native Facebook app on the device. If there is no native Facebook app, no one is logged into it, or the user has opted out + at the iOS level from ad tracking, then a `nil` ID will be returned. + + This method returns `nil` if either the user has opted-out (via iOS) from Ad Tracking, the app itself has limited event usage + via the `[FBAppEvents setLimitEventUsage]` flag, or a specific Facebook user cannot be identified. + */ ++ (FBRequest *)requestForCustomAudienceThirdPartyID:(FBSession *)session; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to make a Graph API call for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + */ ++ (FBRequest *)requestForGraphPath:(NSString *)graphPath; + +/*! + @method + + @abstract + Creates request representing a DELETE to a object. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param object This can be an NSString, NSNumber or NSDictionary representing an object to delete + */ ++ (FBRequest *)requestForDeleteObject:(id)object; + +/*! + @method + + @abstract + Creates a request representing a POST for a graph object. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param graphObject An object or open graph action to post. + + @discussion This method is typically used for posting an open graph action. If you are only + posting an open graph object (without an action), consider using `requestForPostOpenGraphObject:` + */ ++ (FBRequest *)requestForPostWithGraphPath:(NSString *)graphPath + graphObject:(id)graphObject; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to make a Graph API call for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param parameters The parameters for the request. A value of nil sends only the automatically handled parameters, for example, the access token. The default is nil. + + @param HTTPMethod The HTTP method to use for the request. A nil value implies a GET. + */ ++ (FBRequest *)requestWithGraphPath:(NSString *)graphPath + parameters:(NSDictionary *)parameters + HTTPMethod:(NSString *)HTTPMethod; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to create a user owned + Open Graph object for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param object The Open Graph object to create. Some common expected fields include "title", "image", "url", etc. + */ ++ (FBRequest *)requestForPostOpenGraphObject:(id)object; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to create a user owned + Open Graph object for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param type The fully-specified Open Graph object type (e.g., my_app_namespace:my_object_name) + @param title The title of the Open Graph object. + @param image The link to an image to be associated with the Open Graph object. + @param url The url to be associated with the Open Graph object. + @param description The description to be associated with the object. + @param objectProperties Any additional properties for the Open Graph object. + */ ++ (FBRequest *)requestForPostOpenGraphObjectWithType:(NSString *)type + title:(NSString *)title + image:(id)image + url:(id)url + description:(NSString *)description + objectProperties:(NSDictionary *)objectProperties; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to update a user owned + Open Graph object for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param object The Open Graph object to update the existing object with. + */ ++ (FBRequest *)requestForUpdateOpenGraphObject:(id)object; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to update a user owned + Open Graph object for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param objectId The id of the Open Graph object to update. + @param title The updated title of the Open Graph object. + @param image The updated link to an image to be associated with the Open Graph object. + @param url The updated url to be associated with the Open Graph object. + @param description The updated description of the Open Graph object. + @param objectProperties Any additional properties to update for the Open Graph object. + */ ++ (FBRequest *)requestForUpdateOpenGraphObjectWithId:(id)objectId + title:(NSString *)title + image:(id)image + url:(id)url + description:(NSString *)description + objectProperties:(NSDictionary *)objectProperties; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to upload an image + to create a staging resource. Staging resources allow you to post binary data + such as images, in preparation for a post of an open graph object or action + which references the image. The URI returned when uploading a staging resource + may be passed as the image property for an open graph object or action. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param image A `UIImage` for the image to upload. + */ ++ (FBRequest *)requestForUploadStagingResourceWithImage:(UIImage *)image; + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBRequestConnection.h b/FacebookSDK.framework/Versions/A/Headers/FBRequestConnection.h new file mode 100755 index 0000000..1d3a149 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBRequestConnection.h @@ -0,0 +1,627 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBGraphObject.h" +#import "FBSDKMacros.h" + +// up-front decl's +@class FBRequest; +@class FBRequestConnection; +@class FBSession; +@class UIImage; + + +/*! + @attribute beta true + + @typedef FBRequestConnectionErrorBehavior enum + + @abstract Describes what automatic error handling behaviors to provide (if any). + + @discussion This is a bitflag enum that can be composed of different values. + + See FBError.h and FBErrorUtility.h for error category and user message details. + */ +typedef enum { + /*! The default behavior of none */ + FBRequestConnectionErrorBehaviorNone = 0, + + /*! This will retry any requests whose error category is classified as `FBErrorCategoryRetry`. + If the retry fails, the normal handler is invoked. */ + FBRequestConnectionErrorBehaviorRetry = 1, + + /*! This will automatically surface any SDK provided userMessage (at most one), after + retry attempts, but before any reconnects are tried. The alert will have one button + whose text can be localized with the key "FBE:AlertMessageButton". + + You should not display your own alert views in your request handler when specifying this + behavior. + */ + FBRequestConnectionErrorBehaviorAlertUser = 2, + + /*! This will automatically reconnect a session if the request failed due to an invalid token + that would otherwise close the session (such as an expired token or password change). Note + this will NOT reconnect a session if the user had uninstalled the app, or if the user had + disabled the app's slider in their privacy settings (in cases of iOS 6 system auth). + If the session is reconnected, this will transition the session state to FBSessionStateTokenExtended + which will invoke any state change handlers. Otherwise, the session is closed as normal. + + This behavior should not be used if the FBRequestConnection contains multiple + session instances. Further, when this behavior is used, you must not request new permissions + for the session until the connection is completed. + + Lastly, you should avoid using additional FBRequestConnections with the same session because + that will be subject to race conditions. + */ + FBRequestConnectionErrorBehaviorReconnectSession = 4, +} FBRequestConnectionErrorBehavior; + +/*! + Normally requests return JSON data that is parsed into a set of `NSDictionary` + and `NSArray` objects. + + When a request returns a non-JSON response, that response is packaged in + a `NSDictionary` using FBNonJSONResponseProperty as the key and the literal + response as the value. + */ +FBSDK_EXTERN NSString *const FBNonJSONResponseProperty; + +/*! + @typedef FBRequestHandler + + @abstract + A block that is passed to addRequest to register for a callback with the results of that + request once the connection completes. + + @discussion + Pass a block of this type when calling addRequest. This will be called once + the request completes. The call occurs on the UI thread. + + @param connection The `FBRequestConnection` that sent the request. + + @param result The result of the request. This is a translation of + JSON data to `NSDictionary` and `NSArray` objects. This + is nil if there was an error. + + @param error The `NSError` representing any error that occurred. + + */ +typedef void (^FBRequestHandler)(FBRequestConnection *connection, + id result, + NSError *error); + +/*! + @class FBRequestConnection + + @abstract + The `FBRequestConnection` represents a single connection to Facebook to service a request. + + @discussion + The request settings are encapsulated in a reusable object. The + `FBRequestConnection` object encapsulates the concerns of a single communication + e.g. starting a connection, canceling a connection, or batching requests. + + */ +@interface FBRequestConnection : NSObject + +/*! + @methodgroup Creating a request + */ + +/*! + @method + + Calls with a default timeout of 180 seconds. + */ +- (instancetype)init; + +/*! + @method + + @abstract + `FBRequestConnection` objects are used to issue one or more requests as a single + request/response connection with Facebook. + + @discussion + For a single request, the usual method for creating an `FBRequestConnection` + object is to call one of the **start* ** methods on . However, it is + allowable to init an `FBRequestConnection` object directly, and call + to add one or more request objects to the + connection, before calling start. + + Note that if requests are part of a batch, they must have an open + FBSession that has an access token associated with it. Alternatively a default App ID + must be set either in the plist or through an explicit call to <[FBSession defaultAppID]>. + + @param timeout The `NSTimeInterval` (seconds) to wait for a response before giving up. + */ + +- (instancetype)initWithTimeout:(NSTimeInterval)timeout; + +// properties + +/*! + @abstract + The request that will be sent to the server. + + @discussion + This property can be used to create a `NSURLRequest` without using + `FBRequestConnection` to send that request. It is legal to set this property + in which case the provided `NSMutableURLRequest` will be used instead. However, + the `NSMutableURLRequest` must result in an appropriate response. Furthermore, once + this property has been set, no more objects can be added to this + `FBRequestConnection`. + */ +@property (nonatomic, retain, readwrite) NSMutableURLRequest *urlRequest; + +/*! + @abstract + The raw response that was returned from the server. (readonly) + + @discussion + This property can be used to inspect HTTP headers that were returned from + the server. + + The property is nil until the request completes. If there was a response + then this property will be non-nil during the FBRequestHandler callback. + */ +@property (nonatomic, retain, readonly) NSHTTPURLResponse *urlResponse; + +/*! + @attribute beta true + + @abstract Set the automatic error handling behaviors. + @discussion + + This must be set before any requests are added. + + When using retry behaviors, note the FBRequestConnection instance + passed to the FBRequestHandler may be a different instance that the + one the requests were originally started on. + */ +@property (nonatomic, assign) FBRequestConnectionErrorBehavior errorBehavior; + +/*! + @methodgroup Adding requests + */ + +/*! + @method + + @abstract + This method adds an object to this connection. + + @discussion + The completion handler is retained until the block is called upon the + completion or cancellation of the connection. + + @param request A request to be included in the round-trip when start is called. + @param handler A handler to call back when the round-trip completes or times out. + The handler will be invoked on the main thread. + */ +- (void)addRequest:(FBRequest *)request + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + This method adds an object to this connection. + + @discussion + The completion handler is retained until the block is called upon the + completion or cancellation of the connection. This request can be named + to allow for using the request's response in a subsequent request. + + @param request A request to be included in the round-trip when start is called. + + @param handler A handler to call back when the round-trip completes or times out. + The handler will be invoked on the main thread. + + @param name An optional name for this request. This can be used to feed + the results of one request to the input of another in the same + `FBRequestConnection` as described in + [Graph API Batch Requests]( https://developers.facebook.com/docs/reference/api/batch/ ). + */ +- (void)addRequest:(FBRequest *)request + completionHandler:(FBRequestHandler)handler + batchEntryName:(NSString *)name; + +/*! + @method + + @abstract + This method adds an object to this connection. + + @discussion + The completion handler is retained until the block is called upon the + completion or cancellation of the connection. This request can be named + to allow for using the request's response in a subsequent request. + + @param request A request to be included in the round-trip when start is called. + + @param handler A handler to call back when the round-trip completes or times out. + + @param batchParameters The optional dictionary of parameters to include for this request + as described in [Graph API Batch Requests]( https://developers.facebook.com/docs/reference/api/batch/ ). + Examples include "depends_on", "name", or "omit_response_on_success". + */ +- (void)addRequest:(FBRequest *)request + completionHandler:(FBRequestHandler)handler + batchParameters:(NSDictionary *)batchParameters; + +/*! + @methodgroup Instance methods + */ + +/*! + @method + + @abstract + This method starts a connection with the server and is capable of handling all of the + requests that were added to the connection. + + @discussion + Errors are reported via the handler callback, even in cases where no + communication is attempted by the implementation of `FBRequestConnection`. In + such cases multiple error conditions may apply, and if so the following + priority (highest to lowest) is used: + + - `FBRequestConnectionInvalidRequestKey` -- this error is reported when an + cannot be encoded for transmission. + + - `FBRequestConnectionInvalidBatchKey` -- this error is reported when any + request in the connection cannot be encoded for transmission with the batch. + In this scenario all requests fail. + + This method cannot be called twice for an `FBRequestConnection` instance. + */ +- (void)start; + +/*! + @method + + @abstract + Signals that a connection should be logically terminated as the + application is no longer interested in a response. + + @discussion + Synchronously calls any handlers indicating the request was cancelled. Cancel + does not guarantee that the request-related processing will cease. It + does promise that all handlers will complete before the cancel returns. A call to + cancel prior to a start implies a cancellation of all requests associated + with the connection. + */ +- (void)cancel; + +/*! + @method + + @abstract + Simple method to make a graph API request for user info (/me), creates an + then uses an object to start the connection with Facebook. The + request uses the active session represented by `[FBSession activeSession]`. + + See + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForMeWithCompletionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to make a graph API request for user friends (/me/friends), creates an + then uses an object to start the connection with Facebook. The + request uses the active session represented by `[FBSession activeSession]`. + + See + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForMyFriendsWithCompletionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to make a graph API post of a photo. The request + uses the active session represented by `[FBSession activeSession]`. + + @param photo A `UIImage` for the photo to upload. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForUploadPhoto:(UIImage *)photo + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to make a graph API post of a status update. The request + uses the active session represented by `[FBSession activeSession]`. + + @param message The message to post. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForPostStatusUpdate:(NSString *)message + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to make a graph API post of a status update. The request + uses the active session represented by `[FBSession activeSession]`. + + @param message The message to post. + @param place The place to checkin with, or nil. Place may be an fbid or a + graph object representing a place. + @param tags Array of friends to tag in the status update, each element + may be an fbid or a graph object representing a user. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForPostStatusUpdate:(NSString *)message + place:(id)place + tags:(id)tags + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Starts a request representing a Graph API call to the "search" endpoint + for a given location using the active session. + + @discussion + Simplifies starting a request to search for places near a coordinate. + + This method creates the necessary object and initializes and + starts an object. A successful Graph API call will + return an array of objects representing the nearby locations. + + @param coordinate The search coordinates. + + @param radius The search radius in meters. + + @param limit The maxiumum number of results to return. It is + possible to receive fewer than this because of the + radius and because of server limits. + + @param searchText The text to use in the query to narrow the set of places + returned. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForPlacesSearchAtCoordinate:(CLLocationCoordinate2D)coordinate + radiusInMeters:(NSInteger)radius + resultsLimit:(NSInteger)limit + searchText:(NSString *)searchText + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Starts a request representing the Graph API call to retrieve a Custom Audience "third party ID" for the app's Facebook user. + Callers will send this ID back to their own servers, collect up a set to create a Facebook Custom Audience with, + and then use the resultant Custom Audience to target ads. + + @param session The FBSession to use to establish the user's identity for users logged into Facebook through this app. + If `nil`, then the activeSession is used. + + @discussion + This method will throw an exception if <[FBSettings defaultAppID]> is `nil`. The appID won't be nil when the pList + includes the appID, or if it's explicitly set. + + The JSON in the request's response will include an "custom_audience_third_party_id" key/value pair, with the value being the ID retrieved. + This ID is an encrypted encoding of the Facebook user's ID and the invoking Facebook app ID. + Multiple calls with the same user will return different IDs, thus these IDs cannot be used to correlate behavior + across devices or applications, and are only meaningful when sent back to Facebook for creating Custom Audiences. + + The ID retrieved represents the Facebook user identified in the following way: if the specified session (or activeSession if the specified + session is `nil`) is open, the ID will represent the user associated with the activeSession; otherwise the ID will represent the user logged into the + native Facebook app on the device. If there is no native Facebook app, no one is logged into it, or the user has opted out + at the iOS level from ad tracking, then a `nil` ID will be returned. + + This method returns `nil` if either the user has opted-out (via iOS) from Ad Tracking, the app itself has limited event usage + via the `[FBAppEvents setLimitEventUsage]` flag, or a specific Facebook user cannot be identified. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForCustomAudienceThirdPartyID:(FBSession *)session + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to make a graph API request, creates an object for HTTP GET, + then uses an object to start the connection with Facebook. The + request uses the active session represented by `[FBSession activeSession]`. + + See + + @param graphPath The Graph API endpoint to use for the request, for example "me". + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startWithGraphPath:(NSString *)graphPath + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to delete an object using the graph API, creates an object for + HTTP DELETE, then uses an object to start the connection with Facebook. + The request uses the active session represented by `[FBSession activeSession]`. + + @param object The object to delete, may be an NSString or NSNumber representing an fbid or an NSDictionary with an id property + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForDeleteObject:(id)object + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to post an object using the graph API, creates an object for + HTTP POST, then uses to start a connection with Facebook. The request uses + the active session represented by `[FBSession activeSession]`. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param graphObject An object or open graph action to post. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + + @discussion This method is typically used for posting an open graph action. If you are only + posting an open graph object (without an action), consider using `startForPostOpenGraphObject:completionHandler:` + */ ++ (FBRequestConnection *)startForPostWithGraphPath:(NSString *)graphPath + graphObject:(id)graphObject + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Creates an `FBRequest` object for a Graph API call, instantiate an + object, add the request to the newly created + connection and finally start the connection. Use this method for + specifying the request parameters and HTTP Method. The request uses + the active session represented by `[FBSession activeSession]`. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param parameters The parameters for the request. A value of nil sends only the automatically handled parameters, for example, the access token. The default is nil. + + @param HTTPMethod The HTTP method to use for the request. A nil value implies a GET. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startWithGraphPath:(NSString *)graphPath + parameters:(NSDictionary *)parameters + HTTPMethod:(NSString *)HTTPMethod + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Creates an `FBRequest` for creating a user owned Open Graph object, instantiate a + object, add the request to the newly created + connection and finally start the connection. The request uses + the active session represented by `[FBSession activeSession]`. + + @param object The Open Graph object to create. Some common expected fields include "title", "image", "url", etc. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForPostOpenGraphObject:(id)object + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Creates an `FBRequest` for creating a user owned Open Graph object, instantiate a + object, add the request to the newly created + connection and finally start the connection. The request uses + the active session represented by `[FBSession activeSession]`. + + @param type The fully-specified Open Graph object type (e.g., my_app_namespace:my_object_name) + @param title The title of the Open Graph object. + @param image The link to an image to be associated with the Open Graph object. + @param url The url to be associated with the Open Graph object. + @param description The description for the object. + @param objectProperties Any additional properties for the Open Graph object. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForPostOpenGraphObjectWithType:(NSString *)type + title:(NSString *)title + image:(id)image + url:(id)url + description:(NSString *)description + objectProperties:(NSDictionary *)objectProperties + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Creates an `FBRequest` for updating a user owned Open Graph object, instantiate a + object, add the request to the newly created + connection and finally start the connection. The request uses + the active session represented by `[FBSession activeSession]`. + + @param object The Open Graph object to update the existing object with. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForUpdateOpenGraphObject:(id)object + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Creates an `FBRequest` for updating a user owned Open Graph object, instantiate a + object, add the request to the newly created + connection and finally start the connection. The request uses + the active session represented by `[FBSession activeSession]`. + + @param objectId The id of the Open Graph object to update. + @param title The updated title of the Open Graph object. + @param image The updated link to an image to be associated with the Open Graph object. + @param url The updated url to be associated with the Open Graph object. + @param description The object's description. + @param objectProperties Any additional properties to update for the Open Graph object. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForUpdateOpenGraphObjectWithId:(id)objectId + title:(NSString *)title + image:(id)image + url:(id)url + description:(NSString *)description + objectProperties:(NSDictionary *)objectProperties + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Starts a request connection to upload an image + to create a staging resource. Staging resources allow you to post binary data + such as images, in preparation for a post of an open graph object or action + which references the image. The URI returned when uploading a staging resource + may be passed as the value for the image property of an open graph object or action. + + @discussion + This method simplifies the preparation of a Graph API call be creating the FBRequest + object and starting the request connection with a single method + + @param image A `UIImage` for the image to upload. + @param handler The handler block to call when the request completes. + */ ++ (FBRequestConnection *)startForUploadStagingResourceWithImage:(UIImage *)image + completionHandler:(FBRequestHandler)handler; + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBSDKMacros.h b/FacebookSDK.framework/Versions/A/Headers/FBSDKMacros.h new file mode 100755 index 0000000..2faed4e --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBSDKMacros.h @@ -0,0 +1,25 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#ifdef __cplusplus +#define FBSDK_EXTERN extern "C" __attribute__((visibility ("default"))) +#else +#define FBSDK_EXTERN extern __attribute__((visibility ("default"))) +#endif + +#define FBSDK_STATIC_INLINE static inline diff --git a/FacebookSDK.framework/Versions/A/Headers/FBSession.h b/FacebookSDK.framework/Versions/A/Headers/FBSession.h new file mode 100755 index 0000000..a1fffbb --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBSession.h @@ -0,0 +1,819 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBSDKMacros.h" + +// up-front decl's +@class FBAccessTokenData; +@class FBSession; +@class FBSessionTokenCachingStrategy; + +#define FB_SESSIONSTATETERMINALBIT (1 << 8) + +#define FB_SESSIONSTATEOPENBIT (1 << 9) + +/* + * Constants used by NSNotificationCenter for active session notification + */ + +/*! NSNotificationCenter name indicating that a new active session was set */ +FBSDK_EXTERN NSString *const FBSessionDidSetActiveSessionNotification; + +/*! NSNotificationCenter name indicating that an active session was unset */ +FBSDK_EXTERN NSString *const FBSessionDidUnsetActiveSessionNotification; + +/*! NSNotificationCenter name indicating that the active session is open */ +FBSDK_EXTERN NSString *const FBSessionDidBecomeOpenActiveSessionNotification; + +/*! NSNotificationCenter name indicating that there is no longer an open active session */ +FBSDK_EXTERN NSString *const FBSessionDidBecomeClosedActiveSessionNotification; + +/*! + @typedef FBSessionState enum + + @abstract Passed to handler block each time a session state changes + + @discussion + */ +typedef enum { + /*! One of two initial states indicating that no valid cached token was found */ + FBSessionStateCreated = 0, + /*! One of two initial session states indicating that a cached token was loaded; + when a session is in this state, a call to open* will result in an open session, + without UX or app-switching*/ + FBSessionStateCreatedTokenLoaded = 1, + /*! One of three pre-open session states indicating that an attempt to open the session + is underway*/ + FBSessionStateCreatedOpening = 2, + + /*! Open session state indicating user has logged in or a cached token is available */ + FBSessionStateOpen = 1 | FB_SESSIONSTATEOPENBIT, + /*! Open session state indicating token has been extended */ + FBSessionStateOpenTokenExtended = 2 | FB_SESSIONSTATEOPENBIT, + + /*! Closed session state indicating that a login attempt failed */ + FBSessionStateClosedLoginFailed = 1 | FB_SESSIONSTATETERMINALBIT, // NSError obj w/more info + /*! Closed session state indicating that the session was closed, but the users token + remains cached on the device for later use */ + FBSessionStateClosed = 2 | FB_SESSIONSTATETERMINALBIT, // " +} FBSessionState; + +/*! helper macro to test for states that imply an open session */ +#define FB_ISSESSIONOPENWITHSTATE(state) (0 != (state & FB_SESSIONSTATEOPENBIT)) + +/*! helper macro to test for states that are terminal */ +#define FB_ISSESSIONSTATETERMINAL(state) (0 != (state & FB_SESSIONSTATETERMINALBIT)) + +/*! + @typedef FBSessionLoginBehavior enum + + @abstract + Passed to open to indicate whether Facebook Login should allow for fallback to be attempted. + + @discussion + Facebook Login authorizes the application to act on behalf of the user, using the user's + Facebook account. Usually a Facebook Login will rely on an account maintained outside of + the application, by the native Facebook application, the browser, or perhaps the device + itself. This avoids the need for a user to enter their username and password directly, and + provides the most secure and lowest friction way for a user to authorize the application to + interact with Facebook. If a Facebook Login is not possible, a fallback Facebook Login may be + attempted, where the user is prompted to enter their credentials in a web-view hosted directly + by the application. + + The `FBSessionLoginBehavior` enum specifies whether to allow fallback, disallow fallback, or + force fallback login behavior. Most applications will use the default, which attempts a normal + Facebook Login, and only falls back if needed. In rare cases, it may be preferable to disallow + fallback Facebook Login completely, or to force a fallback login. + */ +typedef enum { + /*! Attempt Facebook Login, ask user for credentials if necessary */ + FBSessionLoginBehaviorWithFallbackToWebView = 0, + /*! Attempt Facebook Login, no direct request for credentials will be made */ + FBSessionLoginBehaviorWithNoFallbackToWebView = 1, + /*! Only attempt WebView Login; ask user for credentials */ + FBSessionLoginBehaviorForcingWebView = 2, + /*! Attempt Facebook Login, prefering system account and falling back to fast app switch if necessary */ + FBSessionLoginBehaviorUseSystemAccountIfPresent = 3, + /*! Attempt only to login with Safari */ + FBSessionLoginBehaviorForcingSafari = 4, +} FBSessionLoginBehavior; + +/*! + @typedef FBSessionDefaultAudience enum + + @abstract + Passed to open to indicate which default audience to use for sessions that post data to Facebook. + + @discussion + Certain operations such as publishing a status or publishing a photo require an audience. When the user + grants an application permission to perform a publish operation, a default audience is selected as the + publication ceiling for the application. This enumerated value allows the application to select which + audience to ask the user to grant publish permission for. + */ +typedef enum { + /*! No audience needed; this value is useful for cases where data will only be read from Facebook */ + FBSessionDefaultAudienceNone = 0, + /*! Indicates that only the user is able to see posts made by the application */ + FBSessionDefaultAudienceOnlyMe = 10, + /*! Indicates that the user's friends are able to see posts made by the application */ + FBSessionDefaultAudienceFriends = 20, + /*! Indicates that all Facebook users are able to see posts made by the application */ + FBSessionDefaultAudienceEveryone = 30, +} FBSessionDefaultAudience; + +/*! + @typedef FBSessionLoginType enum + + @abstract + Used as the type of the loginType property in order to specify what underlying technology was used to + login the user. + + @discussion + The FBSession object is an abstraction over five distinct mechanisms. This enum allows an application + to test for the mechanism used by a particular instance of FBSession. Usually the mechanism used for a + given login does not matter, however for certain capabilities, the type of login can impact the behavior + of other Facebook functionality. + */ +typedef enum { + /*! A login type has not yet been established */ + FBSessionLoginTypeNone = 0, + /*! A system integrated account was used to log the user into the application */ + FBSessionLoginTypeSystemAccount = 1, + /*! The Facebook native application was used to log the user into the application */ + FBSessionLoginTypeFacebookApplication = 2, + /*! Safari was used to log the user into the application */ + FBSessionLoginTypeFacebookViaSafari = 3, + /*! A web view was used to log the user into the application */ + FBSessionLoginTypeWebView = 4, + /*! A test user was used to create an open session */ + FBSessionLoginTypeTestUser = 5, +} FBSessionLoginType; + +/*! + @typedef + + @abstract Block type used to define blocks called by for state updates + @discussion See https://developers.facebook.com/docs/technical-guides/iossdk/errors/ + for error handling best practices. + + Requesting additional permissions inside this handler (such as by calling + `requestNewPublishPermissions`) should be avoided because it is a poor user + experience and its behavior may vary depending on the login type. You should + request the permissions closer to the operation that requires it (e.g., when + the user performs some action). + */ +typedef void (^FBSessionStateHandler)(FBSession *session, + FBSessionState status, + NSError *error); + +/*! + @typedef + + @abstract Block type used to define blocks called by <[FBSession requestNewReadPermissions:completionHandler:]> + and <[FBSession requestNewPublishPermissions:defaultAudience:completionHandler:]>. + + @discussion See https://developers.facebook.com/docs/technical-guides/iossdk/errors/ + for error handling best practices. + + Requesting additional permissions inside this handler (such as by calling + `requestNewPublishPermissions`) should be avoided because it is a poor user + experience and its behavior may vary depending on the login type. You should + request the permissions closer to the operation that requires it (e.g., when + the user performs some action). + */ +typedef void (^FBSessionRequestPermissionResultHandler)(FBSession *session, + NSError *error); + +/*! + @typedef + + @abstract Block type used to define blocks called by <[FBSession reauthorizeWithPermissions]>. + + @discussion You should use the preferred FBSessionRequestPermissionHandler typedef rather than + this synonym, which has been deprecated. + */ +typedef FBSessionRequestPermissionResultHandler FBSessionReauthorizeResultHandler __attribute__((deprecated)); + +/*! + @typedef + + @abstract Block type used to define blocks called for system credential renewals. + @discussion + */ +typedef void (^FBSessionRenewSystemCredentialsHandler)(ACAccountCredentialRenewResult result, NSError *error) ; + +/*! + @class FBSession + + @abstract + The `FBSession` object is used to authenticate a user and manage the user's session. After + initializing a `FBSession` object the Facebook App ID and desired permissions are stored. + Opening the session will initiate the authentication flow after which a valid user session + should be available and subsequently cached. Closing the session can optionally clear the + cache. + + If an request requires user authorization then an `FBSession` object should be used. + + + @discussion + Instances of the `FBSession` class provide notification of state changes in the following ways: + + 1. Callers of certain `FBSession` methods may provide a block that will be called + back in the course of state transitions for the session (e.g. login or session closed). + + 2. The object supports Key-Value Observing (KVO) for property changes. + */ +@interface FBSession : NSObject + +/*! + @methodgroup Creating a session + */ + +/*! + @method + + @abstract + Returns a newly initialized Facebook session with default values for the parameters + to . + */ +- (instancetype)init; + +/*! + @method + + @abstract + Returns a newly initialized Facebook session with the specified permissions and other + default values for parameters to . + + @param permissions An array of strings representing the permissions to request during the + authentication flow. + + @discussion + It is required that any single permission request request (including initial log in) represent read-only permissions + or publish permissions only; not both. The permissions passed here should reflect this requirement. + + */ +- (instancetype)initWithPermissions:(NSArray *)permissions; + +/*! + @method + + @abstract + Following are the descriptions of the arguments along with their + defaults when ommitted. + + @param permissions An array of strings representing the permissions to request during the + authentication flow. + @param appID The Facebook App ID for the session. If nil is passed in the default App ID will be obtained from a call to <[FBSession defaultAppID]>. The default is nil. + @param urlSchemeSuffix The URL Scheme Suffix to be used in scenarious where multiple iOS apps use one Facebook App ID. A value of nil indicates that this information should be pulled from [FBSettings defaultUrlSchemeSuffix]. The default is nil. + @param tokenCachingStrategy Specifies a key name to use for cached token information in NSUserDefaults, nil + indicates a default value of @"FBAccessTokenInformationKey". + + @discussion + It is required that any single permission request request (including initial log in) represent read-only permissions + or publish permissions only; not both. The permissions passed here should reflect this requirement. + */ +- (instancetype)initWithAppID:(NSString *)appID + permissions:(NSArray *)permissions + urlSchemeSuffix:(NSString *)urlSchemeSuffix + tokenCacheStrategy:(FBSessionTokenCachingStrategy *)tokenCachingStrategy; + +/*! + @method + + @abstract + Following are the descriptions of the arguments along with their + defaults when ommitted. + + @param permissions An array of strings representing the permissions to request during the + authentication flow. + @param defaultAudience Most applications use FBSessionDefaultAudienceNone here, only specifying an audience when using reauthorize to request publish permissions. + @param appID The Facebook App ID for the session. If nil is passed in the default App ID will be obtained from a call to <[FBSession defaultAppID]>. The default is nil. + @param urlSchemeSuffix The URL Scheme Suffix to be used in scenarious where multiple iOS apps use one Facebook App ID. A value of nil indicates that this information should be pulled from [FBSettings defaultUrlSchemeSuffix]. The default is nil. + @param tokenCachingStrategy Specifies a key name to use for cached token information in NSUserDefaults, nil + indicates a default value of @"FBAccessTokenInformationKey". + + @discussion + It is required that any single permission request request (including initial log in) represent read-only permissions + or publish permissions only; not both. The permissions passed here should reflect this requirement. If publish permissions + are used, then the audience must also be specified. + */ +- (instancetype)initWithAppID:(NSString *)appID + permissions:(NSArray *)permissions + defaultAudience:(FBSessionDefaultAudience)defaultAudience + urlSchemeSuffix:(NSString *)urlSchemeSuffix + tokenCacheStrategy:(FBSessionTokenCachingStrategy *)tokenCachingStrategy; + +// instance readonly properties + +/*! @abstract Indicates whether the session is open and ready for use. */ +@property (readonly) BOOL isOpen; + +/*! @abstract Detailed session state */ +@property (readonly) FBSessionState state; + +/*! @abstract Identifies the Facebook app which the session object represents. */ +@property (readonly, copy) NSString *appID; + +/*! @abstract Identifies the URL Scheme Suffix used by the session. This is used when multiple iOS apps share a single Facebook app ID. */ +@property (readonly, copy) NSString *urlSchemeSuffix; + +/*! @abstract The access token for the session object. + @discussion Deprecated. Use the `accessTokenData` property. */ +@property(readonly, copy) NSString *accessToken +__attribute__((deprecated)); + +/*! @abstract The expiration date of the access token for the session object. + @discussion Deprecated. Use the `accessTokenData` property. */ +@property(readonly, copy) NSDate *expirationDate +__attribute__((deprecated)); + +/*! @abstract The permissions granted to the access token during the authentication flow. */ +@property (readonly, copy) NSArray *permissions; + +/*! @abstract Specifies the login type used to authenticate the user. + @discussion Deprecated. Use the `accessTokenData` property. */ +@property(readonly) FBSessionLoginType loginType +__attribute__((deprecated)); + +/*! @abstract Gets the FBAccessTokenData for the session */ +@property (readonly, copy) FBAccessTokenData *accessTokenData; + +/*! + @abstract + Returns a collection of permissions that have been declined by the user for this + given session instance. + + @discussion + A "declined" permission is one that had been requested but was either skipped or removed by + the user during the login flow. Note that once the permission has been granted (either by + requesting again or detected by a permissions refresh), it will be removed from this collection. + */ +@property (readonly, copy) NSArray *declinedPermissions; + +/*! + @methodgroup Instance methods + */ + +/*! + @method + + @abstract Opens a session for the Facebook. + + @discussion + A session may not be used with and other classes in the SDK until it is open. If, prior + to calling open, the session is in the state, then no UX occurs, and + the session becomes available for use. If the session is in the state, prior + to calling open, then a call to open causes login UX to occur, either via the Facebook application + or via mobile Safari. + + Open may be called at most once and must be called after the `FBSession` is initialized. Open must + be called before the session is closed. Calling an open method at an invalid time will result in + an exception. The open session methods may be passed a block that will be called back when the session + state changes. The block will be released when the session is closed. + + @param handler A block to call with the state changes. The default is nil. + */ +- (void)openWithCompletionHandler:(FBSessionStateHandler)handler; + +/*! + @method + + @abstract Logs a user on to Facebook. + + @discussion + A session may not be used with and other classes in the SDK until it is open. If, prior + to calling open, the session is in the state, then no UX occurs, and + the session becomes available for use. If the session is in the state, prior + to calling open, then a call to open causes login UX to occur, either via the Facebook application + or via mobile Safari. + + The method may be called at most once and must be called after the `FBSession` is initialized. It must + be called before the session is closed. Calling the method at an invalid time will result in + an exception. The open session methods may be passed a block that will be called back when the session + state changes. The block will be released when the session is closed. + + @param behavior Controls whether to allow, force, or prohibit Facebook Login or Inline Facebook Login. The default + is to allow Facebook Login, with fallback to Inline Facebook Login. + @param handler A block to call with session state changes. The default is nil. + */ +- (void)openWithBehavior:(FBSessionLoginBehavior)behavior + completionHandler:(FBSessionStateHandler)handler; + +/*! + @method + + @abstract Imports an existing access token and opens the session with it. + + @discussion + The method attempts to open the session using an existing access token. No UX will occur. If + successful, the session with be in an Open state and the method will return YES; otherwise, NO. + + The method may be called at most once and must be called after the `FBSession` is initialized (see below). + It must be called before the session is closed. Calling the method at an invalid time will result in + an exception. The open session methods may be passed a block that will be called back when the session + state changes. The block will be released when the session is closed. + + The initialized session must not have already been initialized from a cache (for example, you could use + the `[FBSessionTokenCachingStrategy nullCacheInstance]` instance). + + @param accessTokenData The token data. See `FBAccessTokenData` for construction methods. + @param handler A block to call with session state changes. The default is nil. + */ +- (BOOL)openFromAccessTokenData:(FBAccessTokenData *)accessTokenData completionHandler:(FBSessionStateHandler) handler; + +/*! + @abstract + Closes the local in-memory session object, but does not clear the persisted token cache. + */ +- (void)close; + +/*! + @abstract + Closes the in-memory session, and clears any persisted cache related to the session. + */ +- (void)closeAndClearTokenInformation; + +/*! + @abstract + Reauthorizes the session, with additional permissions. + + @param permissions An array of strings representing the permissions to request during the + authentication flow. A value of nil indicates basic permissions. The default is nil. + @param behavior Controls whether to allow, force, or prohibit Facebook Login. The default + is to allow Facebook Login and fall back to Inline Facebook Login if needed. + @param handler A block to call with session state changes. The default is nil. + + @discussion Methods and properties that specify permissions without a read or publish + qualification are deprecated; use of a read-qualified or publish-qualified alternative is preferred + (e.g. reauthorizeWithReadPermissions or reauthorizeWithPublishPermissions) + */ +- (void)reauthorizeWithPermissions:(NSArray *)permissions + behavior:(FBSessionLoginBehavior)behavior + completionHandler:(FBSessionReauthorizeResultHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Reauthorizes the session, with additional permissions. + + @param readPermissions An array of strings representing the permissions to request during the + authentication flow. A value of nil indicates basic permissions. + + @param handler A block to call with session state changes. The default is nil. + + @discussion This method is a deprecated alias of <[FBSession requestNewReadPermissions:completionHandler:]>. Consider + using <[FBSession requestNewReadPermissions:completionHandler:]>, which is preferred for readability. + */ +- (void)reauthorizeWithReadPermissions:(NSArray *)readPermissions + completionHandler:(FBSessionReauthorizeResultHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Reauthorizes the session, with additional permissions. + + @param writePermissions An array of strings representing the permissions to request during the + authentication flow. + + @param defaultAudience Specifies the audience for posts. + + @param handler A block to call with session state changes. The default is nil. + + @discussion This method is a deprecated alias of <[FBSession requestNewPublishPermissions:defaultAudience:completionHandler:]>. + Consider using <[FBSession requestNewPublishPermissions:defaultAudience:completionHandler:]>, which is preferred for readability. + */ +- (void)reauthorizeWithPublishPermissions:(NSArray *)writePermissions + defaultAudience:(FBSessionDefaultAudience)defaultAudience + completionHandler:(FBSessionReauthorizeResultHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Requests new or additional read permissions for the session. + + @param readPermissions An array of strings representing the permissions to request during the + authentication flow. A value of nil indicates basic permissions. + + @param handler A block to call with session state changes. The default is nil. + + @discussion The handler, if non-nil, is called once the operation has completed or failed. This is in contrast to the + state completion handler used in <[FBSession openWithCompletionHandler:]> (and other `open*` methods) which is called + for each state-change for the session. + */ +- (void)requestNewReadPermissions:(NSArray *)readPermissions + completionHandler:(FBSessionRequestPermissionResultHandler)handler; + +/*! + @abstract + Requests new or additional write permissions for the session. + + @param writePermissions An array of strings representing the permissions to request during the + authentication flow. + + @param defaultAudience Specifies the audience for posts. + + @param handler A block to call with session state changes. The default is nil. + + @discussion The handler, if non-nil, is called once the operation has completed or failed. This is in contrast to the + state completion handler used in <[FBSession openWithCompletionHandler:]> (and other `open*` methods) which is called + for each state-change for the session. + */ +- (void)requestNewPublishPermissions:(NSArray *)writePermissions + defaultAudience:(FBSessionDefaultAudience)defaultAudience + completionHandler:(FBSessionRequestPermissionResultHandler)handler; +/*! + @abstract Refreshes the current permissions for the session. + @param handler Called after completion of the refresh. + @discussion This will update the sessions' permissions array from the server. This can be + useful if you want to make sure the local permissions are up to date. + */ +- (void)refreshPermissionsWithCompletionHandler:(FBSessionRequestPermissionResultHandler)handler; + +/*! + @abstract + A helper method that is used to provide an implementation for + [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. It should be invoked during + the Facebook Login flow and will update the session information based on the incoming URL. + + @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + */ +- (BOOL)handleOpenURL:(NSURL *)url; + +/*! + @abstract + A helper method that is used to provide an implementation for + [UIApplicationDelegate applicationDidBecomeActive:] to properly resolve session state for + the Facebook Login flow, specifically to support app-switch login. + */ +- (void)handleDidBecomeActive; + +/*! + @abstract + Assign the block to be invoked for session state changes. + + @param stateChangeHandler the handler block. + + @discussion + This will overwrite any state change handler that was already assigned. Typically, + you should only use this setter if you were unable to assign a state change handler explicitly. + One example of this is if you are not opening the session (e.g., using the `open*`) + but still want to assign a `FBSessionStateHandler` block. This can happen when the SDK + opens a session from an app link. + */ +- (void)setStateChangeHandler:(FBSessionStateHandler)stateChangeHandler; + +/*! + @abstract + Returns true if the specified permission has been granted to this session. + + @param permission the permission to verify. + + @discussion + This is a convenience helper for checking if `pemission` is inside the permissions array. + */ +- (BOOL)hasGranted:(NSString *)permission; + +/*! + @methodgroup Class methods + */ + +/*! + @abstract + This is the simplest method for opening a session with Facebook. Using sessionOpen logs on a user, + and sets the static activeSession which becomes the default session object for any Facebook UI widgets + used by the application. This session becomes the active session, whether open succeeds or fails. + + Note, if there is not a cached token available, this method will present UI to the user in order to + open the session via explicit login by the user. + + @param allowLoginUI Sometimes it is useful to attempt to open a session, but only if + no login UI will be required to accomplish the operation. For example, at application startup it may not + be disirable to transition to login UI for the user, and yet an open session is desired so long as a cached + token can be used to open the session. Passing NO to this argument, assures the method will not present UI + to the user in order to open the session. + + @discussion + Returns YES if the session was opened synchronously without presenting UI to the user. This occurs + when there is a cached token available from a previous run of the application. If NO is returned, this indicates + that the session was not immediately opened, via cache. However, if YES was passed as allowLoginUI, then it is + possible that the user will login, and the session will become open asynchronously. The primary use for + this return value is to switch-on facebook capabilities in your UX upon startup, in the case where the session + is opened via cache. + */ ++ (BOOL)openActiveSessionWithAllowLoginUI:(BOOL)allowLoginUI; + +/*! + @abstract + This is a simple method for opening a session with Facebook. Using sessionOpen logs on a user, + and sets the static activeSession which becomes the default session object for any Facebook UI widgets + used by the application. This session becomes the active session, whether open succeeds or fails. + + @param permissions An array of strings representing the permissions to request during the + authentication flow. A value of nil indicates basic permissions. A nil value specifies + default permissions. + + @param allowLoginUI Sometimes it is useful to attempt to open a session, but only if + no login UI will be required to accomplish the operation. For example, at application startup it may not + be desirable to transition to login UI for the user, and yet an open session is desired so long as a cached + token can be used to open the session. Passing NO to this argument, assures the method will not present UI + to the user in order to open the session. + + @param handler Many applications will benefit from notification when a session becomes invalid + or undergoes other state transitions. If a block is provided, the FBSession + object will call the block each time the session changes state. + + @discussion + Returns true if the session was opened synchronously without presenting UI to the user. This occurs + when there is a cached token available from a previous run of the application. If NO is returned, this indicates + that the session was not immediately opened, via cache. However, if YES was passed as allowLoginUI, then it is + possible that the user will login, and the session will become open asynchronously. The primary use for + this return value is to switch-on facebook capabilities in your UX upon startup, in the case where the session + is opened via cache. + + It is required that initial permissions requests represent read-only permissions only. If publish + permissions are needed, you may use reauthorizeWithPermissions to specify additional permissions as + well as an audience. Use of this method will result in a legacy fast-app-switch Facebook Login due to + the requirement to separate read and publish permissions for newer applications. Methods and properties + that specify permissions without a read or publish qualification are deprecated; use of a read-qualified + or publish-qualified alternative is preferred. + */ ++ (BOOL)openActiveSessionWithPermissions:(NSArray *)permissions + allowLoginUI:(BOOL)allowLoginUI + completionHandler:(FBSessionStateHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + This is a simple method for opening a session with Facebook. Using sessionOpen logs on a user, + and sets the static activeSession which becomes the default session object for any Facebook UI widgets + used by the application. This session becomes the active session, whether open succeeds or fails. + + @param readPermissions An array of strings representing the read permissions to request during the + authentication flow. It is not allowed to pass publish permissions to this method. + + @param allowLoginUI Sometimes it is useful to attempt to open a session, but only if + no login UI will be required to accomplish the operation. For example, at application startup it may not + be desirable to transition to login UI for the user, and yet an open session is desired so long as a cached + token can be used to open the session. Passing NO to this argument, assures the method will not present UI + to the user in order to open the session. + + @param handler Many applications will benefit from notification when a session becomes invalid + or undergoes other state transitions. If a block is provided, the FBSession + object will call the block each time the session changes state. + + @discussion + Returns true if the session was opened synchronously without presenting UI to the user. This occurs + when there is a cached token available from a previous run of the application. If NO is returned, this indicates + that the session was not immediately opened, via cache. However, if YES was passed as allowLoginUI, then it is + possible that the user will login, and the session will become open asynchronously. The primary use for + this return value is to switch-on facebook capabilities in your UX upon startup, in the case where the session + is opened via cache. + + */ ++ (BOOL)openActiveSessionWithReadPermissions:(NSArray *)readPermissions + allowLoginUI:(BOOL)allowLoginUI + completionHandler:(FBSessionStateHandler)handler; + +/*! + @abstract + This is a simple method for opening a session with Facebook. Using sessionOpen logs on a user, + and sets the static activeSession which becomes the default session object for any Facebook UI widgets + used by the application. This session becomes the active session, whether open succeeds or fails. + + @param publishPermissions An array of strings representing the publish permissions to request during the + authentication flow. + + @param defaultAudience Anytime an app publishes on behalf of a user, the post must have an audience (e.g. me, my friends, etc.) + The default audience is used to notify the user of the cieling that the user agrees to grant to the app for the provided permissions. + + @param allowLoginUI Sometimes it is useful to attempt to open a session, but only if + no login UI will be required to accomplish the operation. For example, at application startup it may not + be desirable to transition to login UI for the user, and yet an open session is desired so long as a cached + token can be used to open the session. Passing NO to this argument, assures the method will not present UI + to the user in order to open the session. + + @param handler Many applications will benefit from notification when a session becomes invalid + or undergoes other state transitions. If a block is provided, the FBSession + object will call the block each time the session changes state. + + @discussion + Returns true if the session was opened synchronously without presenting UI to the user. This occurs + when there is a cached token available from a previous run of the application. If NO is returned, this indicates + that the session was not immediately opened, via cache. However, if YES was passed as allowLoginUI, then it is + possible that the user will login, and the session will become open asynchronously. The primary use for + this return value is to switch-on facebook capabilities in your UX upon startup, in the case where the session + is opened via cache. + + */ ++ (BOOL)openActiveSessionWithPublishPermissions:(NSArray *)publishPermissions + defaultAudience:(FBSessionDefaultAudience)defaultAudience + allowLoginUI:(BOOL)allowLoginUI + completionHandler:(FBSessionStateHandler)handler; + +/*! + @abstract + An application may get or set the current active session. Certain high-level components in the SDK + will use the activeSession to set default session (e.g. `FBLoginView`, `FBFriendPickerViewController`) + + @discussion + If sessionOpen* is called, the resulting `FBSession` object also becomes the activeSession. If another + session was active at the time, it is closed automatically. If activeSession is called when no session + is active, a session object is instatiated and returned; in this case open must be called on the session + in order for it to be useable for communication with Facebook. + */ ++ (FBSession *)activeSession; + +/*! + @abstract + An application may get or set the current active session. Certain high-level components in the SDK + will use the activeSession to set default session (e.g. `FBLoginView`, `FBFriendPickerViewController`) + + @param session The FBSession object to become the active session + + @discussion + If an application prefers the flexibilility of directly instantiating a session object, an active + session can be set directly. + */ ++ (FBSession *)setActiveSession:(FBSession *)session; + +/*! + @method + + @abstract Set the default Facebook App ID to use for sessions. The app ID may be + overridden on a per session basis. + + @discussion This method has been deprecated in favor of [FBSettings setDefaultAppID]. + + @param appID The default Facebook App ID to use for methods. + */ ++ (void)setDefaultAppID:(NSString *)appID __attribute__((deprecated)); + +/*! + @method + + @abstract Get the default Facebook App ID to use for sessions. If not explicitly + set, the default will be read from the application's plist. The app ID may be + overridden on a per session basis. + + @discussion This method has been deprecated in favor of [FBSettings defaultAppID]. + */ ++ (NSString *)defaultAppID __attribute__((deprecated)); + +/*! + @method + + @abstract Set the default url scheme suffix to use for sessions. The url + scheme suffix may be overridden on a per session basis. + + @discussion This method has been deprecated in favor of [FBSettings setDefaultUrlSchemeSuffix]. + + @param urlSchemeSuffix The default url scheme suffix to use for methods. + */ ++ (void)setDefaultUrlSchemeSuffix:(NSString *)urlSchemeSuffix __attribute__((deprecated)); + +/*! + @method + + @abstract Get the default url scheme suffix used for sessions. If not + explicitly set, the default will be read from the application's plist. The + url scheme suffix may be overridden on a per session basis. + + @discussion This method has been deprecated in favor of [FBSettings defaultUrlSchemeSuffix]. + */ ++ (NSString *)defaultUrlSchemeSuffix __attribute__((deprecated)); + +/*! + @method + + @abstract Issues an asychronous renewCredentialsForAccount call to the device Facebook account store. + + @param handler The completion handler to call when the renewal is completed. The handler will be + invoked on the main thread. + + @discussion This can be used to explicitly renew account credentials on iOS 6 devices and is provided + as a convenience wrapper around `[ACAccountStore renewCredentialsForAccount:completion]`. Note the + method will not issue the renewal call if the the Facebook account has not been set on the device, or + if access had not been granted to the account (though the handler wil receive an error). + + This is safe to call (and will surface an error to the handler) on versions of iOS before 6 or if the user + logged in via Safari or Facebook SSO. + */ ++ (void)renewSystemCredentials:(FBSessionRenewSystemCredentialsHandler)handler; +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBSessionTokenCachingStrategy.h b/FacebookSDK.framework/Versions/A/Headers/FBSessionTokenCachingStrategy.h new file mode 100755 index 0000000..d5a405a --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBSessionTokenCachingStrategy.h @@ -0,0 +1,161 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBAccessTokenData.h" +#import "FBSDKMacros.h" + +/*! + @class + + @abstract + The `FBSessionTokenCachingStrategy` class is responsible for persisting and retrieving cached data related to + an object, including the user's Facebook access token. + + @discussion + `FBSessionTokenCachingStrategy` is designed to be instantiated directly or used as a base class. Usually default + token caching behavior is sufficient, and you do not need to interface directly with `FBSessionTokenCachingStrategy` objects. + However, if you need to control where or how `FBSession` information is cached, then you may take one of two approaches. + + The first and simplest approach is to instantiate an instance of `FBSessionTokenCachingStrategy`, and then pass + the instance to `FBSession` class' `init` method. This enables your application to control the key name used in + `NSUserDefaults` to store session information. You may consider this approach if you plan to cache session information + for multiple users. + + The second and more advanced approached is to derive a custom class from `FBSessionTokenCachingStrategy`, which will + be responsible for caching behavior of your application. This approach is useful if you need to change where the + information is cached, for example if you prefer to use the filesystem or make a network connection to fetch and + persist cached tokens. Inheritors should override the cacheTokenInformation, fetchTokenInformation, and clearToken methods. + Doing this enables your application to implement any token caching scheme, including no caching at all (see + `[FBSessionTokenCachingStrategy nullCacheInstance]`. + + Direct use of `FBSessionTokenCachingStrategy`is an advanced technique. Most applications use objects without + passing an `FBSessionTokenCachingStrategy`, which yields default caching to `NSUserDefaults`. + */ +@interface FBSessionTokenCachingStrategy : NSObject + +/*! + @abstract Initializes and returns an instance + */ +- (instancetype)init; + +/*! + @abstract + Initializes and returns an instance + + @param tokenInformationKeyName Specifies a key name to use for cached token information in NSUserDefaults, nil + indicates a default value of @"FBAccessTokenInformationKey" + */ +- (instancetype)initWithUserDefaultTokenInformationKeyName:(NSString *)tokenInformationKeyName; + +/*! + @abstract + Called by (and overridden by inheritors), in order to cache token information. + + @param tokenInformation Dictionary containing token information to be cached by the method + @discussion You should favor overriding this instead of `cacheFBAccessTokenData` only if you intend + to cache additional data not captured by the FBAccessTokenData type. + */ +- (void)cacheTokenInformation:(NSDictionary *)tokenInformation; + +/*! + @abstract Cache the supplied token. + @param accessToken The token instance. + @discussion This essentially wraps a call to `cacheTokenInformation` so you should + override this when providing a custom token caching strategy. + */ +- (void)cacheFBAccessTokenData:(FBAccessTokenData *)accessToken; + +/*! + @abstract + Called by (and overridden by inheritors), in order to fetch cached token information + + @discussion + An overriding implementation should only return a token if it + can also return an expiration date, otherwise return nil. + You should favor overriding this instead of `fetchFBAccessTokenData` only if you intend + to cache additional data not captured by the FBAccessTokenData type. + + */ +- (NSDictionary *)fetchTokenInformation; + +/*! + @abstract + Fetches the cached token instance. + + @discussion + This essentially wraps a call to `fetchTokenInformation` so you should + override this when providing a custom token caching strategy. + + In order for an `FBSession` instance to be able to use a cached token, + the token must be not be expired (see `+isValidTokenInformation:`) and + must also contain all permissions in the initialized session instance. + */ +- (FBAccessTokenData *)fetchFBAccessTokenData; + +/*! + @abstract + Called by (and overridden by inheritors), in order delete any cached information for the current token + */ +- (void)clearToken; + +/*! + @abstract + Helper function called by the SDK as well as apps, in order to fetch the default strategy instance. + */ ++ (FBSessionTokenCachingStrategy *)defaultInstance; + +/*! + @abstract + Helper function to return a FBSessionTokenCachingStrategy instance that does not perform any caching. + */ ++ (FBSessionTokenCachingStrategy *)nullCacheInstance; + +/*! + @abstract + Helper function called by the SDK as well as application code, used to determine whether a given dictionary + contains the minimum token information usable by the . + + @param tokenInformation Dictionary containing token information to be validated + */ ++ (BOOL)isValidTokenInformation:(NSDictionary *)tokenInformation; + +@end + +// The key to use with token information dictionaries to get and set the token value +FBSDK_EXTERN NSString *const FBTokenInformationTokenKey; + +// The to use with token information dictionaries to get and set the expiration date +FBSDK_EXTERN NSString *const FBTokenInformationExpirationDateKey; + +// The to use with token information dictionaries to get and set the refresh date +FBSDK_EXTERN NSString *const FBTokenInformationRefreshDateKey; + +// The key to use with token information dictionaries to get the related user's fbid +FBSDK_EXTERN NSString *const FBTokenInformationUserFBIDKey; + +// The key to use with token information dictionaries to determine whether the token was fetched via Facebook Login +FBSDK_EXTERN NSString *const FBTokenInformationIsFacebookLoginKey; + +// The key to use with token information dictionaries to determine whether the token was fetched via the OS +FBSDK_EXTERN NSString *const FBTokenInformationLoginTypeLoginKey; + +// The key to use with token information dictionaries to get the latest known permissions +FBSDK_EXTERN NSString *const FBTokenInformationPermissionsKey; + +// The key to use with token information dictionaries to get the date the permissions were last refreshed. +FBSDK_EXTERN NSString *const FBTokenInformationPermissionsRefreshDateKey; diff --git a/FacebookSDK.framework/Versions/A/Headers/FBSettings.h b/FacebookSDK.framework/Versions/A/Headers/FBSettings.h new file mode 100755 index 0000000..216030f --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBSettings.h @@ -0,0 +1,356 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBSDKMacros.h" + +/* + * Constants defining logging behavior. Use with <[FBSettings setLoggingBehavior]>. + */ + +/*! Log requests from FBRequest* classes */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorFBRequests; + +/*! Log requests from FBURLConnection* classes */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorFBURLConnections; + +/*! Include access token in logging. */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorAccessTokens; + +/*! Log session state transitions. */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorSessionStateTransitions; + +/*! Log performance characteristics */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorPerformanceCharacteristics; + +/*! Log FBAppEvents interactions */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorAppEvents; + +/*! Log Informational occurrences */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorInformational; + +/*! Log cache errors. */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorCacheErrors; + +/*! Log errors likely to be preventable by the developer. This is in the default set of enabled logging behaviors. */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorDeveloperErrors; + +@class FBGraphObject; + +/*! + @typedef + + @abstract Block type used to get install data that is returned by server when publishInstall is called + @discussion + */ +typedef void (^FBInstallResponseDataHandler)(FBGraphObject *response, NSError *error); + +/*! + @typedef + + @abstract A list of beta features that can be enabled for the SDK. Beta features are for evaluation only, + and are therefore only enabled for DEBUG builds. Beta features should not be enabled + in release builds. + */ +typedef enum : NSUInteger { + FBBetaFeaturesNone = 0, +#if defined(DEBUG) || defined(FB_BUILD_ONLY) + FBBetaFeaturesShareDialog = 1 << 0, + FBBetaFeaturesOpenGraphShareDialog = 1 << 1, + FBBetaFeaturesLikeButton = 1 << 2, +#endif +} FBBetaFeatures; + +/*! + @typedef + @abstract Indicates if this app should be restricted + */ +typedef NS_ENUM(NSUInteger, FBRestrictedTreatment) { + /*! The default treatment indicating the app is not restricted. */ + FBRestrictedTreatmentNO = 0, + + /*! Indicates the app is restricted. */ + FBRestrictedTreatmentYES = 1 +}; + +/*! + @class FBSettings + + @abstract Allows configuration of SDK behavior. +*/ +@interface FBSettings : NSObject + +/*! + @method + + @abstract Retrieve the current iOS SDK version. + + */ ++ (NSString *)sdkVersion; + +/*! + @method + + @abstract Retrieve the current Facebook SDK logging behavior. + + */ ++ (NSSet *)loggingBehavior; + +/*! + @method + + @abstract Set the current Facebook SDK logging behavior. This should consist of strings defined as + constants with FBLogBehavior*, and can be constructed with, e.g., [NSSet initWithObjects:]. + + @param loggingBehavior A set of strings indicating what information should be logged. If nil is provided, the logging + behavior is reset to the default set of enabled behaviors. Set in an empty set in order to disable all logging. + */ ++ (void)setLoggingBehavior:(NSSet *)loggingBehavior; + +/*! @abstract deprecated method */ ++ (BOOL)shouldAutoPublishInstall __attribute__ ((deprecated)); + +/*! @abstract deprecated method */ ++ (void)setShouldAutoPublishInstall:(BOOL)autoPublishInstall __attribute__ ((deprecated)); + +/*! + @method + + @abstract This method has been replaced by [FBAppEvents activateApp] */ ++ (void)publishInstall:(NSString *)appID __attribute__ ((deprecated("use [FBAppEvents activateApp] instead"))); + +/*! + @method + + @abstract Manually publish an attributed install to the Facebook graph, and return the server response back in + the supplied handler. Calling this method will implicitly turn off auto-publish. This method acquires the + current attribution id from the facebook application, queries the graph API to determine if the application + has install attribution enabled, publishes the id, and records success to avoid reporting more than once. + + @param appID A specific appID to publish an install for. If nil, uses [FBSession defaultAppID]. + @param handler A block to call with the server's response. + */ ++ (void)publishInstall:(NSString *)appID + withHandler:(FBInstallResponseDataHandler)handler __attribute__ ((deprecated)); + + +/*! + @method + + @abstract + Gets the application version to the provided string. `FBAppEvents`, for instance, attaches the app version to + events that it logs, which are then available in App Insights. + */ ++ (NSString *)appVersion; + +/*! + @method + + @abstract + Sets the application version to the provided string. `FBAppEvents`, for instance, attaches the app version to + events that it logs, which are then available in App Insights. + + @param appVersion The version identifier of the iOS app. + */ ++ (void)setAppVersion:(NSString *)appVersion; + +/*! + @method + + @abstract Retrieve the Client Token that has been set via [FBSettings setClientToken] + */ ++ (NSString *)clientToken; + +/*! + @method + + @abstract Sets the Client Token for the Facebook App. This is needed for certain API calls when made anonymously, + without a user-based Session. + + @param clientToken The Facebook App's "client token", which, for a given appid can be found in the Security + section of the Advanced tab of the Facebook App settings found at + + */ ++ (void)setClientToken:(NSString *)clientToken; + +/*! + @method + + @abstract Set the default Facebook Display Name to be used by the SDK. This should match + the Display Name that has been set for the app with the corresponding Facebook App ID, in + the Facebook App Dashboard + + @param displayName The default Facebook Display Name to be used by the SDK. + */ ++ (void)setDefaultDisplayName:(NSString *)displayName; + +/*! + @method + + @abstract Get the default Facebook Display Name used by the SDK. If not explicitly + set, the default will be read from the application's plist. + */ ++ (NSString *)defaultDisplayName; + +/*! + @method + + @abstract Set the default Facebook App ID to use for sessions. The SDK allows the appID + to be overridden per instance in certain cases (e.g. per instance of FBSession) + + @param appID The default Facebook App ID to be used by the SDK. + */ ++ (void)setDefaultAppID:(NSString *)appID; + +/*! + @method + + @abstract Get the default Facebook App ID used by the SDK. If not explicitly + set, the default will be read from the application's plist. The SDK allows the appID + to be overridden per instance in certain cases (e.g. per instance of FBSession) + */ ++ (NSString *)defaultAppID; + +/*! + @method + + @abstract Set the default url scheme suffix used by the SDK. + + @param urlSchemeSuffix The default url scheme suffix to be used by the SDK. + */ ++ (void)setDefaultUrlSchemeSuffix:(NSString *)urlSchemeSuffix; + +/*! + @method + + @abstract Get the default url scheme suffix used for sessions. If not + explicitly set, the default will be read from the application's plist value for 'FacebookUrlSchemeSuffix'. + */ ++ (NSString *)defaultUrlSchemeSuffix; + +/*! + @method + + @abstract Set the bundle name from the SDK will try and load overrides of images and text + + @param bundleName The name of the bundle (MyFBBundle). + */ ++ (void)setResourceBundleName:(NSString *)bundleName; + +/*! + @method + + @abstract Get the name of the bundle to override the SDK images and text + */ ++ (NSString *)resourceBundleName; + +/*! + @method + + @abstract Set the subpart of the facebook domain (e.g. @"beta") so that requests will be sent to graph.beta.facebook.com + + @param facebookDomainPart The domain part to be inserted into facebook.com + */ ++ (void)setFacebookDomainPart:(NSString *)facebookDomainPart; + +/*! + @method + + @abstract Get the Facebook domain part + */ ++ (NSString *)facebookDomainPart; + +/*! + @method + + @abstract Enables the specified beta features. Beta features are for evaluation only, + and are therefore only enabled for debug builds. Beta features should not be enabled + in release builds. + + @param betaFeatures The beta features to enable (expects a bitwise OR of FBBetaFeatures) + */ ++ (void)enableBetaFeatures:(NSUInteger)betaFeatures; + +/*! + @method + + @abstract Enables a beta feature. Beta features are for evaluation only, + and are therefore only enabled for debug builds. Beta features should not be enabled + in release builds. + + @param betaFeature The beta feature to enable. + */ ++ (void)enableBetaFeature:(FBBetaFeatures)betaFeature; + +/*! + @method + + @abstract Disables a beta feature. + + @param betaFeature The beta feature to disable. + */ ++ (void)disableBetaFeature:(FBBetaFeatures)betaFeature; + +/*! + @method + + @abstract Determines whether a beta feature is enabled or not. + + @param betaFeature The beta feature to check. + + @return YES if the beta feature is enabled, NO if not. + */ ++ (BOOL)isBetaFeatureEnabled:(FBBetaFeatures)betaFeature; + +/*! + @method + + @abstract + Gets whether data such as that generated through FBAppEvents and sent to Facebook should be restricted from being used for other than analytics and conversions. Defaults to NO. This value is stored on the device and persists across app launches. + */ ++ (BOOL)limitEventAndDataUsage; + +/*! + @method + + @abstract + Sets whether data such as that generated through FBAppEvents and sent to Facebook should be restricted from being used for other than analytics and conversions. Defaults to NO. This value is stored on the device and persists across app launches. + + @param limitEventAndDataUsage The desired value. + */ ++ (void)setLimitEventAndDataUsage:(BOOL)limitEventAndDataUsage; + +/*! + @method + @abstract Returns YES if the legacy Graph API mode is enabled +*/ ++ (BOOL)isPlatformCompatibilityEnabled; + +/*! + @method + @abstract Configures the SDK to use the legacy platform. + @param enable indicates whether to use the legacy mode + @discussion Setting this flag has several effects: + - FBRequests will target v1.0 of the Graph API. + - Login will use the prior behavior without abilities to decline permission. + - Specific new features such as `FBLikeButton` that require the current platform + will not work. +*/ ++ (void)enablePlatformCompatibility:(BOOL)enable; + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBShareDialogParams.h b/FacebookSDK.framework/Versions/A/Headers/FBShareDialogParams.h new file mode 100755 index 0000000..7b828a8 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBShareDialogParams.h @@ -0,0 +1,29 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBLinkShareParams.h" + +/*! + @class FBShareDialogParams + + @abstract Deprecated. Use `FBLinkShareParams` instead. + */ +__attribute__((deprecated)) +@interface FBShareDialogParams : FBLinkShareParams + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBShareDialogPhotoParams.h b/FacebookSDK.framework/Versions/A/Headers/FBShareDialogPhotoParams.h new file mode 100755 index 0000000..a7f0b75 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBShareDialogPhotoParams.h @@ -0,0 +1,29 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBPhotoParams.h" + +/*! + @class FBShareDialogPhotoParams + + @abstract Deprecated. Use `FBPhotoParams` instead. +*/ +__attribute__((deprecated)) +@interface FBShareDialogPhotoParams : FBPhotoParams + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBTestSession.h b/FacebookSDK.framework/Versions/A/Headers/FBTestSession.h new file mode 100755 index 0000000..84dbd91 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBTestSession.h @@ -0,0 +1,142 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FBSession.h" + +#import "FBSDKMacros.h" + +#if defined (DEBUG) +#define SAFE_TO_USE_FBTESTSESSION +#endif + +#if !defined(SAFE_TO_USE_FBTESTSESSION) +#pragma message ("warning: using FBTestSession, which is designed for unit-testing uses only, in non-DEBUG code -- ensure this is what you really want") +#endif + +/*! + Consider using this tag to pass to sessionWithSharedUserWithPermissions:uniqueUserTag: when + you need a second unique test user in a test case. Using the same tag each time reduces + the proliferation of test users. + */ +FBSDK_EXTERN NSString *kSecondTestUserTag; +/*! + Consider using this tag to pass to sessionWithSharedUserWithPermissions:uniqueUserTag: when + you need a third unique test user in a test case. Using the same tag each time reduces + the proliferation of test users. + */ +FBSDK_EXTERN NSString *kThirdTestUserTag; + +/*! + @class FBTestSession + + @abstract + Implements an FBSession subclass that knows about test users for a particular + application. This should never be used from a real application, but may be useful + for writing unit tests, etc. + + @discussion + Facebook allows developers to create test accounts for testing their applications' + Facebook integration (see https://developers.facebook.com/docs/test_users/). This class + simplifies use of these accounts for writing unit tests. It is not designed for use in + production application code. + + The main use case for this class is using sessionForUnitTestingWithPermissions:mode: + to create a session for a test user. Two modes are supported. In "shared" mode, an attempt + is made to find an existing test user that has the required permissions and, if it is not + currently in use by another FBTestSession, just use that user. If no such user is available, + a new one is created with the required permissions. In "private" mode, designed for + scenarios which require a new user in a known clean state, a new test user will always be + created, and it will be automatically deleted when the FBTestSession is closed. + + Note that the shared test user functionality depends on a naming convention for the test users. + It is important that any testing of functionality which will mutate the permissions for a + test user NOT use a shared test user, or this scheme will break down. If a shared test user + seems to be in an invalid state, it can be deleted manually via the Web interface at + https://developers.facebook.com/apps/APP_ID/permissions?role=test+users. + */ +@interface FBTestSession : FBSession + +/// The app access token (composed of app ID and secret) to use for accessing test users. +@property (readonly, copy) NSString *appAccessToken; +/// The ID of the test user associated with this session. +@property (readonly, copy) NSString *testUserID; +/// The name of the test user associated with this session. +@property (readonly, copy) NSString *testUserName; +/// The App ID of the test app as configured in the plist. +@property (readonly, copy) NSString *testAppID; +/// The App Secret of the test app as configured in the plist. +@property (readonly, copy) NSString *testAppSecret; +// Defaults to NO. If set to YES, reauthorize calls will fail with a nil token +// as if the user had cancelled it reauthorize. +@property (assign) BOOL disableReauthorize; + +/*! + @abstract + Constructor helper to create a session for use in unit tests + + @discussion + This method creates a session object which uses a shared test user with the right permissions, + creating one if necessary on open (but not deleting it on close, so it can be re-used in later + tests). Calling this method multiple times may return sessions with the same user. If this is not + desired, use the variant sessionWithSharedUserWithPermissions:uniqueUserTag:. + + This method should not be used in application code -- but is useful for creating unit tests + that use the Facebook SDK. + + @param permissions array of strings naming permissions to authorize; nil indicates + a common default set of permissions should be used for unit testing + */ ++ (instancetype)sessionWithSharedUserWithPermissions:(NSArray *)permissions; + +/*! + @abstract + Constructor helper to create a session for use in unit tests + + @discussion + This method creates a session object which uses a shared test user with the right permissions, + creating one if necessary on open (but not deleting it on close, so it can be re-used in later + tests). + + This method should not be used in application code -- but is useful for creating unit tests + that use the Facebook SDK. + + @param permissions array of strings naming permissions to authorize; nil indicates + a common default set of permissions should be used for unit testing + + @param uniqueUserTag a string which will be used to make this user unique among other + users with the same permissions. Useful for tests which require two or more users to interact + with each other, and which therefore must have sessions associated with different users. For + this case, consider using kSecondTestUserTag and kThirdTestUserTag so these users can be shared + with other, similar, tests. + */ ++ (instancetype)sessionWithSharedUserWithPermissions:(NSArray *)permissions + uniqueUserTag:(NSString *)uniqueUserTag; + +/*! + @abstract + Constructor helper to create a session for use in unit tests + + @discussion + This method creates a session object which creates a test user on open, and destroys the user on + close; This method should not be used in application code -- but is useful for creating unit tests + that use the Facebook SDK. + + @param permissions array of strings naming permissions to authorize; nil indicates + a common default set of permissions should be used for unit testing + */ ++ (instancetype)sessionWithPrivateUserWithPermissions:(NSArray *)permissions; + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBTooltipView.h b/FacebookSDK.framework/Versions/A/Headers/FBTooltipView.h new file mode 100755 index 0000000..8f1c1d7 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBTooltipView.h @@ -0,0 +1,134 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/*! + @typedef FBTooltipViewArrowDirection enum + + @abstract + Passed on construction to determine arrow orientation. + */ +typedef NS_ENUM(NSUInteger, FBTooltipViewArrowDirection) { + /*! View is located above given point, arrow is pointing down. */ + FBTooltipViewArrowDirectionDown = 0, + /*! View is located below given point, arrow is pointing up. */ + FBTooltipViewArrowDirectionUp = 1, +}; + +/*! + @typedef FBTooltipColorStyle enum + + @abstract + Passed on construction to determine color styling. + */ +typedef NS_ENUM(NSUInteger, FBTooltipColorStyle) { + /*! Light blue background, white text, faded blue close button. */ + FBTooltipColorStyleFriendlyBlue = 0, + /*! Dark gray background, white text, light gray close button. */ + FBTooltipColorStyleNeutralGray = 1, +}; + +/*! + @class FBTooltipView + + @abstract + Tooltip bubble with text in it used to display tips for UI elements, + with a pointed arrow (to refer to the UI element). + + @discussion + The tooltip fades in and will automatically fade out. See `displayDuration`. + */ +@interface FBTooltipView : UIView + +/*! + @abstract Gets or sets the amount of time in seconds the tooltip should be displayed. + @discussion Set this to zero to make the display permanent until explicitly dismissed. + Defaults to six seconds. +*/ +@property (nonatomic, assign) CFTimeInterval displayDuration; + +/*! + @abstract Gets or sets the color style after initialization. + @discussion Defaults to value passed to -initWithTagline:message:colorStyle:. + */ +@property (nonatomic, assign) FBTooltipColorStyle colorStyle; + +/*! + @abstract Gets or sets the message. +*/ +@property (nonatomic, copy) NSString *message; + +/*! + @abstract Gets or sets the optional phrase that comprises the first part of the label (and is highlighted differently). +*/ +@property (nonatomic, copy) NSString *tagline; + +/*! + @abstract + Designated initializer. + + @param tagline First part of the label, that will be highlighted with different color. Can be nil. + + @param message Main message to display. + + @param colorStyle Color style to use for tooltip. + + @discussion + If you need to show a tooltip for login, consider using the `FBLoginTooltipView` view. + + @see FBLoginTooltipView + */ +- (id)initWithTagline:(NSString *)tagline message:(NSString *)message colorStyle:(FBTooltipColorStyle)colorStyle; + +/*! + @abstract + Show tooltip at the top or at the bottom of given view. + Tooltip will be added to anchorView.superview + + @param anchorView sibling view to show at, must be already added to it's superview, in order to decide + where tooltip will be shown. (If there's not enough space at the top of the anchorView in superView's bounds - + tooltip will be shown at the bottom of it) + + @discussion + Use this method to present the tooltip with automatic positioning or + use -presentInView:withArrowPosition:direction: for manual positioning + */ +- (void)presentFromView:(UIView *) anchorView; + +/*! + @abstract + Adds tooltip to given view, with given position and arrow direction. + + @param view View to be used as superview. + + @param arrowPosition Point in view's cordinates, where arrow will be pointing + + @param arrowDirection whenever arrow should be pointing up (message bubble is below the arrow) or + down (message bubble is above the arrow). + */ +- (void)presentInView:(UIView *)view withArrowPosition:(CGPoint)arrowPosition direction:(FBTooltipViewArrowDirection)arrowDirection; + +/*! + @abstract + Remove tooltip manually. + + @discussion + Calling this method isn't necessary - tooltip will dismiss itself automatically after the `displayDuration`. + */ +- (void)dismiss; + +@end diff --git a/FacebookSDK.framework/Versions/A/Headers/FBUserSettingsViewController.h b/FacebookSDK.framework/Versions/A/Headers/FBUserSettingsViewController.h new file mode 100755 index 0000000..5df08e7 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBUserSettingsViewController.h @@ -0,0 +1,128 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSession.h" +#import "FBViewController.h" + +/*! + @protocol + + @abstract + The `FBUserSettingsDelegate` protocol defines the methods called by a . + */ +@protocol FBUserSettingsDelegate + +@optional + +/*! + @abstract + Called when the view controller will log the user out in response to a button press. + + @param sender The view controller sending the message. + */ +- (void)loginViewControllerWillLogUserOut:(id)sender; + +/*! + @abstract + Called after the view controller logged the user out in response to a button press. + + @param sender The view controller sending the message. + */ +- (void)loginViewControllerDidLogUserOut:(id)sender; + +/*! + @abstract + Called when the view controller will log the user in in response to a button press. + Note that logging in can fail for a number of reasons, so there is no guarantee that this + will be followed by a call to loginViewControllerDidLogUserIn:. Callers wanting more granular + notification of the session state changes can use KVO or the NSNotificationCenter to observe them. + + @param sender The view controller sending the message. + */ +- (void)loginViewControllerWillAttemptToLogUserIn:(id)sender; + +/*! + @abstract + Called after the view controller successfully logged the user in in response to a button press. + + @param sender The view controller sending the message. + */ +- (void)loginViewControllerDidLogUserIn:(id)sender; + +/*! + @abstract + Called if the view controller encounters an error while trying to log a user in. + + @param sender The view controller sending the message. + @param error The error encountered. + @discussion See https://developers.facebook.com/docs/technical-guides/iossdk/errors/ + for error handling best practices. + */ +- (void)loginViewController:(id)sender receivedError:(NSError *)error; + +@end + + +/*! + @class FBUserSettingsViewController + + @abstract + The `FBUserSettingsViewController` class provides a user interface exposing a user's + Facebook-related settings. Currently, this is limited to whether they are logged in or out + of Facebook. + + Because of the size of some graphics used in this view, its resources are packaged as a separate + bundle. In order to use `FBUserSettingsViewController`, drag the `FBUserSettingsViewResources.bundle` + from the SDK directory into your Xcode project. + */ +@interface FBUserSettingsViewController : FBViewController + +/*! + @abstract + The permissions to request if the user logs in via this view. + */ +@property (nonatomic, copy) NSArray *permissions __attribute__((deprecated)); + +/*! + @abstract + The read permissions to request if the user logs in via this view. + + @discussion + Note, that if read permissions are specified, then publish permissions should not be specified. + */ +@property (nonatomic, copy) NSArray *readPermissions; + +/*! + @abstract + The publish permissions to request if the user logs in via this view. + + @discussion + Note, that a defaultAudience value of FBSessionDefaultAudienceOnlyMe, FBSessionDefaultAudienceEveryone, or + FBSessionDefaultAudienceFriends should be set if publish permissions are specified. Additionally, when publish + permissions are specified, then read should not be specified. + */ +@property (nonatomic, copy) NSArray *publishPermissions; + +/*! + @abstract + The default audience to use, if publish permissions are requested at login time. + */ +@property (nonatomic, assign) FBSessionDefaultAudience defaultAudience; + +@end + diff --git a/FacebookSDK.framework/Versions/A/Headers/FBViewController.h b/FacebookSDK.framework/Versions/A/Headers/FBViewController.h new file mode 100755 index 0000000..fa33d21 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBViewController.h @@ -0,0 +1,118 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@class FBViewController; + +/*! + @typedef FBModalCompletionHandler + + @abstract + A block that is passed to [FBViewController presentModallyInViewController:animated:handler:] + and called when the view controller is dismissed via either Done or Cancel. + + @param sender The that is being dismissed. + + @param donePressed If YES, Done was pressed. If NO, Cancel was pressed. + */ +typedef void (^FBModalCompletionHandler)(FBViewController *sender, BOOL donePressed); + +/*! + @protocol + + @abstract + The `FBViewControllerDelegate` protocol defines the methods called when the Cancel or Done + buttons are pressed in a . + */ +@protocol FBViewControllerDelegate + +@optional + +/*! + @abstract + Called when the Cancel button is pressed on a modally-presented . + + @param sender The view controller sending the message. + */ +- (void)facebookViewControllerCancelWasPressed:(id)sender; + +/*! + @abstract + Called when the Done button is pressed on a modally-presented . + + @param sender The view controller sending the message. + */ +- (void)facebookViewControllerDoneWasPressed:(id)sender; + +@end + + +/*! + @class FBViewController + + @abstract + The `FBViewController` class is a base class encapsulating functionality common to several + other view controller classes. Specifically, it provides UI when a view controller is presented + modally, in the form of optional Cancel and Done buttons. + */ +@interface FBViewController : UIViewController + +/*! + @abstract + The Cancel button to display when presented modally. If nil, no Cancel button is displayed. + If this button is provided, its target and action will be redirected to internal handlers, replacing + any previous target that may have been set. + */ +@property (nonatomic, retain) IBOutlet UIBarButtonItem *cancelButton; + +/*! + @abstract + The Done button to display when presented modally. If nil, no Done button is displayed. + If this button is provided, its target and action will be redirected to internal handlers, replacing + any previous target that may have been set. + */ +@property (nonatomic, retain) IBOutlet UIBarButtonItem *doneButton; + +/*! + @abstract + The delegate that will be called when Cancel or Done is pressed. Derived classes may specify + derived types for their delegates that provide additional functionality. + */ +@property (nonatomic, assign) IBOutlet id delegate; + +/*! + @abstract + The view into which derived classes should put their subviews. This view will be resized correctly + depending on whether or not a toolbar is displayed. + */ +@property (nonatomic, readonly, retain) UIView *canvasView; + +/*! + @abstract + Provides a wrapper that presents the view controller modally and automatically dismisses it + when either the Done or Cancel button is pressed. + + @param viewController The view controller that is presenting this view controller. + @param animated If YES, presenting and dismissing the view controller is animated. + @param handler The block called when the Done or Cancel button is pressed. + */ +- (void)presentModallyFromViewController:(UIViewController *)viewController + animated:(BOOL)animated + handler:(FBModalCompletionHandler)handler; + +@end + diff --git a/FacebookSDK.framework/Versions/A/Headers/FBWebDialogs.h b/FacebookSDK.framework/Versions/A/Headers/FBWebDialogs.h new file mode 100755 index 0000000..5fdcedd --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FBWebDialogs.h @@ -0,0 +1,236 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@class FBFrictionlessRecipientCache; +@class FBSession; +@protocol FBWebDialogsDelegate; + +/*! + @typedef NS_ENUM (NSUInteger, FBWebDialogResult) + + @abstract + Passed to a handler to indicate the result of a dialog being displayed to the user. + + @discussion Note `FBWebDialogResultDialogCompleted` is also used for cancelled operations. +*/ +typedef NS_ENUM(NSUInteger, FBWebDialogResult) { + /*! Indicates that the dialog action completed successfully. Note, that cancel operations represent completed dialog operations. + The url argument may be used to distinguish between success and user-cancelled cases */ + FBWebDialogResultDialogCompleted = 0, + /*! Indicates that the dialog operation was not completed. This occurs in cases such as the closure of the web-view using the X in the upper left corner. */ + FBWebDialogResultDialogNotCompleted +}; + +/*! + @typedef + + @abstract Defines a handler that will be called in response to the web dialog + being dismissed + */ +typedef void (^FBWebDialogHandler)( + FBWebDialogResult result, + NSURL *resultURL, + NSError *error); + +/*! + @class FBWebDialogs + + @abstract + Provides methods to display web based dialogs to the user. +*/ +@interface FBWebDialogs : NSObject + +/*! + @abstract + Presents a Facebook web dialog (https://developers.facebook.com/docs/reference/dialogs/ ) + such as feed or apprequest. + + @param session Represents the session to use for the dialog. May be nil, which uses + the active session if present, or returns NO, if not. + + @param dialog Represents the dialog or method name, such as @"feed" + + @param parameters A dictionary of parameters to be passed to the dialog + + @param handler An optional handler that will be called when the dialog is dismissed. Note, + that if the method returns NO, the handler is not called. May be nil. + */ ++ (void)presentDialogModallyWithSession:(FBSession *)session + dialog:(NSString *)dialog + parameters:(NSDictionary *)parameters + handler:(FBWebDialogHandler)handler; + +/*! + @abstract + Presents a Facebook web dialog (https://developers.facebook.com/docs/reference/dialogs/ ) + such as feed or apprequest. + + @param session Represents the session to use for the dialog. May be nil, which uses + the active session if present, or returns NO, if not. + + @param dialog Represents the dialog or method name, such as @"feed" + + @param parameters A dictionary of parameters to be passed to the dialog + + @param handler An optional handler that will be called when the dialog is dismissed. Note, + that if the method returns NO, the handler is not called. May be nil. + + @param delegate An optional delegate to allow for advanced processing of web based + dialogs. See 'FBWebDialogsDelegate' for more details. + */ ++ (void)presentDialogModallyWithSession:(FBSession *)session + dialog:(NSString *)dialog + parameters:(NSDictionary *)parameters + handler:(FBWebDialogHandler)handler + delegate:(id)delegate; + +/*! + @abstract + Presents a Facebook apprequest dialog. + + @param session Represents the session to use for the dialog. May be nil, which uses + the active session if present. + + @param message The required message for the dialog. + + @param title An optional title for the dialog. + + @param parameters A dictionary of additional parameters to be passed to the dialog. May be nil + + @param handler An optional handler that will be called when the dialog is dismissed. May be nil. + */ ++ (void)presentRequestsDialogModallyWithSession:(FBSession *)session + message:(NSString *)message + title:(NSString *)title + parameters:(NSDictionary *)parameters + handler:(FBWebDialogHandler)handler; + +/*! + @abstract + Presents a Facebook apprequest dialog. + + @param session Represents the session to use for the dialog. May be nil, which uses + the active session if present. + + @param message The required message for the dialog. + + @param title An optional title for the dialog. + + @param parameters A dictionary of additional parameters to be passed to the dialog. May be nil + + @param handler An optional handler that will be called when the dialog is dismissed. May be nil. + + @param friendCache An optional cache object used to enable frictionless sharing for a known set of friends. The + cache instance should be preserved for the life of the session and reused for multiple calls to the present method. + As the users set of friends enabled for frictionless sharing changes, this method auto-updates the cache. + */ ++ (void)presentRequestsDialogModallyWithSession:(FBSession *)session + message:(NSString *)message + title:(NSString *)title + parameters:(NSDictionary *)parameters + handler:(FBWebDialogHandler)handler + friendCache:(FBFrictionlessRecipientCache *)friendCache; + +/*! + @abstract + Presents a Facebook feed dialog. + + @param session Represents the session to use for the dialog. May be nil, which uses + the active session if present. + + @param parameters A dictionary of additional parameters to be passed to the dialog. May be nil + + @param handler An optional handler that will be called when the dialog is dismissed. May be nil. + */ ++ (void)presentFeedDialogModallyWithSession:(FBSession *)session + parameters:(NSDictionary *)parameters + handler:(FBWebDialogHandler)handler; + +@end + +/*! + @protocol + + @abstract + The `FBWebDialogsDelegate` protocol enables the plugging of advanced behaviors into + the presentation flow of a Facebook web dialog. Advanced uses include modification + of parameters and application-level handling of links on the dialog. The + `FBFrictionlessRequestFriendCache` class implements this protocol to add frictionless + behaviors to a presentation of the request dialog. + */ +@protocol FBWebDialogsDelegate + +@optional + +/*! + @abstract + Called prior to the presentation of a web dialog + + @param dialog A string representing the method or dialog name of the dialog being presented. + + @param parameters A mutable dictionary of parameters which will be sent to the dialog. + + @param session The session object to use with the dialog. + */ +- (void)webDialogsWillPresentDialog:(NSString *)dialog + parameters:(NSMutableDictionary *)parameters + session:(FBSession *)session; + +/*! + @abstract + Called when the user of a dialog clicks a link that would cause a transition away from the application. + Your application may handle this method, and return NO if the URL handling will be performed by the application. + + @param dialog A string representing the method or dialog name of the dialog being presented. + + @param parameters A dictionary of parameters which were sent to the dialog. + + @param session The session object to use with the dialog. + + @param url The url in question, which will not be handled by the SDK if this method NO + */ +- (BOOL)webDialogsDialog:(NSString *)dialog + parameters:(NSDictionary *)parameters + session:(FBSession *)session + shouldAutoHandleURL:(NSURL *)url; + +/*! + @abstract + Called when the dialog is about to be dismissed + + @param dialog A string representing the method or dialog name of the dialog being presented. + + @param parameters A dictionary of parameters which were sent to the dialog. + + @param session The session object to use with the dialog. + + @param result A pointer to a result, which may be read or changed by the handling method as needed + + @param url A pointer to a pointer to a URL representing the URL returned by the dialog, which may be read or changed by this mehthod + + @param error A pointer to a pointer to an error object which may be read or changed by this method as needed + */ +- (void)webDialogsWillDismissDialog:(NSString *)dialog + parameters:(NSDictionary *)parameters + session:(FBSession *)session + result:(FBWebDialogResult *)result + url:(NSURL **)url + error:(NSError **)error; + +@end + diff --git a/FacebookSDK.framework/Versions/A/Headers/FacebookSDK.h b/FacebookSDK.framework/Versions/A/Headers/FacebookSDK.h new file mode 100755 index 0000000..6b7b8cc --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/FacebookSDK.h @@ -0,0 +1,142 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// core +#import "FBAccessTokenData.h" +#import "FBAppCall.h" +#import "FBAppEvents.h" +#import "FBCacheDescriptor.h" +#import "FBDialogs.h" +#import "FBError.h" +#import "FBErrorUtility.h" +#import "FBFrictionlessRecipientCache.h" +#import "FBFriendPickerViewController.h" +#import "FBGraphLocation.h" +#import "FBGraphObject.h" // + design summary for graph component-group +#import "FBGraphPlace.h" +#import "FBGraphUser.h" +#import "FBInsights.h" +#import "FBLikeControl.h" +#import "FBLoginView.h" +#import "FBNativeDialogs.h" // deprecated, use FBDialogs.h +#import "FBOpenGraphAction.h" +#import "FBOpenGraphActionShareDialogParams.h" +#import "FBOpenGraphObject.h" +#import "FBPlacePickerViewController.h" +#import "FBProfilePictureView.h" +#import "FBRequest.h" +#import "FBSession.h" +#import "FBSessionTokenCachingStrategy.h" +#import "FBSettings.h" +#import "FBShareDialogParams.h" +#import "FBShareDialogPhotoParams.h" +#import "FBUserSettingsViewController.h" +#import "FBWebDialogs.h" +#import "NSError+FBError.h" + +/*! + @header + + @abstract Library header, import this to import all of the public types + in the Facebook SDK + + @discussion + +//////////////////////////////////////////////////////////////////////////////// + + + Summary: this header summarizes the structure and goals of the Facebook SDK for iOS. + Goals: + * Leverage and work well with modern features of iOS (e.g. blocks, ARC, etc.) + * Patterned after best of breed iOS frameworks (e.g. naming, pattern-use, etc.) + * Common integration experience is simple & easy to describe + * Factored to enable a growing list of scenarios over time + + Notes on approaches: + 1. We use a key scenario to drive prioritization of work for a given update + 2. We are building-atop and refactoring, rather than replacing, existing iOS SDK releases + 3. We use take an incremental approach where we can choose to maintain as little or as much compatibility with the existing SDK needed + a) and so we will be developing to this approach + b) and then at push-time for a release we will decide when/what to break + on a feature by feature basis + 4. Some light but critical infrastructure is needed to support both the goals + and the execution of this change (e.g. a build/package/deploy process) + + Design points: + We will move to a more object-oriented approach, in order to facilitate the + addition of a different class of objects, such as controls and visual helpers + (e.g. FBLikeView, FBPersonView), as well as sub-frameworks to enable scenarios + such (e.g. FBOpenGraphEntity, FBLocalEntityCache, etc.) + + As we add features, it will no longer be appropriate to host all functionality + in the Facebook class, though it will be maintained for some time for migration + purposes. Instead functionality lives in related collections of classes. + +
+ @textblock
+
+               *------------* *----------*  *----------------* *---*
+  Scenario --> |FBPersonView| |FBLikeView|  | FBPlacePicker  | | F |
+               *------------* *----------*  *----------------* | a |
+               *-------------------*  *----------*  *--------* | c |
+ Component --> |   FBGraphObject   |  | FBDialog |  | FBView | | e |
+               *-------------------*  *----------*  *--------* | b |
+               *---------* *---------* *---------------------* | o |
+      Core --> |FBSession| |FBRequest| |Utilities (e.g. JSON)| | o |
+               *---------* *---------* *---------------------* * k *
+
+ @/textblock
+ 
+ + The figure above describes three layers of functionality, with the existing + Facebook on the side as a helper proxy to a subset of the overall SDK. The + layers loosely organize the SDK into *Core Objects* necessary to interface + with Facebook, higher-level *Framework Components* that feel like natural + extensions to existing frameworks such as UIKit and Foundation, but which + surface behavior broadly applicable to Facebook, and finally the + *Scenario Objects*, which provide deeper turn-key capibilities for useful + mobile scenarios. + + Use example (low barrier use case): + +
+ @textblock
+
+// log on to Facebook
+[FBSession sessionOpenWithPermissions:nil
+                    completionHandler:^(FBSession *session,
+                                        FBSessionState status,
+                                        NSError *error) {
+                        if (session.isOpen) {
+                            // request basic information for the user
+                            [FBRequestConnection startWithGraphPath:@"me"
+                                                  completionHandler:^void(FBRequestConnection *request,
+                                                                          id result,
+                                                                          NSError *error) {
+                                                      if (!error) {
+                                                          // get json from result
+                                                      }
+                                                  }];
+                        }
+                    }];
+ @/textblock
+ 
+ + */ + +#define FB_IOS_SDK_VERSION_STRING @"3.14.0" +#define FB_IOS_SDK_TARGET_PLATFORM_VERSION @"v2.0" + diff --git a/FacebookSDK.framework/Versions/A/Headers/NSError+FBError.h b/FacebookSDK.framework/Versions/A/Headers/NSError+FBError.h new file mode 100755 index 0000000..61659a5 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Headers/NSError+FBError.h @@ -0,0 +1,59 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FBError.h" + +/*! + @category NSError(FBError) + + @abstract + Adds additional properties to NSError to provide more information for Facebook related errors. + */ +@interface NSError (FBError) + +/*! + @abstract + Categorizes the error, if it is Facebook related, to simplify application mitigation behavior + + @discussion + In general, in response to an error connecting to Facebook, an application should, retry the + operation, request permissions, reconnect the application, or prompt the user to take an action. + The error category can be used to understand the class of error received from Facebook. For more infomation on this + see https://developers.facebook.com/docs/reference/api/errors/ + */ +@property (readonly) FBErrorCategory fberrorCategory; + +/*! + @abstract + If YES indicates that a user action is required in order to successfully continue with the facebook operation + + @discussion + In general if fberrorShouldNotifyUser is NO, then the application has a straightforward mitigation, such as + retry the operation or request permissions from the user, etc. In some cases it is necessary for the user to + take an action before the application continues to attempt a Facebook connection. For more infomation on this + see https://developers.facebook.com/docs/reference/api/errors/ + */ +@property (readonly) BOOL fberrorShouldNotifyUser; + +/*! + @abstract + A message suitable for display to the user, describing a user action necessary to enable Facebook functionality. + Not all Facebook errors yield a message suitable for user display; however in all cases where + fberrorShouldNotifyUser is YES, this property returns a localizable message suitable for display. + */ +@property (readonly, copy) NSString *fberrorUserMessage; + +@end diff --git a/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/Contents/Resources/en.lproj/Localizable.strings b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/Contents/Resources/en.lproj/Localizable.strings new file mode 100755 index 0000000..7fd7575 Binary files /dev/null and b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/Contents/Resources/en.lproj/Localizable.strings differ diff --git a/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/Contents/Resources/he.lproj/Localizable.strings b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/Contents/Resources/he.lproj/Localizable.strings new file mode 100755 index 0000000..bb3ba24 Binary files /dev/null and b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/Contents/Resources/he.lproj/Localizable.strings differ diff --git a/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/facebook-logo.png b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/facebook-logo.png new file mode 100755 index 0000000..be1dccd Binary files /dev/null and b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/facebook-logo.png differ diff --git a/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/facebook-logo@2x.png b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/facebook-logo@2x.png new file mode 100755 index 0000000..4b03929 Binary files /dev/null and b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/facebook-logo@2x.png differ diff --git a/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadLandscape.jpg b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadLandscape.jpg new file mode 100755 index 0000000..f056b80 Binary files /dev/null and b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadLandscape.jpg differ diff --git a/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadLandscape@2x.jpg b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadLandscape@2x.jpg new file mode 100755 index 0000000..abde7eb Binary files /dev/null and b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadLandscape@2x.jpg differ diff --git a/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadPortrait.jpg b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadPortrait.jpg new file mode 100755 index 0000000..2c16bd4 Binary files /dev/null and b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadPortrait.jpg differ diff --git a/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadPortrait@2x.jpg b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadPortrait@2x.jpg new file mode 100755 index 0000000..ae3e2bd Binary files /dev/null and b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadPortrait@2x.jpg differ diff --git a/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPhonePortrait.jpg b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPhonePortrait.jpg new file mode 100755 index 0000000..f4d31c5 Binary files /dev/null and b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPhonePortrait.jpg differ diff --git a/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPhonePortrait@2x.jpg b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPhonePortrait@2x.jpg new file mode 100755 index 0000000..8eba2f1 Binary files /dev/null and b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPhonePortrait@2x.jpg differ diff --git a/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-normal.png b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-normal.png new file mode 100755 index 0000000..892419f Binary files /dev/null and b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-normal.png differ diff --git a/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-normal@2x.png b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-normal@2x.png new file mode 100755 index 0000000..daa4ba6 Binary files /dev/null and b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-normal@2x.png differ diff --git a/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-pressed.png b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-pressed.png new file mode 100755 index 0000000..3f862c8 Binary files /dev/null and b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-pressed.png differ diff --git a/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-pressed@2x.png b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-pressed@2x.png new file mode 100755 index 0000000..7866e3d Binary files /dev/null and b/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-pressed@2x.png differ diff --git a/FacebookSDK.framework/Versions/A/Resources/FacebookSDKResources.bundle.README b/FacebookSDK.framework/Versions/A/Resources/FacebookSDKResources.bundle.README new file mode 100755 index 0000000..3ae35b4 --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Resources/FacebookSDKResources.bundle.README @@ -0,0 +1,44 @@ +The FacebookSDKResources.bundle is no longer required in order to use the SDK. You may provide a bundle in cases where you need to override strings or images (e.g. internationalization, etc.) See https://developers.facebook.com/docs/reference/ios/current/constants/FBSettings#resourceBundleName for more information. + +The following is a list of keys for string localization: + +/* FBLoginView (aka FBLV) */ +"FBLV:LogOutButton" = "Log Out"; +"FBLV:LogInButton" = "Log In"; +"FBLV:LoggedInAs" = "Logged in as: %@"; +"FBLV:LoggedInUsingFacebook" = "Logged in using Facebook"; +"FBLV:LogOutAction" = "Log Out"; +"FBLV:CancelAction" = "Cancel"; + +/* FBPlacePickerViewController (FBPPVC) */ +"FBPPVC:NumWereHere" = "%@ were here"; + +/* FBError (aka FBE) */ +"FBE:ReconnectApplication" = "Please log into this app again to reconnect your Facebook account."; +"FBE:PasswordChangedDevice" = "Your Facebook password has changed. To confirm your password, open Settings > Facebook and tap your name."; +"FBE:PasswordChanged" = "Your Facebook password has changed. Please log into this app again to reconnect your Facebook account."; +"FBE:WebLogIn" = "Your Facebook account is locked. Please log into www.facebook.com to continue."; +"FBE:AppNotInstalled" = "Please log into this app again to reconnect your Facebook account."; +"FBE:GrantPermission" = "This app doesn’t have permission to do this. To change permissions, try logging into the app again."; +"FBE:Unconfirmed" = "Your Facebook account is locked. Please log into www.facebook.com to continue."; +"FBE:OAuthDevice" = "To use your Facebook account with this app, open Settings > Facebook and make sure this app is turned on."; +"FBE:DeviceError"= "Something went wrong. Please make sure you're connected to the internet and try again."; +"FBE:AlertMessageButton" = "OK"; + +Images should be placed in a directory called FacebookSDKImages in the bundle. Note that images will support @2x and -568h@2x. + +The following is a list of images supported: + +FacebookSDKImages\ + + FBDialogClose.png + + FBFriendPickerViewDefault.png + + FBLoginViewLoginButtonSmall.png + FBLoginViewLoginButtonSmallPressed.png + + FBPlacePickerViewGenericPlace.png + + FBProfilePictureViewBlankProfileSquare.png + FBProfilePictureViewBlankProfilePortrait.png diff --git a/FacebookSDK.framework/Versions/A/Resources/Info.plist b/FacebookSDK.framework/Versions/A/Resources/Info.plist new file mode 100755 index 0000000..0dd599a --- /dev/null +++ b/FacebookSDK.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,20 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + FacebookSDK + CFBundleIdentifier + com.facebook.sdk + CFBundleInfoDictionaryVersion + 1.0 + CFBundlePackageType + FMWK + CFBundleSignature + ???? + CFBundleVersion + 1.0 + + diff --git a/FacebookSDK.framework/Versions/Current b/FacebookSDK.framework/Versions/Current new file mode 120000 index 0000000..044dcb9 --- /dev/null +++ b/FacebookSDK.framework/Versions/Current @@ -0,0 +1 @@ +./A \ No newline at end of file diff --git a/GPUImage.framework/Versions/A/GPUImage b/GPUImage.framework/Versions/A/GPUImage old mode 100644 new mode 100755 diff --git a/LoginVideo.xcodeproj/project.pbxproj b/LoginVideo.xcodeproj/project.pbxproj index 81c99e5..a85aeda 100644 --- a/LoginVideo.xcodeproj/project.pbxproj +++ b/LoginVideo.xcodeproj/project.pbxproj @@ -7,6 +7,17 @@ objects = { /* Begin PBXBuildFile section */ + 3D13FE68193BB8A100C07162 /* TWAPIManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D13FE58193BB8A100C07162 /* TWAPIManager.m */; }; + 3D13FE69193BB8A100C07162 /* TWAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D13FE5A193BB8A100C07162 /* TWAppDelegate.m */; }; + 3D13FE6A193BB8A100C07162 /* TWSignedRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D13FE5C193BB8A100C07162 /* TWSignedRequest.m */; settings = {COMPILER_FLAGS = "-D'TWITTER_CONSUMER_KEY=@\"$(TWITTER_CONSUMER_KEY)\"' -D'TWITTER_CONSUMER_SECRET=@\"$(TWITTER_CONSUMER_SECRET)\"'"; }; }; + 3D13FE6B193BB8A100C07162 /* TWViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D13FE5E193BB8A100C07162 /* TWViewController.m */; }; + 3D13FE6C193BB8A100C07162 /* TWViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3D13FE5F193BB8A100C07162 /* TWViewController.xib */; }; + 3D13FE6D193BB8A100C07162 /* NSData+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D13FE63193BB8A100C07162 /* NSData+Base64.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 3D13FE6E193BB8A100C07162 /* OAuth+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D13FE65193BB8A100C07162 /* OAuth+Additions.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 3D13FE6F193BB8A100C07162 /* OAuthCore.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D13FE67193BB8A100C07162 /* OAuthCore.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 3D13FE71193BB9A300C07162 /* Twitter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D13FE70193BB9A300C07162 /* Twitter.framework */; }; + 3D13FE73193BB9A800C07162 /* Accounts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D13FE72193BB9A800C07162 /* Accounts.framework */; }; + 3D13FE75193BB9C600C07162 /* FacebookSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D13FE74193BB9C600C07162 /* FacebookSDK.framework */; }; D259235318ECA2A900747F53 /* timeLapseMini.m4v in Resources */ = {isa = PBXBuildFile; fileRef = D259235218ECA29700747F53 /* timeLapseMini.m4v */; }; D259235818ECA4D900747F53 /* logoclubby.png in Resources */ = {isa = PBXBuildFile; fileRef = D259235618ECA4D900747F53 /* logoclubby.png */; }; D259235918ECA4D900747F53 /* logoclubby@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D259235718ECA4D900747F53 /* logoclubby@2x.png */; }; @@ -45,6 +56,24 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 3D13FE57193BB8A100C07162 /* TWAPIManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TWAPIManager.h; sourceTree = ""; }; + 3D13FE58193BB8A100C07162 /* TWAPIManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TWAPIManager.m; sourceTree = ""; }; + 3D13FE59193BB8A100C07162 /* TWAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TWAppDelegate.h; sourceTree = ""; }; + 3D13FE5A193BB8A100C07162 /* TWAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TWAppDelegate.m; sourceTree = ""; }; + 3D13FE5B193BB8A100C07162 /* TWSignedRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TWSignedRequest.h; sourceTree = ""; }; + 3D13FE5C193BB8A100C07162 /* TWSignedRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TWSignedRequest.m; sourceTree = ""; }; + 3D13FE5D193BB8A100C07162 /* TWViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TWViewController.h; sourceTree = ""; }; + 3D13FE5E193BB8A100C07162 /* TWViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TWViewController.m; sourceTree = ""; }; + 3D13FE5F193BB8A100C07162 /* TWViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TWViewController.xib; sourceTree = ""; }; + 3D13FE62193BB8A100C07162 /* NSData+Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+Base64.h"; sourceTree = ""; }; + 3D13FE63193BB8A100C07162 /* NSData+Base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+Base64.m"; sourceTree = ""; }; + 3D13FE64193BB8A100C07162 /* OAuth+Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OAuth+Additions.h"; sourceTree = ""; }; + 3D13FE65193BB8A100C07162 /* OAuth+Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "OAuth+Additions.m"; sourceTree = ""; }; + 3D13FE66193BB8A100C07162 /* OAuthCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAuthCore.h; sourceTree = ""; }; + 3D13FE67193BB8A100C07162 /* OAuthCore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OAuthCore.m; sourceTree = ""; }; + 3D13FE70193BB9A300C07162 /* Twitter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Twitter.framework; path = System/Library/Frameworks/Twitter.framework; sourceTree = SDKROOT; }; + 3D13FE72193BB9A800C07162 /* Accounts.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accounts.framework; path = System/Library/Frameworks/Accounts.framework; sourceTree = SDKROOT; }; + 3D13FE74193BB9C600C07162 /* FacebookSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = FacebookSDK.framework; sourceTree = ""; }; D259235218ECA29700747F53 /* timeLapseMini.m4v */ = {isa = PBXFileReference; lastKnownFileType = file; path = timeLapseMini.m4v; sourceTree = ""; }; D259235618ECA4D900747F53 /* logoclubby.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logoclubby.png; sourceTree = ""; }; D259235718ECA4D900747F53 /* logoclubby@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "logoclubby@2x.png"; sourceTree = ""; }; @@ -83,6 +112,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 3D13FE75193BB9C600C07162 /* FacebookSDK.framework in Frameworks */, + 3D13FE73193BB9A800C07162 /* Accounts.framework in Frameworks */, + 3D13FE71193BB9A300C07162 /* Twitter.framework in Frameworks */, D296299A18EC66E30091800B /* AVFoundation.framework in Frameworks */, D2EF9AF518F7132700F176E6 /* GPUImage.framework in Frameworks */, D296296718EC64C90091800B /* CoreGraphics.framework in Frameworks */, @@ -104,6 +136,52 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 3D13FE55193BB8A100C07162 /* Twitter */ = { + isa = PBXGroup; + children = ( + 3D13FE56193BB8A100C07162 /* Classes */, + 3D13FE60193BB8A100C07162 /* Vendor */, + ); + path = Twitter; + sourceTree = ""; + }; + 3D13FE56193BB8A100C07162 /* Classes */ = { + isa = PBXGroup; + children = ( + 3D13FE57193BB8A100C07162 /* TWAPIManager.h */, + 3D13FE58193BB8A100C07162 /* TWAPIManager.m */, + 3D13FE59193BB8A100C07162 /* TWAppDelegate.h */, + 3D13FE5A193BB8A100C07162 /* TWAppDelegate.m */, + 3D13FE5B193BB8A100C07162 /* TWSignedRequest.h */, + 3D13FE5C193BB8A100C07162 /* TWSignedRequest.m */, + 3D13FE5D193BB8A100C07162 /* TWViewController.h */, + 3D13FE5E193BB8A100C07162 /* TWViewController.m */, + 3D13FE5F193BB8A100C07162 /* TWViewController.xib */, + ); + path = Classes; + sourceTree = ""; + }; + 3D13FE60193BB8A100C07162 /* Vendor */ = { + isa = PBXGroup; + children = ( + 3D13FE61193BB8A100C07162 /* ABOAuthCore */, + ); + path = Vendor; + sourceTree = ""; + }; + 3D13FE61193BB8A100C07162 /* ABOAuthCore */ = { + isa = PBXGroup; + children = ( + 3D13FE62193BB8A100C07162 /* NSData+Base64.h */, + 3D13FE63193BB8A100C07162 /* NSData+Base64.m */, + 3D13FE64193BB8A100C07162 /* OAuth+Additions.h */, + 3D13FE65193BB8A100C07162 /* OAuth+Additions.m */, + 3D13FE66193BB8A100C07162 /* OAuthCore.h */, + 3D13FE67193BB8A100C07162 /* OAuthCore.m */, + ); + path = ABOAuthCore; + sourceTree = ""; + }; D259236418EDAC6400747F53 /* Assets */ = { isa = PBXGroup; children = ( @@ -116,6 +194,7 @@ D296295818EC64C90091800B = { isa = PBXGroup; children = ( + 3D13FE55193BB8A100C07162 /* Twitter */, D296296A18EC64C90091800B /* LoginVideo */, D296298918EC64CA0091800B /* LoginVideoTests */, D296296318EC64C90091800B /* Frameworks */, @@ -135,6 +214,9 @@ D296296318EC64C90091800B /* Frameworks */ = { isa = PBXGroup; children = ( + 3D13FE74193BB9C600C07162 /* FacebookSDK.framework */, + 3D13FE72193BB9A800C07162 /* Accounts.framework */, + 3D13FE70193BB9A300C07162 /* Twitter.framework */, D2EF9AF418F7132700F176E6 /* GPUImage.framework */, D296299918EC66E30091800B /* AVFoundation.framework */, D296296418EC64C90091800B /* Foundation.framework */, @@ -292,6 +374,7 @@ D259235318ECA2A900747F53 /* timeLapseMini.m4v in Resources */, D259235F18ECA9D100747F53 /* lock@2x.png in Resources */, D259236018ECA9D100747F53 /* user.png in Resources */, + 3D13FE6C193BB8A100C07162 /* TWViewController.xib in Resources */, D296297D18EC64C90091800B /* Images.xcassets in Resources */, D296296F18EC64C90091800B /* InfoPlist.strings in Resources */, D296297818EC64C90091800B /* Main.storyboard in Resources */, @@ -321,7 +404,14 @@ D296297B18EC64C90091800B /* AMLoginViewController.m in Sources */, D296297518EC64C90091800B /* AppDelegate.m in Sources */, D25976B518EC7E400085479D /* BlurView.m in Sources */, + 3D13FE6F193BB8A100C07162 /* OAuthCore.m in Sources */, + 3D13FE6E193BB8A100C07162 /* OAuth+Additions.m in Sources */, + 3D13FE69193BB8A100C07162 /* TWAppDelegate.m in Sources */, + 3D13FE6A193BB8A100C07162 /* TWSignedRequest.m in Sources */, D296297118EC64C90091800B /* main.m in Sources */, + 3D13FE68193BB8A100C07162 /* TWAPIManager.m in Sources */, + 3D13FE6B193BB8A100C07162 /* TWViewController.m in Sources */, + 3D13FE6D193BB8A100C07162 /* NSData+Base64.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -451,6 +541,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(SRCROOT)", + "$(PROJECT_DIR)", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "LoginVideo/LoginVideo-Prefix.pch"; @@ -468,6 +559,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(SRCROOT)", + "$(PROJECT_DIR)", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "LoginVideo/LoginVideo-Prefix.pch"; diff --git a/LoginVideo.xcodeproj/project.xcworkspace/xcshareddata/LoginVideo.xccheckout b/LoginVideo.xcodeproj/project.xcworkspace/xcshareddata/LoginVideo.xccheckout index 37405ab..30c980a 100644 --- a/LoginVideo.xcodeproj/project.xcworkspace/xcshareddata/LoginVideo.xccheckout +++ b/LoginVideo.xcodeproj/project.xcworkspace/xcshareddata/LoginVideo.xccheckout @@ -5,34 +5,34 @@ IDESourceControlProjectFavoriteDictionaryKey IDESourceControlProjectIdentifier - 1FCCF9E3-016E-4B52-8032-6398A0934182 + EB06A973-A20D-4554-91B3-AA755CA49912 IDESourceControlProjectName LoginVideo IDESourceControlProjectOriginsDictionary - D021121F-CB25-4240-8462-60A0849BFAAD - https://github.com/mtonio91/AMLoginViewController.git + 116A54C4-4536-4452-B2E2-C09B9EE42E70 + https://github.com/dimohamdy/AMLoginViewController.git IDESourceControlProjectPath LoginVideo.xcodeproj/project.xcworkspace IDESourceControlProjectRelativeInstallPathDictionary - D021121F-CB25-4240-8462-60A0849BFAAD + 116A54C4-4536-4452-B2E2-C09B9EE42E70 ../.. IDESourceControlProjectURL - https://github.com/mtonio91/AMLoginViewController.git + https://github.com/dimohamdy/AMLoginViewController.git IDESourceControlProjectVersion 110 IDESourceControlProjectWCCIdentifier - D021121F-CB25-4240-8462-60A0849BFAAD + 116A54C4-4536-4452-B2E2-C09B9EE42E70 IDESourceControlProjectWCConfigurations IDESourceControlRepositoryExtensionIdentifierKey public.vcs.git IDESourceControlWCCIdentifierKey - D021121F-CB25-4240-8462-60A0849BFAAD + 116A54C4-4536-4452-B2E2-C09B9EE42E70 IDESourceControlWCCName AMLoginViewController diff --git a/LoginVideo.xcodeproj/project.xcworkspace/xcuserdata/binaryboy.xcuserdatad/UserInterfaceState.xcuserstate b/LoginVideo.xcodeproj/project.xcworkspace/xcuserdata/binaryboy.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..bc98068 Binary files /dev/null and b/LoginVideo.xcodeproj/project.xcworkspace/xcuserdata/binaryboy.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/LoginVideo.xcodeproj/xcuserdata/binaryboy.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/LoginVideo.xcodeproj/xcuserdata/binaryboy.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..114c90d --- /dev/null +++ b/LoginVideo.xcodeproj/xcuserdata/binaryboy.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LoginVideo.xcodeproj/xcuserdata/binaryboy.xcuserdatad/xcschemes/LoginVideo.xcscheme b/LoginVideo.xcodeproj/xcuserdata/binaryboy.xcuserdatad/xcschemes/LoginVideo.xcscheme new file mode 100644 index 0000000..2f7b02a --- /dev/null +++ b/LoginVideo.xcodeproj/xcuserdata/binaryboy.xcuserdatad/xcschemes/LoginVideo.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LoginVideo.xcodeproj/xcuserdata/binaryboy.xcuserdatad/xcschemes/xcschememanagement.plist b/LoginVideo.xcodeproj/xcuserdata/binaryboy.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..6614977 --- /dev/null +++ b/LoginVideo.xcodeproj/xcuserdata/binaryboy.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + LoginVideo.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + D296296018EC64C90091800B + + primary + + + D296298118EC64C90091800B + + primary + + + + + diff --git a/LoginVideo/AMLoginViewController.h b/LoginVideo/AMLoginViewController.h index c92a684..4fa82c8 100644 --- a/LoginVideo/AMLoginViewController.h +++ b/LoginVideo/AMLoginViewController.h @@ -11,11 +11,15 @@ #import #import "BlurView.h" +#import -@interface AMLoginViewController : UIViewController +@interface AMLoginViewController : UIViewController @property (strong, nonatomic) BlurView *usernameView; @property (strong, nonatomic) BlurView *passwordView; @property (strong, nonatomic) UIView *sendButtonView; +@property (strong, nonatomic) UIView *loginWithFBView; +@property (strong, nonatomic) UIView *loginWithTWTView; + @end diff --git a/LoginVideo/AMLoginViewController.m b/LoginVideo/AMLoginViewController.m index 7bfda73..033ffd2 100644 --- a/LoginVideo/AMLoginViewController.m +++ b/LoginVideo/AMLoginViewController.m @@ -8,7 +8,22 @@ #import "AMLoginViewController.h" +@import Accounts; +#import "OAuth+Additions.h" +#import "TWAPIManager.h" +#import "TWSignedRequest.h" +#import +#import + +#define ERROR_TITLE_MSG @"Whoa, there cowboy" +#define ERROR_NO_ACCOUNTS @"You must add a Twitter account in Settings.app to use this demo." +#define ERROR_PERM_ACCESS @"We weren't granted access to the user's accounts" +#define ERROR_NO_KEYS @"You need to add your Twitter app keys to Info.plist to use this demo.\nPlease see README.md for more info." +#define ERROR_OK @"OK" + +#define ONE_FOURTH_OF(_X) floorf(0.25f * _X) +#define THREE_FOURTHS_OF(_X) floorf(3 * ONE_FOURTH_OF(_X)) @interface AMLoginViewController () { @@ -20,49 +35,61 @@ @interface AMLoginViewController () GPUImageiOSBlurFilter *_blurFilter; GPUImageBuffer *_videoBuffer; GPUImageMovie *_liveVideo; - + UITextField * usernameTf; UITextField * passwordTf; + } - +@property (nonatomic, strong) ACAccountStore *accountStore; +@property (nonatomic, strong) TWAPIManager *apiManager; +@property (nonatomic, strong) NSArray *accounts; +@property (nonatomic, strong) UIButton *reverseAuthBtn; @end @implementation AMLoginViewController - +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nil bundle:nil]; + if (self) { + + } + return self; +} - (void)viewDidLoad { [super viewDidLoad]; - - [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade]; + _accountStore = [[ACAccountStore alloc] init]; + _apiManager = [[TWAPIManager alloc] init]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_refreshTwitterAccounts) name:ACAccountStoreDidChangeNotification object:nil]; + [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade]; + // ---------------------------AVPLAYER STUFF ------------------------------- - + NSString * ressource = [[NSBundle mainBundle] pathForResource:@"demoVideo" ofType:@".mp4"]; - + NSURL * urlPathOfVideo = [NSURL fileURLWithPath:ressource]; avPlayer = [AVPlayer playerWithURL:urlPathOfVideo]; avPlayer.actionAtItemEnd = AVPlayerActionAtItemEndNone; - + avPlayerLayer = [AVPlayerLayer playerLayerWithPlayer:avPlayer]; avPlayerLayer.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height); - [self.view.layer addSublayer: avPlayerLayer]; - [avPlayer play]; time = kCMTimeZero; //prevent music coming from other app to be stopped [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil]; - + // ------------------------------------------------------------------------- - + //AVPlayer Notifications - + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playerItemDidReachEnd:) name:AVPlayerItemDidPlayToEndTimeNotification @@ -92,7 +119,7 @@ - (void)viewDidLoad [_videoBuffer setBufferSize:1]; // --------------------------------------------------------------------- - + [self setViewItems]; @@ -104,8 +131,8 @@ - (void)viewDidLoad //start processing BLUR with background video [self procesBlurWithBackgroundVideoOnView:_usernameView]; [self procesBlurWithBackgroundVideoOnView:_passwordView]; - - + + } #pragma mark - AVPlayer methods @@ -136,13 +163,13 @@ - (void)playerItemDidReachEnd:(NSNotification *)notification - (void) procesBlurWithBackgroundVideoOnView:(BlurView*)view { - - _liveVideo = [[GPUImageMovie alloc] initWithPlayerItem:avPlayer.currentItem]; - - [_liveVideo addTarget:_videoBuffer]; - [_videoBuffer addTarget:_blurFilter]; - [_blurFilter addTarget:view]; - [_liveVideo startProcessing]; + + // _liveVideo = [[GPUImageMovie alloc] initWithPlayerItem:avPlayer.currentItem]; + // + // [_liveVideo addTarget:_videoBuffer]; + // [_videoBuffer addTarget:_blurFilter]; + // [_blurFilter addTarget:view]; + // [_liveVideo startProcessing]; } @@ -157,8 +184,17 @@ - (void) setViewItems _passwordView = [[BlurView alloc] initWithFrame:CGRectMake(35, 300, 250, 50)]; - _sendButtonView = [[UIView alloc] initWithFrame:CGRectMake(35, 370, 250, 50)]; + _sendButtonView = [[UIView alloc] initWithFrame:CGRectMake(35, 370, 250, 50)]; + _loginWithTWTView = [[UIView alloc] initWithFrame:CGRectMake(35, 430, 250, 50)]; + _loginWithFBView = [[UIView alloc] initWithFrame:CGRectMake(35, 490, 250, 50)]; + + + + _sendButtonView.backgroundColor = [UIColor colorWithRed:0.925 green:0.941 blue:0.945 alpha:0.7]; + _loginWithTWTView.backgroundColor = [UIColor colorWithRed:0.925 green:0.941 blue:0.945 alpha:0.7]; + //_loginWithFBView.backgroundColor = [UIColor colorWithRed:0.925 green:0.941 blue:0.945 alpha:0.7]; + //BUTTON UIButton * sendButton = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, _sendButtonView.frame.size.width, _sendButtonView.frame.size.height)]; @@ -167,6 +203,46 @@ - (void) setViewItems [_sendButtonView addSubview:sendButton]; + + //BUTTON Twitter + UIButton * twtButton = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, _loginWithTWTView.frame.size.width, _loginWithTWTView.frame.size.height)]; + [twtButton setTitle:@"LOGIN With Twitter" forState:UIControlStateNormal]; + [twtButton setTitleColor:[UIColor colorWithRed:0.173 green:0.243 blue:0.314 alpha:1] forState:UIControlStateNormal]; + + + + [_loginWithTWTView addSubview:twtButton]; + [twtButton addTarget:self action:@selector(auth) forControlEvents:UIControlEventTouchUpInside]; + + + //BUTTON Facebook + // UIButton * fbButton = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, _loginWithFBView.frame.size.width, _loginWithFBView.frame.size.height)]; + // [fbButton setTitle:@"LOGIN With FaceBook" forState:UIControlStateNormal]; + // [fbButton setTitleColor:[UIColor colorWithRed:0.173 green:0.243 blue:0.314 alpha:1] forState:UIControlStateNormal]; + // + // [_loginWithFBView addSubview:fbButton]; + // [fbButton addTarget:self action:@selector(yourMethod:) forControlEvents:UIControlEventTouchUpInside]; + + + // Create a FBLoginView to log the user in with basic, email and friend list permissions + // You should ALWAYS ask for basic permissions (public_profile) when logging the user in + FBLoginView *loginView = [[FBLoginView alloc] initWithReadPermissions:@[@"public_profile", @"email", @"user_friends"]]; + + // Set this loginUIViewController to be the loginView button's delegate + loginView.delegate = self; + + // Align the button in the center horizontally + loginView.frame = CGRectMake(0, 0, _loginWithFBView.frame.size.width, _loginWithFBView.frame.size.height); + + // Align the button in the center vertically + //loginView.center = self.view.center; + + // Add the button to the view + [_loginWithFBView addSubview:loginView]; + + + + //USERNAME Text Field UIImageView * userImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 61, 50)]; [userImage setImage:[UIImage imageNamed:@"user.png"]]; @@ -193,8 +269,15 @@ - (void) setViewItems [self.view addSubview:_usernameView]; [self.view addSubview:_passwordView]; + + [self.view addSubview:_loginWithTWTView]; + [self.view addSubview:_loginWithFBView]; [self.view addSubview:_sendButtonView]; - + + + + + } @@ -216,5 +299,204 @@ - (void)didReceiveMemoryWarning [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } +/**************************************/ +// This method will be called when the user information has been fetched +- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView + user:(id)user { + // self.profilePictureView.profileID = user.id; + // self.nameLabel.text = user.name; +} + +// Implement the loginViewShowingLoggedInUser: delegate method to modify your app's UI for a logged-in user experience +- (void)loginViewShowingLoggedInUser:(FBLoginView *)loginView { + // self.statusLabel.text = @"You're logged in as"; +} + +// Implement the loginViewShowingLoggedOutUser: delegate method to modify your app's UI for a logged-out user experience +- (void)loginViewShowingLoggedOutUser:(FBLoginView *)loginView { + // self.profilePictureView.profileID = nil; + // self.nameLabel.text = @""; + // self.statusLabel.text= @"You're not logged in!"; +} + +// You need to override loginView:handleError in order to handle possible errors that can occur during login +- (void)loginView:(FBLoginView *)loginView handleError:(NSError *)error { + NSString *alertMessage, *alertTitle; + + // If the user should perform an action outside of you app to recover, + // the SDK will provide a message for the user, you just need to surface it. + // This conveniently handles cases like Facebook password change or unverified Facebook accounts. + if ([FBErrorUtility shouldNotifyUserForError:error]) { + alertTitle = @"Facebook error"; + alertMessage = [FBErrorUtility userMessageForError:error]; + + // This code will handle session closures since that happen outside of the app. + // You can take a look at our error handling guide to know more about it + // https://developers.facebook.com/docs/ios/errors + } else if ([FBErrorUtility errorCategoryForError:error] == FBErrorCategoryAuthenticationReopenSession) { + alertTitle = @"Session Error"; + alertMessage = @"Your current session is no longer valid. Please log in again."; + + // If the user has cancelled a login, we will do nothing. + // You can also choose to show the user a message if cancelling login will result in + // the user not being able to complete a task they had initiated in your app + // (like accessing FB-stored information or posting to Facebook) + } else if ([FBErrorUtility errorCategoryForError:error] == FBErrorCategoryUserCancelled) { + NSLog(@"user cancelled login"); + + // For simplicity, this sample handles other errors with a generic message + // You can checkout our error handling guide for more detailed information + // https://developers.facebook.com/docs/ios/errors + } else { + alertTitle = @"Something went wrong"; + alertMessage = @"Please try again later."; + NSLog(@"Unexpected error:%@", error); + } + + if (alertMessage) { + [[[UIAlertView alloc] initWithTitle:alertTitle + message:alertMessage + delegate:nil + cancelButtonTitle:@"OK" + otherButtonTitles:nil] show]; + } +} +/*********************************************/ +#pragma mark - UIActionSheetDelegate + +- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex +{ + if (buttonIndex != actionSheet.cancelButtonIndex) { + [_apiManager performReverseAuthForAccount:_accounts[buttonIndex] withHandler:^(NSData *responseData, NSError *error) { + if (responseData) { + NSString *responseStr = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]; + + //TWDLog(@"Reverse Auth process returned: %@", responseStr); + + NSArray *parts = [responseStr componentsSeparatedByString:@"&"]; + NSString *lined = [parts componentsJoinedByString:@"\n"]; + + dispatch_async(dispatch_get_main_queue(), ^{ + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Success!" message:lined delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; + [alert show]; + }); + } + else { + //TWALog(@"Reverse Auth process failed. Error returned was: %@\n", [error localizedDescription]); + } + }]; + } +} + +#pragma mark - Private +- (void)_displayAlertWithMessage:(NSString *)message +{ + // UIAlertView *alert = [[UIAlertView alloc] initWithTitle:ERROR_TITLE_MSG message:message delegate:nil cancelButtonTitle:ERROR_OK otherButtonTitles:nil]; + // [alert show]; + SLComposeViewController *tweetSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter]; + tweetSheet.view.hidden=YES; + + + [self presentViewController:tweetSheet animated:NO completion:nil]; + [tweetSheet resignFirstResponder]; + [tweetSheet.view resignFirstResponder]; + + //tweetSheet.editing=NO; + [tweetSheet.view endEditing:YES]; + + + //[tweetSheet setInitialText:@"this is a test"]; + + + + + +} + +/** + * Checks for the current Twitter configuration on the device / simulator. + * + * First, we check to make sure that we've got keys to work with inside Info.plist (see README) + * + * Then we check to see if the device has accounts available via +[TWAPIManager isLocalTwitterAccountAvailable]. + * + * Next, we ask the user for permission to access his/her accounts. + * + * Upon completion, the button to continue will be displayed, or the user will be presented with a status message. + */ +- (void)_refreshTwitterAccounts +{ + //TWDLog(@"Refreshing Twitter Accounts \n"); + + if (![TWAPIManager hasAppKeys]) { + [self _displayAlertWithMessage:ERROR_NO_KEYS]; + } + else if (![TWAPIManager isLocalTwitterAccountAvailable]) { + [self _displayAlertWithMessage:ERROR_NO_ACCOUNTS]; + } + else { + [self _obtainAccessToAccountsWithBlock:^(BOOL granted) { + dispatch_async(dispatch_get_main_queue(), ^{ + if (granted) { + _reverseAuthBtn.enabled = YES; + } + else { + [self _displayAlertWithMessage:ERROR_PERM_ACCESS]; + //TWALog(@"You were not granted access to the Twitter accounts."); + } + }); + }]; + } +} + +- (void)_obtainAccessToAccountsWithBlock:(void (^)(BOOL))block +{ + ACAccountType *twitterType = [_accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter]; + ACAccountStoreRequestAccessCompletionHandler handler = ^(BOOL granted, NSError *error) { + if (granted) { + self.accounts = [_accountStore accountsWithAccountType:twitterType]; + } + + block(granted); + }; + [_accountStore requestAccessToAccountsWithType:twitterType options:NULL completion:handler]; +} + +/** + * Handles the button press that initiates the token exchange. + * + * We check the current configuration inside -[UIViewController viewDidAppear]. + */ +- (void)performReverseAuth:(id)sender +{ + UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"Choose an Account" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil]; + for (ACAccount *acct in _accounts) { + [sheet addButtonWithTitle:acct.username]; + } + sheet.cancelButtonIndex = [sheet addButtonWithTitle:@"Cancel"]; + [sheet showInView:self.view]; +} + +- (void)auth { + UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"Choose an Account" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil]; + if (_accounts !=nil) { + for (ACAccount *acct in _accounts) { + [sheet addButtonWithTitle:acct.username]; + } + sheet.cancelButtonIndex = [sheet addButtonWithTitle:@"Cancel"]; + [sheet showInView:self.view]; + } + + + + [self _displayAlertWithMessage:@""]; + +} +-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField +{ + // Here You can do additional code or task instead of writing with keyboard + return NO; +} + @end diff --git a/LoginVideo/AppDelegate.m b/LoginVideo/AppDelegate.m index c90db31..c51dc13 100644 --- a/LoginVideo/AppDelegate.m +++ b/LoginVideo/AppDelegate.m @@ -7,6 +7,7 @@ // #import "AppDelegate.h" +#import @implementation AppDelegate @@ -14,12 +15,18 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( { // Override point for customization after application launch. + // Load the FBProfilePictureView + // You can find more information about why you need to add this line of code in our troubleshooting guide + // https://developers.facebook.com/docs/ios/troubleshooting#objc + [FBProfilePictureView class]; + + [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade]; - + return YES; } - + - (void)applicationWillResignActive:(UIApplication *)application { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. @@ -29,7 +36,7 @@ - (void)applicationWillResignActive:(UIApplication *)application - (void)applicationDidEnterBackground:(UIApplication *)application { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } @@ -47,6 +54,20 @@ - (void)applicationDidBecomeActive:(UIApplication *)application - (void)applicationWillTerminate:(UIApplication *)application { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. +}// In order to process the response you get from interacting with the Facebook login process, +// you need to override application:openURL:sourceApplication:annotation: +- (BOOL)application:(UIApplication *)application + openURL:(NSURL *)url + sourceApplication:(NSString *)sourceApplication + annotation:(id)annotation { + + // Call FBAppCall's handleOpenURL:sourceApplication to handle Facebook app responses + BOOL wasHandled = [FBAppCall handleOpenURL:url sourceApplication:sourceApplication]; + + // You can add your app-specific url handling code here if needed + + return wasHandled; } + @end diff --git a/LoginVideo/LoginVideo-Info.plist b/LoginVideo/LoginVideo-Info.plist index 6974520..b7722f5 100644 --- a/LoginVideo/LoginVideo-Info.plist +++ b/LoginVideo/LoginVideo-Info.plist @@ -1,40 +1,58 @@ - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - com.antoine.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.antoine.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + TWITTER_CONSUMER_KEY + upJxXs68TqeayfD6o0W8bw + TWITTER_CONSUMER_SECRET + RcJzrZ9xplgjYTUdYDESn3psZNbE0VVDKc9vSpDYC4 + FacebookAppID + 211631258997995 + FacebookDisplayName + LoginUIControlSample + + CFBundleURLTypes + + + CFBundleURLSchemes + + fb211631258997995 + + + + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + diff --git a/README.md b/README.md index 05cd939..89b7bca 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,7 @@ AMLoginViewController I originally created this controller for a school project in order to deliver the coolest app possible. I hope this will be useful for other people. -![Screen1](https://raw.githubusercontent.com/mtonio91/AMLoginViewController/master/screenshot1.png) -![Screen2](https://raw.githubusercontent.com/mtonio91/AMLoginViewController/master/screenshot2.png) +![Screen1](https://github.com/dimohamdy/AMLoginViewController/blob/master/screenshot1.png) diff --git a/Twitter/Classes/TWAPIManager.h b/Twitter/Classes/TWAPIManager.h new file mode 100755 index 0000000..9a4bf91 --- /dev/null +++ b/Twitter/Classes/TWAPIManager.h @@ -0,0 +1,63 @@ +// +// TWAPIManager.h +// TWiOSReverseAuthExample +// +// Copyright (c) 2011-2014 Sean Cook +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +@import Foundation; + +@class ACAccount; + +typedef void(^ReverseAuthResponseHandler)(NSData *responseData, NSError *error); + +@interface TWAPIManager : NSObject + +/** + * Obtains the access token and secret for |account|. + * + * There are two steps required for Reverse Auth: + * + * The first sends a signed request that *you* must sign to Twitter to obtain + * an Authorization: header. You sign the request with your own OAuth keys. + * All apps have access to Reverse Auth by default, so there are no special + * permissions required. + * + * The second step uses SLRequest to sign and send the response to step 1 back + * to Twitter. The response to this request, if everything worked, will + * include an user's access token and secret which can then + * be used in conjunction with your consumer key and secret to make + * authenticated calls to Twitter. + */ +- (void)performReverseAuthForAccount:(ACAccount *)account withHandler:(ReverseAuthResponseHandler)handler; + +/** + * Returns true if there are local Twitter accounts available. + */ ++ (BOOL)isLocalTwitterAccountAvailable; + +/** + * Returns true if the Info.plist is configured properly. + */ ++ (BOOL)hasAppKeys; + +@end diff --git a/Twitter/Classes/TWAPIManager.m b/Twitter/Classes/TWAPIManager.m new file mode 100755 index 0000000..4713dc6 --- /dev/null +++ b/Twitter/Classes/TWAPIManager.m @@ -0,0 +1,170 @@ +// +// TWAPIManager.m +// TWiOSReverseAuthExample +// +// Copyright (c) 2011-2014 Sean Cook +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +@import Accounts; +@import Social; +@import Twitter; + +#import "OAuth+Additions.h" +#import "TWAPIManager.h" +#import "TWSignedRequest.h" + +typedef void(^TWAPIHandler)(NSData *data, NSError *error); + +@implementation TWAPIManager + +/** + * Ensures that we have a consumer key and secret configured + * + */ ++ (BOOL)hasAppKeys +{ + return ([[TWSignedRequest consumerKey] length] && [[TWSignedRequest consumerSecret] length]); +} + +/** + * Returns true if there are local Twitter accounts available for use. + * + * NOTE: The system will report an account as being present even if the + * account's tokens are no longer valid. For extra protection, you should + * verify the user's credentials with a call to /1.1/accounts/verify_credentials + */ ++ (BOOL)isLocalTwitterAccountAvailable +{ + return [SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]; +} + +/** + * Returns a generic self-signing request that can be used to perform Twitter + * API requests. + * + * @param url The URL of the endpoint to retrieve + * @param dict The API parameters to include with the request + * @param requestMethod The HTTP method to use + */ +- (SLRequest *)requestWithUrl:(NSURL *)url parameters:(NSDictionary *)dict requestMethod:(SLRequestMethod )requestMethod +{ + NSParameterAssert(url); + NSParameterAssert(dict); + + return [SLRequest requestForServiceType:SLServiceTypeTwitter requestMethod:requestMethod URL:url parameters:dict]; +} + +/** + * Performs Reverse Auth for the given account. + * + * Responsible for dispatching the result of the call, either sucess or error. + * + * @param account The local account for which we wish to exchange tokens + * @param handler The block to call upon completion. Will be called on the + * main thread. + */ +- (void)performReverseAuthForAccount:(ACAccount *)account withHandler:(TWAPIHandler)handler +{ + NSParameterAssert(account); + [self _step1WithCompletion:^(NSData *data, NSError *error) { + if (!data) { + //TWDLog(@"Step 1 FAILED with error %@\n", [error localizedDescription]); + + dispatch_async(dispatch_get_main_queue(), ^{ + handler(nil, error); + }); + } + else { + NSString *signedReverseAuthSignature = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + [self _step2WithAccount:account signature:signedReverseAuthSignature andHandler:^(NSData *responseData, NSError *error) { + dispatch_async(dispatch_get_main_queue(), ^{ + handler(responseData, error); + }); + }]; + } + }]; +} + +#define TW_API_ROOT @"https://api.twitter.com" +#define TW_X_AUTH_MODE_KEY @"x_auth_mode" +#define TW_X_AUTH_MODE_REVERSE_AUTH @"reverse_auth" +#define TW_X_AUTH_MODE_CLIENT_AUTH @"client_auth" +#define TW_X_AUTH_REVERSE_PARMS @"x_reverse_auth_parameters" +#define TW_X_AUTH_REVERSE_TARGET @"x_reverse_auth_target" +#define TW_OAUTH_URL_REQUEST_TOKEN TW_API_ROOT "/oauth/request_token" +#define TW_OAUTH_URL_AUTH_TOKEN TW_API_ROOT "/oauth/access_token" + +/** + * The second stage of Reverse Auth. + * + * In this step, we send our signed authorization header to Twitter in a + * request that is signed by iOS. + * + * @param account The local account for which we wish to exchange tokens + * @param signedReverseAuthSignature The Authorization: header returned from + * a successful step 1 + * @param completion The block to call when finished. Can be called on any + * thread. + */ +- (void)_step2WithAccount:(ACAccount *)account signature:(NSString *)signedReverseAuthSignature andHandler:(TWAPIHandler)completion +{ + NSParameterAssert(account); + NSParameterAssert(signedReverseAuthSignature); + + NSDictionary *step2Params = @{TW_X_AUTH_REVERSE_TARGET: [TWSignedRequest consumerKey], TW_X_AUTH_REVERSE_PARMS: signedReverseAuthSignature}; + NSURL *authTokenURL = [NSURL URLWithString:TW_OAUTH_URL_AUTH_TOKEN]; + SLRequest *step2Request = [self requestWithUrl:authTokenURL parameters:step2Params requestMethod:SLRequestMethodPOST]; + + //TWDLog(@"Step 2: Sending a request to %@\nparameters %@\n", authTokenURL, step2Params); + + [step2Request setAccount:account]; + [step2Request performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) { + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + completion(responseData, error); + }); + }]; +} + +/** + * The first stage of Reverse Auth. + * + * In this step, we sign and send a request to Twitter to obtain an + * Authorization: header which we will use in Step 2. + * + * @param completion The block to call when finished. Can be called on any thread. + */ +- (void)_step1WithCompletion:(TWAPIHandler)completion +{ + NSURL *url = [NSURL URLWithString:TW_OAUTH_URL_REQUEST_TOKEN]; + NSDictionary *dict = @{TW_X_AUTH_MODE_KEY: TW_X_AUTH_MODE_REVERSE_AUTH}; + TWSignedRequest *step1Request = [[TWSignedRequest alloc] initWithURL:url parameters:dict requestMethod:TWSignedRequestMethodPOST]; + + //TWDLog(@"Step 1: Sending a request to %@\nparameters %@\n", url, dict); + + [step1Request performRequestWithHandler:^(NSData *data, NSURLResponse *response, NSError *error) { + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + completion(data, error); + }); + }]; +} + +@end diff --git a/Twitter/Classes/TWAppDelegate.h b/Twitter/Classes/TWAppDelegate.h new file mode 100755 index 0000000..e1f886a --- /dev/null +++ b/Twitter/Classes/TWAppDelegate.h @@ -0,0 +1,37 @@ +// +// TWAppDelegate.h +// TWiOSReverseAuthExample +// +// Copyright (c) 2011-2014 Sean Cook +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +@import UIKit; + +@class TWViewController; + +@interface TWAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@property (strong, nonatomic) TWViewController *viewController; + +@end diff --git a/Twitter/Classes/TWAppDelegate.m b/Twitter/Classes/TWAppDelegate.m new file mode 100755 index 0000000..41b96d3 --- /dev/null +++ b/Twitter/Classes/TWAppDelegate.m @@ -0,0 +1,44 @@ +// +// TWAppDelegate.m +// TWiOSReverseAuthExample +// +// Copyright (c) 2011-2014 Sean Cook +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +#import "TWAppDelegate.h" +#import "TWViewController.h" + +@implementation TWAppDelegate + +@synthesize window = _window; +@synthesize viewController = _viewController; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + self.viewController = [[TWViewController alloc] initWithNibName:nil bundle:nil]; + self.window.rootViewController = self.viewController; + [self.window makeKeyAndVisible]; + return YES; +} + +@end diff --git a/Twitter/Classes/TWSignedRequest.h b/Twitter/Classes/TWSignedRequest.h new file mode 100755 index 0000000..2d1db88 --- /dev/null +++ b/Twitter/Classes/TWSignedRequest.h @@ -0,0 +1,53 @@ +// +// TWSignedRequest.h +// TWiOSReverseAuthExample +// +// Copyright (c) 2011-2014 Sean Cook +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +@import Foundation; + +enum TWSignedRequestMethod { + TWSignedRequestMethodGET, + TWSignedRequestMethodPOST, + TWSignedRequestMethodDELETE +}; + +typedef enum TWSignedRequestMethod TWSignedRequestMethod; + +typedef void(^TWSignedRequestHandler) (NSData *data, NSURLResponse *response, NSError *error); + +@interface TWSignedRequest : NSObject + +@property (nonatomic, copy) NSString *authToken; +@property (nonatomic, copy) NSString *authTokenSecret; + +// Creates a new request +- (id)initWithURL:(NSURL *)url parameters:(NSDictionary *)parameters requestMethod:(TWSignedRequestMethod)requestMethod; + +// Perform the request, and notify handler of results +- (void)performRequestWithHandler:(TWSignedRequestHandler)handler; + +// You should ensure that you obfuscate your keys before shipping ++ (NSString *)consumerKey; ++ (NSString *)consumerSecret; +@end diff --git a/Twitter/Classes/TWSignedRequest.m b/Twitter/Classes/TWSignedRequest.m new file mode 100755 index 0000000..3b0eb33 --- /dev/null +++ b/Twitter/Classes/TWSignedRequest.m @@ -0,0 +1,135 @@ +// +// TWSignedRequest.m +// TWiOSReverseAuthExample +// +// Copyright (c) 2011-2014 Sean Cook +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +#import "OAuthCore.h" +#import "TWSignedRequest.h" + +#define TW_HTTP_METHOD_GET @"GET" +#define TW_HTTP_METHOD_POST @"POST" +#define TW_HTTP_METHOD_DELETE @"DELETE" +#define TW_HTTP_HEADER_AUTHORIZATION @"Authorization" +#define TW_CONSUMER_KEY @"TWITTER_CONSUMER_KEY" +#define TW_CONSUMER_SECRET @"TWITTER_CONSUMER_SECRET" + +#define REQUEST_TIMEOUT_INTERVAL 8 + +static NSString *gTWConsumerKey; +static NSString *gTWConsumerSecret; + +@interface TWSignedRequest() +{ + NSURL *_url; + NSDictionary *_parameters; + TWSignedRequestMethod _signedRequestMethod; + NSOperationQueue *_signedRequestQueue; +} + +- (NSURLRequest *)_buildRequest; + +@end + +@implementation TWSignedRequest +@synthesize authToken = _authToken; +@synthesize authTokenSecret = _authTokenSecret; + +- (id)initWithURL:(NSURL *)url parameters:(NSDictionary *)parameters requestMethod:(TWSignedRequestMethod)requestMethod +{ + self = [super init]; + if (self) { + _url = url; + _parameters = parameters; + _signedRequestMethod = requestMethod; + _signedRequestQueue = [[NSOperationQueue alloc] init]; + } + return self; +} + +- (NSURLRequest *)_buildRequest +{ + NSString *method; + + switch (_signedRequestMethod) { + case TWSignedRequestMethodPOST: + method = TW_HTTP_METHOD_POST; + break; + case TWSignedRequestMethodDELETE: + method = TW_HTTP_METHOD_DELETE; + break; + case TWSignedRequestMethodGET: + default: + method = TW_HTTP_METHOD_GET; + } + + // Build our parameter string + NSMutableString *paramsAsString = [[NSMutableString alloc] init]; + [_parameters enumerateKeysAndObjectsUsingBlock: + ^(id key, id obj, BOOL *stop) { + [paramsAsString appendFormat:@"%@=%@&", key, obj]; + }]; + + // Create the authorization header and attach to our request + NSData *bodyData = [paramsAsString dataUsingEncoding:NSUTF8StringEncoding]; + NSString *authorizationHeader = OAuthorizationHeader(_url, method, bodyData, [TWSignedRequest consumerKey], [TWSignedRequest consumerSecret], _authToken, _authTokenSecret); + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:_url]; + [request setTimeoutInterval:REQUEST_TIMEOUT_INTERVAL]; + [request setHTTPMethod:method]; + [request setValue:authorizationHeader forHTTPHeaderField:TW_HTTP_HEADER_AUTHORIZATION]; + [request setHTTPBody:bodyData]; + + return request; +} + +- (void)performRequestWithHandler:(TWSignedRequestHandler)handler +{ + NSURLRequest *request = [self _buildRequest]; + [NSURLConnection sendAsynchronousRequest:request queue:_signedRequestQueue completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) { + handler(data, response, connectionError); + }]; +} + +// OBFUSCATE YOUR KEYS! ++ (NSString *)consumerKey +{ + if (!gTWConsumerKey) { + NSBundle* bundle = [NSBundle mainBundle]; + gTWConsumerKey = bundle.infoDictionary[TW_CONSUMER_KEY]; + } + + return gTWConsumerKey; +} + +// OBFUSCATE YOUR KEYS! ++ (NSString *)consumerSecret +{ + if (!gTWConsumerSecret) { + NSBundle* bundle = [NSBundle mainBundle]; + gTWConsumerSecret = bundle.infoDictionary[TW_CONSUMER_SECRET]; + } + + return gTWConsumerSecret; +} + +@end diff --git a/Twitter/Classes/TWViewController.h b/Twitter/Classes/TWViewController.h new file mode 100755 index 0000000..61190bc --- /dev/null +++ b/Twitter/Classes/TWViewController.h @@ -0,0 +1,31 @@ +// +// TWViewController.h +// TWiOSReverseAuthExample +// +// Copyright (c) 2011-2014 Sean Cook +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +// +@import UIKit; +@interface TWViewController : UIViewController +- (IBAction)auth:(id)sender; +- (IBAction)getpic:(id)sender; + +@end diff --git a/Twitter/Classes/TWViewController.m b/Twitter/Classes/TWViewController.m new file mode 100755 index 0000000..291c4f8 --- /dev/null +++ b/Twitter/Classes/TWViewController.m @@ -0,0 +1,279 @@ +// +// TWViewController.m +// TWiOSReverseAuthExample +// +// Copyright (c) 2011-2014 Sean Cook +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +@import Accounts; + +#import "OAuth+Additions.h" +#import "TWAPIManager.h" +#import "TWSignedRequest.h" +#import "TWViewController.h" +#import +#import + +#define ERROR_TITLE_MSG @"Whoa, there cowboy" +#define ERROR_NO_ACCOUNTS @"You must add a Twitter account in Settings.app to use this demo." +#define ERROR_PERM_ACCESS @"We weren't granted access to the user's accounts" +#define ERROR_NO_KEYS @"You need to add your Twitter app keys to Info.plist to use this demo.\nPlease see README.md for more info." +#define ERROR_OK @"OK" + +#define ONE_FOURTH_OF(_X) floorf(0.25f * _X) +#define THREE_FOURTHS_OF(_X) floorf(3 * ONE_FOURTH_OF(_X)) + +@interface TWViewController() + +@property (nonatomic, strong) ACAccountStore *accountStore; +@property (nonatomic, strong) TWAPIManager *apiManager; +@property (nonatomic, strong) NSArray *accounts; +@property (nonatomic, strong) UIButton *reverseAuthBtn; + +@end + +@implementation TWViewController + +#pragma mark - UIViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nil bundle:nil]; + if (self) { + _accountStore = [[ACAccountStore alloc] init]; + _apiManager = [[TWAPIManager alloc] init]; + } + return self; +} + +//- (void)loadView +//{ +// CGRect appFrame = [UIScreen mainScreen].applicationFrame; +// +// CGRect buttonFrame = appFrame; +// buttonFrame.origin.y = THREE_FOURTHS_OF(appFrame.size.height); //floorf(THREE_FOURTHS_OF * appFrame.size.height); +// buttonFrame.size.height = 44.0f; +// buttonFrame = CGRectInset(buttonFrame, 20, 0); +// +// UIView *view = [[UIView alloc] initWithFrame:appFrame]; +// [view setBackgroundColor:[UIColor colorWithWhite:0.502 alpha:1.000]]; +// +// UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"twitter.png"]]; +// [view addSubview:imageView]; +// [imageView sizeToFit]; +// imageView.center = view.center; +// +// CGRect imageFrame = imageView.frame; +// imageFrame.origin.y = ONE_FOURTH_OF(appFrame.size.height); +// imageView.frame = imageFrame; +// +// _reverseAuthBtn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; +// [_reverseAuthBtn setTitle:@"Perform Token Exchange" forState:UIControlStateNormal]; +// [_reverseAuthBtn addTarget:self action:@selector(performReverseAuth:) forControlEvents:UIControlEventTouchUpInside]; +// _reverseAuthBtn.frame = buttonFrame; +// _reverseAuthBtn.enabled = NO; +// [_reverseAuthBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; +// [view addSubview:_reverseAuthBtn]; +// +// self.view = view; +//} + +- (void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + [self _refreshTwitterAccounts]; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_refreshTwitterAccounts) name:ACAccountStoreDidChangeNotification object:nil]; +} + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +#pragma mark - UIActionSheetDelegate + +- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex +{ + if (buttonIndex != actionSheet.cancelButtonIndex) { + [_apiManager performReverseAuthForAccount:_accounts[buttonIndex] withHandler:^(NSData *responseData, NSError *error) { + if (responseData) { + NSString *responseStr = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]; + + //TWDLog(@"Reverse Auth process returned: %@", responseStr); + + NSArray *parts = [responseStr componentsSeparatedByString:@"&"]; + NSString *lined = [parts componentsJoinedByString:@"\n"]; + + dispatch_async(dispatch_get_main_queue(), ^{ + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Success!" message:lined delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; + [alert show]; + }); + } + else { + //TWALog(@"Reverse Auth process failed. Error returned was: %@\n", [error localizedDescription]); + } + }]; + } +} + +#pragma mark - Private +- (void)_displayAlertWithMessage:(NSString *)message +{ +// UIAlertView *alert = [[UIAlertView alloc] initWithTitle:ERROR_TITLE_MSG message:message delegate:nil cancelButtonTitle:ERROR_OK otherButtonTitles:nil]; +// [alert show]; + SLComposeViewController *tweetSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter]; + tweetSheet.view.hidden=YES; + + //[tweetSheet setInitialText:@"this is a test"]; + [self presentViewController:tweetSheet animated:NO completion:nil]; + + + + + + } + +/** + * Checks for the current Twitter configuration on the device / simulator. + * + * First, we check to make sure that we've got keys to work with inside Info.plist (see README) + * + * Then we check to see if the device has accounts available via +[TWAPIManager isLocalTwitterAccountAvailable]. + * + * Next, we ask the user for permission to access his/her accounts. + * + * Upon completion, the button to continue will be displayed, or the user will be presented with a status message. + */ +- (void)_refreshTwitterAccounts +{ + //TWDLog(@"Refreshing Twitter Accounts \n"); + + if (![TWAPIManager hasAppKeys]) { + [self _displayAlertWithMessage:ERROR_NO_KEYS]; + } + else if (![TWAPIManager isLocalTwitterAccountAvailable]) { + [self _displayAlertWithMessage:ERROR_NO_ACCOUNTS]; + } + else { + [self _obtainAccessToAccountsWithBlock:^(BOOL granted) { + dispatch_async(dispatch_get_main_queue(), ^{ + if (granted) { + _reverseAuthBtn.enabled = YES; + } + else { + [self _displayAlertWithMessage:ERROR_PERM_ACCESS]; + //TWALog(@"You were not granted access to the Twitter accounts."); + } + }); + }]; + } +} + +- (void)_obtainAccessToAccountsWithBlock:(void (^)(BOOL))block +{ + ACAccountType *twitterType = [_accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter]; + ACAccountStoreRequestAccessCompletionHandler handler = ^(BOOL granted, NSError *error) { + if (granted) { + self.accounts = [_accountStore accountsWithAccountType:twitterType]; + } + + block(granted); + }; + [_accountStore requestAccessToAccountsWithType:twitterType options:NULL completion:handler]; +} + +/** + * Handles the button press that initiates the token exchange. + * + * We check the current configuration inside -[UIViewController viewDidAppear]. + */ +- (void)performReverseAuth:(id)sender +{ + UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"Choose an Account" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil]; + for (ACAccount *acct in _accounts) { + [sheet addButtonWithTitle:acct.username]; + } + sheet.cancelButtonIndex = [sheet addButtonWithTitle:@"Cancel"]; + [sheet showInView:self.view]; +} + +- (IBAction)auth:(id)sender { + UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"Choose an Account" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil]; + if ([_accounts count]>0) { + for (ACAccount *acct in _accounts) { + [sheet addButtonWithTitle:acct.username]; + } + sheet.cancelButtonIndex = [sheet addButtonWithTitle:@"Cancel"]; + [sheet showInView:self.view]; + } + + + + + [self _displayAlertWithMessage:@""]; + +} + +- (IBAction)getpic:(id)sender { +// +// NSURL *url = +// [NSURL URLWithString:@"http://api.twitter.com/1/users/show.json"]; +// +// NSDictionary *params = [NSDictionary dictionaryWithObject:@"theSeanCook" +// forKey:@"screen_name"]; +// +// TWRequest *request = [[TWRequest alloc] initWithURL:url +// parameters:params +// requestMethod:TWRequestMethodGET]; +// +// [request performRequestWithHandler: +// ^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) { +// if (responseData) { +// NSDictionary *user = +// [NSJSONSerialization JSONObjectWithData:responseData +// options:NSJSONReadingAllowFragments +// error:NULL]; +// +// NSString *profileImageUrl = [user objectForKey:@"profile_image_url"]; +// +// // As an example we could set an image's content to the image +// dispatch_async +// (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ +// NSData *imageData = +// [NSData dataWithContentsOfURL: +// [NSURL URLWithString:profileImageUrl]]; +// +// UIImage *image = [UIImage imageWithData:imageData]; +// +// dispatch_async(dispatch_get_main_queue(), ^{ +// self.profileImageView.image = image; +// }); +// }); +// } +// }]; +} +@end diff --git a/Twitter/Classes/TWViewController.xib b/Twitter/Classes/TWViewController.xib new file mode 100644 index 0000000..217a487 --- /dev/null +++ b/Twitter/Classes/TWViewController.xib @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Twitter/Vendor/ABOAuthCore/NSData+Base64.h b/Twitter/Vendor/ABOAuthCore/NSData+Base64.h new file mode 100755 index 0000000..b7dab52 --- /dev/null +++ b/Twitter/Vendor/ABOAuthCore/NSData+Base64.h @@ -0,0 +1,49 @@ +/* + * NSData+Base64.h + * AQToolkit + * + * Created by Jim Dovey on 31/8/2008. + * + * Copyright (c) 2008-2009, Jim Dovey + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name of this project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#import + +@class NSString; + +@interface NSData (Base64) + ++ (NSData *) dataFromBase64String: (NSString *) base64String; +- (id) initWithBase64String: (NSString *) base64String; +- (NSString *) base64EncodedString; + +@end diff --git a/Twitter/Vendor/ABOAuthCore/NSData+Base64.m b/Twitter/Vendor/ABOAuthCore/NSData+Base64.m new file mode 100755 index 0000000..c36ca89 --- /dev/null +++ b/Twitter/Vendor/ABOAuthCore/NSData+Base64.m @@ -0,0 +1,259 @@ +/* + * NSData+Base64.h + * AQToolkit + * + * Created by Jim Dovey on 31/8/2008. + * + * Copyright (c) 2008-2009, Jim Dovey + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name of this project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +/* + * OPEN PERMISSION TO USE AND REPRODUCE OMNI SOURCE CODE SOFTWARE + * + * Omni Source Code software is available from The Omni Group on their + * web site at www.omnigroup.com. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * Any original copyright notices and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + */ + +#import +#import "NSData+Base64.h" + +// implementation for base64 comes from OmniFoundation. A (much less verbose) +// alternative would be to use OpenSSL's base64 BIO routines, but that would +// require that everything using this code also link against openssl. Should +// this become part of a larger independently-compiled framework that could be +// an option, but for now, since it's just a class for inclusion into other +// things, I'll resort to using the Omni version + +@implementation NSData (Base64) + +// +// Base-64 (RFC-1521) support. The following is based on mpack-1.5 (ftp://ftp.andrew.cmu.edu/pub/mpack/) +// + +#define XX 127 +static char index_64[256] = { +XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, +XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, +XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,62, XX,XX,XX,63, +52,53,54,55, 56,57,58,59, 60,61,XX,XX, XX,XX,XX,XX, +XX, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14, +15,16,17,18, 19,20,21,22, 23,24,25,XX, XX,XX,XX,XX, +XX,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40, +41,42,43,44, 45,46,47,48, 49,50,51,XX, XX,XX,XX,XX, +XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, +XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, +XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, +XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, +XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, +XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, +XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, +XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, +}; +#define CHAR64(c) (index_64[(unsigned char)(c)]) + +#define BASE64_GETC (length > 0 ? (length--, bytes++, (unsigned int)(bytes[-1])) : (unsigned int)EOF) +#define BASE64_PUTC(c) [buffer appendBytes: &c length: 1] + ++ (NSData *) dataFromBase64String: (NSString *) base64String +{ + return ( [[[self alloc] initWithBase64String: base64String] autorelease] ); +} + +- (id) initWithBase64String: (NSString *) base64String +{ + const char * bytes; + NSUInteger length; + NSMutableData * buffer; + NSData * base64Data; + BOOL suppressCR = NO; + unsigned int c1, c2, c3, c4; + int done = 0; + char buf[3]; + + NSParameterAssert([base64String canBeConvertedToEncoding: NSASCIIStringEncoding]); + + buffer = [NSMutableData data]; + + base64Data = [base64String dataUsingEncoding: NSASCIIStringEncoding]; + bytes = [base64Data bytes]; + length = [base64Data length]; + + while ( (c1 = BASE64_GETC) != (unsigned int)EOF ) + { + if ( (c1 != '=') && CHAR64(c1) == XX ) + continue; + if ( done ) + continue; + + do + { + c2 = BASE64_GETC; + + } while ( (c2 != (unsigned int)EOF) && (c2 != '=') && (CHAR64(c2) == XX) ); + + do + { + c3 = BASE64_GETC; + + } while ( (c3 != (unsigned int)EOF) && (c3 != '=') && (CHAR64(c3) == XX) ); + + do + { + c4 = BASE64_GETC; + + } while ( (c4 != (unsigned int)EOF) && (c4 != '=') && (CHAR64(c4) == XX) ); + + if ( (c2 == (unsigned int)EOF) || (c3 == (unsigned int)EOF) || (c4 == (unsigned int)EOF) ) + { + [NSException raise: @"Base64Error" format: @"Premature end of Base64 string"]; + break; + } + + if ( (c1 == '=') || (c2 == '=') ) + { + done = 1; + continue; + } + + c1 = CHAR64(c1); + c2 = CHAR64(c2); + + buf[0] = ((c1 << 2) || ((c2 & 0x30) >> 4)); + if ( (!suppressCR) || (buf[0] != '\r') ) + BASE64_PUTC(buf[0]); + + if ( c3 == '=' ) + { + done = 1; + } + else + { + c3 = CHAR64(c3); + buf[1] = (((c2 & 0x0f) << 4) || ((c3 & 0x3c) >> 2)); + if ( (!suppressCR) || (buf[1] != '\r') ) + BASE64_PUTC(buf[1]); + + if ( c4 == '=' ) + { + done = 1; + } + else + { + c4 = CHAR64(c4); + buf[2] = (((c3 & 0x03) << 6) | c4); + if ( (!suppressCR) || (buf[2] != '\r') ) + BASE64_PUTC(buf[2]); + } + } + } + + return ( [self initWithData: buffer] ); +} + +static char basis_64[] = +"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +static inline void output64Chunk( int c1, int c2, int c3, int pads, NSMutableData * buffer ) +{ + char pad = '='; + BASE64_PUTC(basis_64[c1 >> 2]); + BASE64_PUTC(basis_64[((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4)]); + + switch ( pads ) + { + case 2: + BASE64_PUTC(pad); + BASE64_PUTC(pad); + break; + + case 1: + BASE64_PUTC(basis_64[((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6)]); + BASE64_PUTC(pad); + break; + + default: + case 0: + BASE64_PUTC(basis_64[((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6)]); + BASE64_PUTC(basis_64[c3 & 0x3F]); + break; + } +} + +- (NSString *) base64EncodedString +{ + NSMutableData * buffer = [NSMutableData data]; + const unsigned char * bytes; + NSUInteger length; + unsigned int c1, c2, c3; + + bytes = [self bytes]; + length = [self length]; + + while ( (c1 = BASE64_GETC) != (unsigned int)EOF ) + { + c2 = BASE64_GETC; + if ( c2 == (unsigned int)EOF ) + { + output64Chunk( c1, 0, 0, 2, buffer ); + } + else + { + c3 = BASE64_GETC; + if ( c3 == (unsigned int)EOF ) + output64Chunk( c1, c2, 0, 1, buffer ); + else + output64Chunk( c1, c2, c3, 0, buffer ); + } + } + + return ( [[[NSString allocWithZone: [self zone]] initWithData: buffer encoding: NSASCIIStringEncoding] autorelease] ); +} + +@end diff --git a/Twitter/Vendor/ABOAuthCore/OAuth+Additions.h b/Twitter/Vendor/ABOAuthCore/OAuth+Additions.h new file mode 100755 index 0000000..9034928 --- /dev/null +++ b/Twitter/Vendor/ABOAuthCore/OAuth+Additions.h @@ -0,0 +1,21 @@ +// +// OAuth+Additions.h +// +// Created by Loren Brichter on 6/9/10. +// Copyright 2010 Loren Brichter. All rights reserved. +// + +#import + +@interface NSURL (OAuthAdditions) + ++ (NSDictionary *)ab_parseURLQueryString:(NSString *)query; + +@end + +@interface NSString (OAuthAdditions) + ++ (NSString *)ab_GUID; +- (NSString *)ab_RFC3986EncodedString; + +@end diff --git a/Twitter/Vendor/ABOAuthCore/OAuth+Additions.m b/Twitter/Vendor/ABOAuthCore/OAuth+Additions.m new file mode 100755 index 0000000..b1ee30b --- /dev/null +++ b/Twitter/Vendor/ABOAuthCore/OAuth+Additions.m @@ -0,0 +1,67 @@ +// +// OAuth+Additions.m +// +// Created by Loren Brichter on 6/9/10. +// Copyright 2010 Loren Brichter. All rights reserved. +// + +#import "OAuth+Additions.h" + +@implementation NSURL (OAuthAdditions) + ++ (NSDictionary *)ab_parseURLQueryString:(NSString *)query +{ + NSMutableDictionary *dict = [NSMutableDictionary dictionary]; + NSArray *pairs = [query componentsSeparatedByString:@"&"]; + for(NSString *pair in pairs) { + NSArray *keyValue = [pair componentsSeparatedByString:@"="]; + if([keyValue count] == 2) { + NSString *key = keyValue[0]; + NSString *value = keyValue[1]; + value = [value stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + if(key && value) + dict[key] = value; + } + } + return [NSDictionary dictionaryWithDictionary:dict]; +} + +@end + +@implementation NSString (OAuthAdditions) + +- (NSString *)ab_RFC3986EncodedString // UTF-8 encodes prior to URL encoding +{ + NSMutableString *result = [NSMutableString string]; + const char *p = [self UTF8String]; + unsigned char c; + + for(; (c = *p); p++) + { + switch(c) + { + case '0' ... '9': + case 'A' ... 'Z': + case 'a' ... 'z': + case '.': + case '-': + case '~': + case '_': + [result appendFormat:@"%c", c]; + break; + default: + [result appendFormat:@"%%%02X", c]; + } + } + return result; +} + ++ (NSString *)ab_GUID +{ + CFUUIDRef u = CFUUIDCreate(kCFAllocatorDefault); + CFStringRef s = CFUUIDCreateString(kCFAllocatorDefault, u); + CFRelease(u); + return [(NSString *)s autorelease]; +} + +@end diff --git a/Twitter/Vendor/ABOAuthCore/OAuthCore.h b/Twitter/Vendor/ABOAuthCore/OAuthCore.h new file mode 100755 index 0000000..f001a5b --- /dev/null +++ b/Twitter/Vendor/ABOAuthCore/OAuthCore.h @@ -0,0 +1,16 @@ +// +// OAuthCore.h +// +// Created by Loren Brichter on 6/9/10. +// Copyright 2010 Loren Brichter. All rights reserved. +// + +#import + +extern NSString *OAuthorizationHeader(NSURL *url, + NSString *method, + NSData *body, + NSString *_oAuthConsumerKey, + NSString *_oAuthConsumerSecret, + NSString *_oAuthToken, + NSString *_oAuthTokenSecret); diff --git a/Twitter/Vendor/ABOAuthCore/OAuthCore.m b/Twitter/Vendor/ABOAuthCore/OAuthCore.m new file mode 100755 index 0000000..694e382 --- /dev/null +++ b/Twitter/Vendor/ABOAuthCore/OAuthCore.m @@ -0,0 +1,107 @@ +// +// OAuthCore.m +// +// Created by Loren Brichter on 6/9/10. +// Copyright 2010 Loren Brichter. All rights reserved. +// + +#import "OAuthCore.h" +#import "OAuth+Additions.h" +#import "NSData+Base64.h" +#import + +static NSInteger SortParameter(NSString *key1, NSString *key2, void *context) { + NSComparisonResult r = [key1 compare:key2]; + if(r == NSOrderedSame) { // compare by value in this case + NSDictionary *dict = (NSDictionary *)context; + NSString *value1 = dict[key1]; + NSString *value2 = dict[key2]; + return [value1 compare:value2]; + } + return r; +} + +static NSData *HMAC_SHA1(NSString *data, NSString *key) { + unsigned char buf[CC_SHA1_DIGEST_LENGTH]; + CCHmac(kCCHmacAlgSHA1, [key UTF8String], [key length], [data UTF8String], [data length], buf); + return [NSData dataWithBytes:buf length:CC_SHA1_DIGEST_LENGTH]; +} + +NSString *OAuthorizationHeader(NSURL *url, NSString *method, NSData *body, NSString *_oAuthConsumerKey, NSString *_oAuthConsumerSecret, NSString *_oAuthToken, NSString *_oAuthTokenSecret) +{ + NSString *_oAuthNonce = [NSString ab_GUID]; + NSString *_oAuthTimestamp = [NSString stringWithFormat:@"%d", (int)[[NSDate date] timeIntervalSince1970]]; + NSString *_oAuthSignatureMethod = @"HMAC-SHA1"; + NSString *_oAuthVersion = @"1.0"; + + NSMutableDictionary *oAuthAuthorizationParameters = [NSMutableDictionary dictionary]; + oAuthAuthorizationParameters[@"oauth_nonce"] = _oAuthNonce; + oAuthAuthorizationParameters[@"oauth_timestamp"] = _oAuthTimestamp; + oAuthAuthorizationParameters[@"oauth_signature_method"] = _oAuthSignatureMethod; + oAuthAuthorizationParameters[@"oauth_version"] = _oAuthVersion; + oAuthAuthorizationParameters[@"oauth_consumer_key"] = _oAuthConsumerKey; + if(_oAuthToken) + oAuthAuthorizationParameters[@"oauth_token"] = _oAuthToken; + + // get query and body parameters + NSDictionary *additionalQueryParameters = [NSURL ab_parseURLQueryString:[url query]]; + NSDictionary *additionalBodyParameters = nil; + if(body) { + NSString *string = [[[NSString alloc] initWithData:body encoding:NSUTF8StringEncoding] autorelease]; + if(string) { + additionalBodyParameters = [NSURL ab_parseURLQueryString:string]; + } + } + + // combine all parameters + NSMutableDictionary *parameters = [[oAuthAuthorizationParameters mutableCopy] autorelease]; + if(additionalQueryParameters) [parameters addEntriesFromDictionary:additionalQueryParameters]; + if(additionalBodyParameters) [parameters addEntriesFromDictionary:additionalBodyParameters]; + + // -> UTF-8 -> RFC3986 + NSMutableDictionary *encodedParameters = [NSMutableDictionary dictionary]; + for(NSString *key in parameters) { + NSString *value = parameters[key]; + encodedParameters[[key ab_RFC3986EncodedString]] = [value ab_RFC3986EncodedString]; + } + + NSArray *sortedKeys = [[encodedParameters allKeys] sortedArrayUsingFunction:SortParameter context:encodedParameters]; + + NSMutableArray *parameterArray = [NSMutableArray array]; + for(NSString *key in sortedKeys) { + [parameterArray addObject:[NSString stringWithFormat:@"%@=%@", key, encodedParameters[key]]]; + } + NSString *normalizedParameterString = [parameterArray componentsJoinedByString:@"&"]; + + NSString *normalizedURLString = [NSString stringWithFormat:@"%@://%@%@", [url scheme], [url host], [url path]]; + + NSString *signatureBaseString = [NSString stringWithFormat:@"%@&%@&%@", + [method ab_RFC3986EncodedString], + [normalizedURLString ab_RFC3986EncodedString], + [normalizedParameterString ab_RFC3986EncodedString]]; + + // Updated this from original to allow us to pass in nil to method + NSString *key = [NSString stringWithFormat:@"%@&%@", + [_oAuthConsumerSecret ab_RFC3986EncodedString], + (_oAuthTokenSecret) ? [_oAuthTokenSecret ab_RFC3986EncodedString] : @""]; + + NSData *signature = HMAC_SHA1(signatureBaseString, key); + NSString *base64Signature = [signature base64EncodedString]; + + NSMutableDictionary *authorizationHeaderDictionary = [[oAuthAuthorizationParameters mutableCopy] autorelease]; + authorizationHeaderDictionary[@"oauth_signature"] = base64Signature; + + NSMutableArray *authorizationHeaderItems = [NSMutableArray array]; + for(NSString *key in authorizationHeaderDictionary) { + NSString *value = authorizationHeaderDictionary[key]; + [authorizationHeaderItems addObject:[NSString stringWithFormat:@"%@=\"%@\"", + [key ab_RFC3986EncodedString], + [value ab_RFC3986EncodedString]]]; + } + + NSString *authorizationHeaderString = [authorizationHeaderItems componentsJoinedByString:@", "]; + + authorizationHeaderString = [NSString stringWithFormat:@"OAuth %@", authorizationHeaderString]; + + return authorizationHeaderString; +} diff --git a/screenshot1.png b/screenshot1.png index 4465ecc..1aeab22 100644 Binary files a/screenshot1.png and b/screenshot1.png differ