diff --git a/plugin.xml b/plugin.xml index 3be8f7e5a..8c7a7200a 100644 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="0.5.0"> Facebook Connect @@ -22,20 +22,28 @@ - - - - - + + + + + - + + + + + + + @@ -71,9 +79,11 @@ - - - + + + + + @@ -98,54 +108,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + diff --git a/src/ios/FacebookConnectPlugin.h b/src/ios/FacebookConnectPlugin.h index 7aa18e5d2..36ad12a28 100755 --- a/src/ios/FacebookConnectPlugin.h +++ b/src/ios/FacebookConnectPlugin.h @@ -3,15 +3,13 @@ // GapFacebookConnect // // Created by Jesse MacFadyen on 11-04-22. +// Updated by Ally Ogilvie on 29/Jan/2014. // Copyright 2011 Nitobi. All rights reserved. // #import -#import "FacebookSDK.h" - +#import #import -@interface FacebookConnectPlugin : CDVPlugin { -} - +@interface FacebookConnectPlugin : CDVPlugin @end diff --git a/src/ios/FacebookConnectPlugin.m b/src/ios/FacebookConnectPlugin.m index 3fb484de4..88f197b0a 100755 --- a/src/ios/FacebookConnectPlugin.m +++ b/src/ios/FacebookConnectPlugin.m @@ -20,16 +20,35 @@ @interface FacebookConnectPlugin () @implementation FacebookConnectPlugin + +-(CDVPlugin *)initWithWebView:(UIWebView *)theWebView { + NSLog(@"Init FacebookConnect Session"); + self = (FacebookConnectPlugin *)[super initWithWebView:theWebView]; + self.userid = @""; + + [FBSession openActiveSessionWithReadPermissions:nil + allowLoginUI:NO + completionHandler:^(FBSession *session, + FBSessionState state, + NSError *error) { + [self sessionStateChanged:session + state:state + error:error]; + }]; + return self; +} + /* This overrides CDVPlugin's method, which receives a notification when handleOpenURL is called on the main app delegate */ - (void) handleOpenURL:(NSNotification*)notification { - NSURL* url = [notification object]; + NSLog(@"handle url: %@", [notification object]); + NSURL* url = [notification object]; - if (![url isKindOfClass:[NSURL class]]) { + if (![url isKindOfClass:[NSURL class]]) { return; - } - - [FBSession.activeSession handleOpenURL:url]; + } + + [FBSession.activeSession handleOpenURL:url]; } /* @@ -138,39 +157,28 @@ - (BOOL)areAllPermissionsReadPermissions:(NSArray*)permissions { return YES; } -- (void) init:(CDVInvokedUrlCommand*)command -{ - self.userid = @""; - - [FBSession openActiveSessionWithReadPermissions:nil - allowLoginUI:NO - completionHandler:^(FBSession *session, - FBSessionState state, - NSError *error) { - [self sessionStateChanged:session - state:state - error:error]; - }]; - - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; -} - - (void) getLoginStatus:(CDVInvokedUrlCommand*)command -{ +{ CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:[self responseObject]]; [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; } -- (void) login:(CDVInvokedUrlCommand*)command -{ +- (void)login:(CDVInvokedUrlCommand *)command { BOOL permissionsAllowed = YES; NSString *permissionsErrorMessage = @""; NSArray *permissions = nil; if ([command.arguments count] > 0) { permissions = command.arguments; } + if (permissions == nil) { + // We need permissions + permissionsErrorMessage = @"No permissions specified at login"; + CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR + messageAsString:permissionsErrorMessage]; + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; + return; + } // save the callbackId for the login callback self.loginCallbackId = command.callbackId; @@ -183,6 +191,7 @@ - (void) login:(CDVInvokedUrlCommand*)command // To mix both, we'll use deprecated methods BOOL publishPermissionFound = NO; BOOL readPermissionFound = NO; + for (NSString *p in permissions) { if ([self isPublishPermission:p]) { publishPermissionFound = YES; @@ -195,6 +204,7 @@ - (void) login:(CDVInvokedUrlCommand*)command break; } } + if (publishPermissionFound && readPermissionFound) { // Mix of permissions, not allowed permissionsAllowed = NO; @@ -237,9 +247,6 @@ - (void) login:(CDVInvokedUrlCommand*)command permissionsAllowed = NO; permissionsErrorMessage = @"You can only ask for read permissions initially"; } - - - } if (!permissionsAllowed) { @@ -314,10 +321,11 @@ - (void) showDialog:(CDVInvokedUrlCommand*)command } else { if (result == FBWebDialogResultDialogNotCompleted) { // User clicked the "x" icon to Cancel - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_NO_RESULT]; + pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR + messageAsString:@"User cancelled."]; } else { // Send the URL parameters back, for a requests dialog, the "request" parameter - // will include the resutling request id. For a feed dialog, the "post_id" + // will include the resluting request id. For a feed dialog, the "post_id" // parameter will include the resulting post id. NSDictionary *params = [self parseURLParams:[resultURL query]]; pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:params]; diff --git a/src/ios/frameworks/FacebookSDK-3.5.2-Debug.a b/src/ios/frameworks/FacebookSDK-3.5.2-Debug.a deleted file mode 100644 index 01437565a..000000000 Binary files a/src/ios/frameworks/FacebookSDK-3.5.2-Debug.a and /dev/null differ diff --git a/src/ios/frameworks/FacebookSDK-3.5.2-Release.a b/src/ios/frameworks/FacebookSDK-3.5.2-Release.a deleted file mode 100644 index b128f3a08..000000000 Binary files a/src/ios/frameworks/FacebookSDK-3.5.2-Release.a and /dev/null differ diff --git a/src/ios/frameworks/FacebookSDK.framework/FacebookSDK b/src/ios/frameworks/FacebookSDK.framework/FacebookSDK new file mode 120000 index 000000000..77d5d31a9 --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/FacebookSDK @@ -0,0 +1 @@ +./Versions/A/FacebookSDK \ No newline at end of file diff --git a/src/ios/frameworks/FacebookSDK.framework/Headers b/src/ios/frameworks/FacebookSDK.framework/Headers new file mode 120000 index 000000000..b0cc393f6 --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Headers @@ -0,0 +1 @@ +./Versions/A/Headers \ No newline at end of file diff --git a/src/ios/frameworks/FacebookSDK.framework/Resources b/src/ios/frameworks/FacebookSDK.framework/Resources new file mode 120000 index 000000000..3afb71774 --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Resources @@ -0,0 +1 @@ +./Versions/A/Resources \ No newline at end of file diff --git a/src/ios/headers/FBAccessTokenData.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAccessTokenData.h similarity index 74% rename from src/ios/headers/FBAccessTokenData.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAccessTokenData.h index ef6ce35d8..f28039b44 100644 --- a/src/ios/headers/FBAccessTokenData.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAccessTokenData.h @@ -15,37 +15,38 @@ */ #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 + + @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. */ @@ -53,9 +54,9 @@ /*! @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]`. @@ -70,9 +71,28 @@ /*! @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`). */ @@ -80,9 +100,9 @@ /*! @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; @@ -112,4 +132,9 @@ */ @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/src/ios/headers/FBAppCall.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppCall.h similarity index 82% rename from src/ios/headers/FBAppCall.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppCall.h index 709bd47e1..97569258e 100644 --- a/src/ios/headers/FBAppCall.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppCall.h @@ -6,7 +6,7 @@ * 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. @@ -15,37 +15,46 @@ */ #import -#import "FBSession.h" -#import "FBDialogsData.h" + #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 @@ -70,12 +79,24 @@ typedef void (^FBAppCallHandler)(FBAppCall *call); /*! @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; @@ -85,11 +106,11 @@ typedef void (^FBAppCallHandler)(FBAppCall *call); 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 @@ -100,15 +121,15 @@ typedef void (^FBAppCallHandler)(FBAppCall *call); 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 @@ -120,14 +141,14 @@ typedef void (^FBAppCallHandler)(FBAppCall *call); 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 @@ -139,18 +160,18 @@ typedef void (^FBAppCallHandler)(FBAppCall *call); 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 @@ -179,6 +200,32 @@ typedef void (^FBAppCallHandler)(FBAppCall *call); */ + (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/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppEvents.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppEvents.h new file mode 100644 index 000000000..d9415d2af --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppEvents.h @@ -0,0 +1,451 @@ +/* + * 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" + +/*! + + @typedef FBAppEventsFlushBehavior enum + + @abstract + Control when sends log events to the server + + @discussion + + */ +typedef enum { + + /*! Flush automatically: periodically (once a minute or every 100 logged events) and always at app reactivation. */ + FBAppEventsFlushBehaviorAuto, + + /*! 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, + +} FBAppEventsFlushBehavior; + +/* + * Constant used by NSNotificationCenter for results of flushing AppEvents event logs + */ + +/*! NSNotificationCenter name indicating a result of a failed log flush attempt */ +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. */ +extern NSString *const FBAppEventNameActivatedApp; + +/*! Log this event when a user has completed registration with the app. */ +extern NSString *const FBAppEventNameCompletedRegistration; + +/*! Log this event when a user has viewed a form of content in the app. */ +extern NSString *const FBAppEventNameViewedContent; + +/*! Log this event when a user has performed a search within the app. */ +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. */ +extern NSString *const FBAppEventNameRated; + +/*! Log this event when the user has completed a tutorial in the app. */ +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. */ +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. */ +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. */ +extern NSString *const FBAppEventNameInitiatedCheckout; + +/*! Log this event when the user has entered their payment info. */ +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. */ +extern NSString *const FBAppEventNamePurchased; + +// Gaming related + +/*! Log this event when the user has achieved a level in the app. */ +extern NSString *const FBAppEventNameAchievedLevel; + +/*! Log this event when the user has unlocked an achievement in the app. */ +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. */ +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 . */ +extern NSString *const FBAppEventParameterNameCurrency; + +/*! Parameter key used to specify method user has used to register for the app, e.g., "Facebook", "email", "Twitter", etc */ +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. */ +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. */ +extern NSString *const FBAppEventParameterNameContentID; + +/*! Parameter key used to specify the string provided by the user for a search operation. */ +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. */ +extern NSString *const FBAppEventParameterNameSuccess; + +/*! Parameter key used to specify the maximum rating available for the `FBAppEventNameRate` event. E.g., "5" or "10". */ +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. */ +extern NSString *const FBAppEventParameterNamePaymentInfoAvailable; + +/*! Parameter key used to specify how many items are being processed for an `FBAppEventNameInitiatedCheckout` or `FBAppEventNamePurchased` event. */ +extern NSString *const FBAppEventParameterNameNumItems; + +/*! Parameter key used to specify the level achieved in a `FBAppEventNameAchieved` event. */ +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. */ +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 */ +extern NSString *const FBAppEventParameterValueYes; + +/*! No-valued parameter value to be used with parameter keys that need a Yes/No value */ +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 10. 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/src/ios/headers/FBAppLinkData.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppLinkData.h similarity index 69% rename from src/ios/headers/FBAppLinkData.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppLinkData.h index 4df5556d0..dfdcd2e65 100644 --- a/src/ios/headers/FBAppLinkData.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppLinkData.h @@ -6,7 +6,7 @@ * 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. @@ -17,7 +17,7 @@ #import /*! - @abstract This class contains information that represents an App Link from Facebook. + @abstract This class contains information that represents an App Link from Facebook. */ @interface FBAppLinkData : NSObject @@ -31,9 +31,21 @@ @property (readonly) NSArray *actionIDs; /*! @abstract Reference breadcrumb provided during creation of story */ -@property (readonly) NSArray *ref; +@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/src/ios/headers/FBCacheDescriptor.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBCacheDescriptor.h similarity index 95% rename from src/ios/headers/FBCacheDescriptor.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBCacheDescriptor.h index fb262491c..cf0b34dab 100644 --- a/src/ios/headers/FBCacheDescriptor.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBCacheDescriptor.h @@ -15,14 +15,15 @@ */ #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 @@ -34,9 +35,9 @@ @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; +- (void)prefetchAndCacheForSession:(FBSession*)session; @end diff --git a/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBConnect.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBConnect.h new file mode 100644 index 000000000..2d688e9c1 --- /dev/null +++ b/src/ios/frameworks/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/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialog.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialog.h new file mode 100644 index 000000000..8bee94313 --- /dev/null +++ b/src/ios/frameworks/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/src/ios/headers/FBDialogs.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogs.h similarity index 94% rename from src/ios/headers/FBDialogs.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogs.h index c325eab04..1d84796a3 100644 --- a/src/ios/headers/FBDialogs.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogs.h @@ -6,7 +6,7 @@ * 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. @@ -14,18 +14,19 @@ * limitations under the License. */ -#import #import +#import + #import "FBAppCall.h" -#import "FBShareDialogParams.h" #import "FBOpenGraphActionShareDialogParams.h" +#import "FBShareDialogParams.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. */ @@ -40,7 +41,7 @@ typedef enum { /*! @typedef - + @abstract Defines a handler that will be called in response to the native share dialog being displayed. */ @@ -48,22 +49,22 @@ typedef void (^FBOSIntegratedShareDialogHandler)(FBOSIntegratedShareDialogResult /*! @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, @@ -72,10 +73,13 @@ NSError *error); /*! @class FBDialogs - + @abstract Provides methods to display native (i.e., non-Web-based) dialogs to the user. - Currently the iOS 6 sharing dialog is supported. + + @discussion + If you are building an app with a urlSchemeSuffix, you should also set the appropriate + plist entry. See `[FBSettings defaultUrlSchemeSuffix]`. */ @interface FBDialogs : NSObject @@ -88,19 +92,19 @@ NSError *error); 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) */ @@ -119,20 +123,20 @@ NSError *error); 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) */ @@ -152,24 +156,24 @@ NSError *error); 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) */ @@ -186,28 +190,28 @@ NSError *error); 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; /*! @abstract - Determines whether a call to presentFBShareDialogWithTarget: will successfully + 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 - presentFBShareDialogWithParams method will return a non-nil FBAppCall for the same + presentShareDialogWithParams method will return a non-nil FBAppCall for the same params. And vice versa. */ + (BOOL)canPresentShareDialogWithParams:(FBShareDialogParams *)params; @@ -217,7 +221,7 @@ NSError *error); 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 @@ -226,21 +230,21 @@ NSError *error); 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 - canPresetFBShareDialogWithParams method is also returning YES for the same params. + canPresentShareDialogWithParams method is also returning YES for the same params. */ + (FBAppCall *)presentShareDialogWithParams:(FBShareDialogParams *)params clientState:(NSDictionary *)clientState @@ -251,7 +255,7 @@ NSError *error); 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 @@ -260,17 +264,17 @@ NSError *error); 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 - canPresetFBShareDialogWithParams method is also returning YES for the same params. + canPresentShareDialogWithParams method is also returning YES for the same params. */ + (FBAppCall *)presentShareDialogWithLink:(NSURL *)link handler:(FBDialogAppCallCompletionHandler)handler; @@ -280,7 +284,7 @@ NSError *error); 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 @@ -289,19 +293,19 @@ NSError *error); 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 - canPresetFBShareDialogWithParams method is also returning YES for the same params. + canPresentShareDialogWithParams method is also returning YES for the same params. */ + (FBAppCall *)presentShareDialogWithLink:(NSURL *)link name:(NSString *)name @@ -312,7 +316,7 @@ NSError *error); 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 @@ -321,29 +325,29 @@ NSError *error); 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 - canPresetFBShareDialogWithParams method is also returning YES for the same params. + canPresentShareDialogWithParams method is also returning YES for the same params. */ + (FBAppCall *)presentShareDialogWithLink:(NSURL *)link name:(NSString *)name @@ -355,17 +359,17 @@ NSError *error); /*! @abstract - Determines whether a call to presentFBShareDialogWithOpenGraphActionParams:clientState:handler: + 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 - presentFBShareDialogWithOpenGraphActionParams method will return a non-nil FBAppCall for + presentShareDialogWithOpenGraphActionParams method will return a non-nil FBAppCall for the same params. And vice versa. */ + (BOOL)canPresentShareDialogWithOpenGraphActionParams:(FBOpenGraphActionShareDialogParams *)params; @@ -375,7 +379,7 @@ NSError *error); 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 @@ -384,21 +388,21 @@ NSError *error); 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 - canPresentFBShareDialogWithOpenGraphActionParams method is also returning YES for the same params. + canPresentShareDialogWithOpenGraphActionParams method is also returning YES for the same params. */ + (FBAppCall *)presentShareDialogWithOpenGraphActionParams:(FBOpenGraphActionShareDialogParams *)params clientState:(NSDictionary *)clientState @@ -409,7 +413,7 @@ NSError *error); 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 @@ -418,24 +422,24 @@ NSError *error); 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 - canPresentFBShareDialogWithOpenGraphActionParams method is also returning YES for the same params. + canPresentShareDialogWithOpenGraphActionParams method is also returning YES for the same params. */ + (FBAppCall *)presentShareDialogWithOpenGraphAction:(id)action actionType:(NSString *)actionType @@ -447,7 +451,7 @@ NSError *error); 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 @@ -456,28 +460,28 @@ NSError *error); 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 - canPresentFBShareDialogWithOpenGraphActionParams method is also returning YES for the same params. + canPresentShareDialogWithOpenGraphActionParams method is also returning YES for the same params. */ + (FBAppCall *)presentShareDialogWithOpenGraphAction:(id)action actionType:(NSString *)actionType diff --git a/src/ios/headers/FBDialogsData.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogsData.h similarity index 99% rename from src/ios/headers/FBDialogsData.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogsData.h index 55ec5ee69..bffbc46c3 100644 --- a/src/ios/headers/FBDialogsData.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogsData.h @@ -6,7 +6,7 @@ * 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. diff --git a/src/ios/headers/FBDialogsParams.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogsParams.h similarity index 99% rename from src/ios/headers/FBDialogsParams.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogsParams.h index 32581bf25..9197de598 100644 --- a/src/ios/headers/FBDialogsParams.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogsParams.h @@ -6,7 +6,7 @@ * 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. @@ -18,7 +18,7 @@ /*! @class FBDialogsParams - + @abstract This object is used as a base class for parameters passed to native dialogs that open in the Facebook app. diff --git a/src/ios/headers/FBError.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBError.h similarity index 93% rename from src/ios/headers/FBError.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBError.h index 30db1df5c..70ef2a4a4 100644 --- a/src/ios/headers/FBError.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBError.h @@ -6,7 +6,7 @@ * 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. @@ -46,13 +46,13 @@ extern NSString *const FBErrorParsedJSONResponseKey; extern NSString *const FBErrorHTTPStatusCodeKey; /*! - @abstract Error codes returned by the Facebook SDK in NSError. - + @abstract Error codes returned by the Facebook SDK in NSError. + @discussion These are valid only in the scope of FacebookSDKDomain. */ typedef enum FBErrorCode { - /*! + /*! Like nil for FBErrorCode values, represents an error code that has not been initialized yet. */ @@ -60,7 +60,7 @@ typedef enum FBErrorCode { /// The operation failed because it was cancelled. FBErrorOperationCancelled, - + /// A login attempt failed FBErrorLoginFailedOrCancelled, @@ -72,7 +72,7 @@ typedef enum FBErrorCode { 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. */ @@ -80,79 +80,89 @@ typedef enum FBErrorCode { /// 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 FBInsights class - FBErrorInsights, - + + /// 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, } FBErrorCode; /*! @abstract Error codes returned by the Facebook SDK in NSError. - + @discussion These are valid only in the scope of FacebookNativeApplicationDomain. */ typedef enum 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, - + } FBNativeApplicationErrorCode; /*! @typedef FBErrorCategory enum - + @abstract Indicates the Facebook SDK classification for the error - + @discussion */ typedef enum { @@ -173,7 +183,7 @@ typedef enum { 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 + /*! 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. */ @@ -187,7 +197,7 @@ typedef enum { extern NSString *const FBErrorInnerErrorKey; /*! - The key in the userInfo NSDictionary of NSError where you can find + The key in the userInfo NSDictionary of NSError where you can find the session associated with the error (if any). */ extern NSString *const FBErrorSessionKey; @@ -199,7 +209,7 @@ extern NSString *const FBErrorSessionKey; extern NSString *const FBErrorUnprocessedURLKey; /*! - The key in the userInfo NSDictionary of NSError for unsuccessful + 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*. */ @@ -241,6 +251,13 @@ extern NSString *const FBErrorLoginFailedReasonUserCancelledValue; */ 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. + */ +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 @@ -276,7 +293,7 @@ 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 + iOS 6 with the Facebook account. Indicates the request for new permissions has failed because the user cancelled. */ extern NSString *const FBErrorReauthorizeFailedReasonUserCancelledSystem; @@ -298,7 +315,7 @@ 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 +`FBErrorDialogReasonKey` key. Indicates that a native dialog is not supported in the current OS. */ extern NSString *const FBErrorDialogNotSupported; @@ -306,7 +323,7 @@ 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. + displayed because it is not appropriate for the current session. */ extern NSString *const FBErrorDialogInvalidForSession; @@ -320,9 +337,9 @@ 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 + 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) */ extern NSString *const FBErrorDialogInvalidOpenGraphObject; @@ -330,7 +347,7 @@ 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 + displayed because the parameters for sharing an Open Graph action were not configured. The parameters must include an 'action', 'actionType', and 'previewPropertyName'. */ @@ -338,9 +355,9 @@ extern NSString *const FBErrorDialogInvalidOpenGraphActionParameters; /*! The key in the userInfo NSDictionary of NSError for errors - encountered with `FBInsights` operations (error.code equals FBErrorInsights). + encountered with `FBAppEvents` operations (error.code equals FBErrorAppEvents). */ -extern NSString *const FBErrorInsightsReasonKey; +extern NSString *const FBErrorAppEventsReasonKey; // Exception strings raised by the Facebook SDK diff --git a/src/ios/headers/FBErrorUtility.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBErrorUtility.h similarity index 99% rename from src/ios/headers/FBErrorUtility.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBErrorUtility.h index ff6434f25..61ae2cae7 100644 --- a/src/ios/headers/FBErrorUtility.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBErrorUtility.h @@ -17,23 +17,23 @@ /*! @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; @@ -41,13 +41,13 @@ /*! @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; diff --git a/src/ios/headers/FBFrictionlessRecipientCache.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFrictionlessRecipientCache.h similarity index 96% rename from src/ios/headers/FBFrictionlessRecipientCache.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFrictionlessRecipientCache.h index 115da3a42..09f8d9d01 100644 --- a/src/ios/headers/FBFrictionlessRecipientCache.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFrictionlessRecipientCache.h @@ -1,12 +1,12 @@ /* - * Copyright 2013 Facebook + * 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. @@ -14,20 +14,21 @@ * limitations under the License. */ #import -#import "FBWebDialogs.h" -#import "FBRequest.h" + #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 + 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 @@ -43,9 +44,9 @@ /*! @abstract - Checks to see if a given user or FBID for a user is known to be enabled for + 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; @@ -54,7 +55,7 @@ @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 */ @@ -63,7 +64,7 @@ /*! @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 */ @@ -72,10 +73,10 @@ /*! @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. diff --git a/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFrictionlessRequestSettings.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFrictionlessRequestSettings.h new file mode 100644 index 000000000..7f171d973 --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFrictionlessRequestSettings.h @@ -0,0 +1,85 @@ +/* + * 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; + +/** + * init the frictionless cache object + */ +- (id)init; + +@end diff --git a/src/ios/headers/FBFriendPickerViewController.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFriendPickerViewController.h similarity index 92% rename from src/ios/headers/FBFriendPickerViewController.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFriendPickerViewController.h index 35ac148c1..6c8af5b53 100644 --- a/src/ios/headers/FBFriendPickerViewController.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFriendPickerViewController.h @@ -4,9 +4,9 @@ * 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. @@ -15,19 +15,20 @@ */ #import + +#import "FBCacheDescriptor.h" #import "FBGraphUser.h" #import "FBSession.h" -#import "FBCacheDescriptor.h" #import "FBViewController.h" @protocol FBFriendPickerDelegate; @class FBFriendPickerCacheDescriptor; -/*! +/*! @typedef FBFriendSortOrdering enum - + @abstract Indicates the order in which friends should be listed in the friend picker. - + @discussion */ typedef enum { @@ -37,11 +38,11 @@ typedef enum { FBFriendSortByLastName } FBFriendSortOrdering; -/*! +/*! @typedef FBFriendDisplayOrdering enum - + @abstract Indicates whether friends should be displayed first-name-first or last-name-first. - + @discussion */ typedef enum { @@ -52,25 +53,25 @@ typedef enum { } FBFriendDisplayOrdering; -/*! +/*! @class - - @abstract - The `FBFriendPickerViewController` class creates a controller object that manages + + @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` + 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 @@ -124,8 +125,13 @@ typedef enum { @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, retain, readonly) NSArray *selection; +@property (nonatomic, copy) NSArray *selection; /*! @abstract @@ -156,7 +162,7 @@ typedef enum { /*! @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. */ @@ -165,20 +171,20 @@ typedef enum { /*! @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. - + 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. @@ -188,7 +194,7 @@ typedef enum { /*! @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. @@ -203,40 +209,40 @@ typedef enum { /*! @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` + 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` + 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. + + @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 + + @abstract + The `FBFriendPickerDelegate` protocol defines the methods used to receive event notifications and allow for deeper control of the view. */ @@ -244,11 +250,11 @@ typedef enum { @optional /*! - @abstract + @abstract Tells the delegate that data has been loaded. @discussion - The object's `tableView` property is automatically + 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. @@ -267,7 +273,7 @@ typedef enum { /*! @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. diff --git a/src/ios/headers/FBGraphLocation.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphLocation.h similarity index 95% rename from src/ios/headers/FBGraphLocation.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphLocation.h index ad5a91f77..7f71ce653 100644 --- a/src/ios/headers/FBGraphLocation.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphLocation.h @@ -4,9 +4,9 @@ * 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. @@ -15,18 +15,19 @@ */ #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 + 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. */ @@ -66,7 +67,7 @@ @property @abstract Typed access to a location's latitude. */ -@property (retain, nonatomic) NSNumber *latitude; +@property (retain, nonatomic) NSNumber *latitude; /*! @property diff --git a/src/ios/headers/FBGraphObject.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphObject.h similarity index 93% rename from src/ios/headers/FBGraphObject.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphObject.h index d5e4831bb..74460f6f3 100644 --- a/src/ios/headers/FBGraphObject.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphObject.h @@ -6,7 +6,7 @@ * 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. @@ -21,40 +21,40 @@ /*! @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 + 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. - + 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
  • +
  • Simple and natural extension to Objective-C
- The FBGraphObject at its core is a duck typed (if it walks/swims/quacks... + 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: + 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=%@ %@", 
+   NSLog(@"place=%@, city=%@, state=%@, lat long=%@ %@",
      place.name,
      place.location.city,
      place.location.state,
@@ -62,7 +62,7 @@
      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: @@ -71,8 +71,8 @@ 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 + + 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:
@@ -81,14 +81,14 @@
  @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 + + 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| ...
@@ -100,28 +100,28 @@
      Apparent impl --> |NSMutableDictionary||FBGraphObject (protocol)| |FBGraphObject (class methods)|
                        *-------------------**------------------------* *-----------------------------*
  
- - The *Facade* layer is meant for typed access to graph objects. The *Transparent impl* layer (more + + 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 + + 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. */ @@ -137,7 +137,7 @@ @method @abstract Returns a property on this `FBGraphObject`. - + @param aKey name of the property to return */ - (id)objectForKey:(id)aKey; @@ -170,7 +170,7 @@ /*! @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 + 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. */ @@ -180,14 +180,14 @@ /*! @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 + `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 @@ -206,16 +206,16 @@ @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 + 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 + 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; @@ -238,7 +238,7 @@ @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 @@ -258,7 +258,7 @@ 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 diff --git a/src/ios/headers/FBGraphPlace.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphPlace.h similarity index 97% rename from src/ios/headers/FBGraphPlace.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphPlace.h index ffa193d1b..40e144fd0 100644 --- a/src/ios/headers/FBGraphPlace.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphPlace.h @@ -4,9 +4,9 @@ * 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. @@ -15,19 +15,20 @@ */ #import + #import "FBGraphLocation.h" #import "FBGraphObject.h" /*! - @protocol - + @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 + 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. */ diff --git a/src/ios/headers/FBGraphUser.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphUser.h similarity index 96% rename from src/ios/headers/FBGraphUser.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphUser.h index c9334fb30..645ea1d91 100644 --- a/src/ios/headers/FBGraphUser.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphUser.h @@ -4,9 +4,9 @@ * 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. @@ -15,19 +15,20 @@ */ #import -#import "FBGraphPlace.h" + #import "FBGraphObject.h" +#import "FBGraphPlace.h" /*! - @protocol - + @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 + 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. */ @@ -64,25 +65,25 @@ @property (retain, nonatomic) NSString *last_name; /*! - @property + @property @abstract Typed access to the user's profile URL. */ @property (retain, nonatomic) NSString *link; /*! - @property + @property @abstract Typed access to the user's username. */ @property (retain, nonatomic) NSString *username; /*! - @property + @property @abstract Typed access to the user's birthday. */ @property (retain, nonatomic) NSString *birthday; /*! - @property + @property @abstract Typed access to the user's current city. */ @property (retain, nonatomic) id location; diff --git a/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBInsights.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBInsights.h new file mode 100644 index 000000000..d1a35dee1 --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBInsights.h @@ -0,0 +1,57 @@ +/* + * 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" + +/*! + @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; + +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/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginDialog.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginDialog.h new file mode 100644 index 000000000..5f8f5b5f1 --- /dev/null +++ b/src/ios/frameworks/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; +} + +-(id) 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/src/ios/headers/FBLoginView.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginView.h similarity index 94% rename from src/ios/headers/FBLoginView.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginView.h index 60488d2d8..4f75e3a11 100644 --- a/src/ios/headers/FBLoginView.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginView.h @@ -4,9 +4,9 @@ * 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. @@ -15,8 +15,9 @@ */ #import -#import "FBSession.h" + #import "FBGraphUser.h" +#import "FBSession.h" @protocol FBLoginViewDelegate; @@ -24,10 +25,10 @@ @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. */ @interface FBLoginView : UIView @@ -35,7 +36,7 @@ /*! @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. */ @@ -45,7 +46,7 @@ @abstract The read permissions to request if the user logs in via this view. The basic_info permission must be explicitly requested at first login, and is no longer inferred, (subject to an active migration.) - + @discussion Note, that if read permissions are specified, then publish permissions should not be specified. */ @@ -54,7 +55,7 @@ /*! @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 @@ -68,6 +69,15 @@ */ @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 FBSessionLoginBehaviorUseSystemAccountIfPresent. + */ +@property (nonatomic) FBSessionLoginBehavior loginBehavior; + /*! @abstract @@ -77,13 +87,13 @@ /*! @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. - + 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. */ @@ -91,28 +101,28 @@ /*! @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. - + */ - (id)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. - + authentication flow. + @param defaultAudience An audience for published posts; note that FBSessionDefaultAudienceNone is not valid for permission requests that include publish or manage permissions. - + */ - (id)initWithPublishPermissions:(NSArray *)publishPermissions defaultAudience:(FBSessionDefaultAudience)defaultAudience; @@ -126,10 +136,10 @@ @end /*! - @protocol - + @protocol + @abstract - The `FBLoginViewDelegate` protocol defines the methods used to receive event + The `FBLoginViewDelegate` protocol defines the methods used to receive event notifications from `FBLoginView` objects. */ @protocol FBLoginViewDelegate @@ -139,7 +149,7 @@ /*! @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; @@ -149,7 +159,7 @@ 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 @@ -158,7 +168,7 @@ /*! @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; @@ -166,7 +176,7 @@ /*! @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/ diff --git a/src/ios/headers/FBNativeDialogs.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBNativeDialogs.h similarity index 99% rename from src/ios/headers/FBNativeDialogs.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBNativeDialogs.h index 70ae9733d..f8723fc5c 100644 --- a/src/ios/headers/FBNativeDialogs.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBNativeDialogs.h @@ -6,7 +6,7 @@ * 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. @@ -14,11 +14,12 @@ * limitations under the License. */ -#import #import +#import + #import "FBAppCall.h" -#import "FBShareDialogParams.h" #import "FBOpenGraphActionShareDialogParams.h" +#import "FBShareDialogParams.h" @class FBSession; @protocol FBOpenGraphAction; @@ -27,7 +28,7 @@ /*! @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. @@ -44,7 +45,7 @@ __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. @@ -54,7 +55,7 @@ __attribute__((deprecated)); /*! @class FBNativeDialogs - + @abstract Please note that `FBNativeDialogs` has been deprecated, please migrate your code to use `FBDialogs`. diff --git a/src/ios/headers/FBOpenGraphAction.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphAction.h similarity index 96% rename from src/ios/headers/FBOpenGraphAction.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphAction.h index 5a4ca1997..adc5ef45c 100644 --- a/src/ios/headers/FBOpenGraphAction.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphAction.h @@ -4,9 +4,9 @@ * 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/xlicenses/LICENSE-2.0 - + * + * 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. @@ -15,6 +15,7 @@ */ #import + #import "FBGraphObject.h" @protocol FBGraphPlace; @@ -22,12 +23,12 @@ /*! @protocol - + @abstract - The `FBOpenGraphAction` protocol is the base protocol for use in posting and retrieving Open Graph actions. + 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. diff --git a/src/ios/headers/FBOpenGraphActionShareDialogParams.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphActionShareDialogParams.h similarity index 94% rename from src/ios/headers/FBOpenGraphActionShareDialogParams.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphActionShareDialogParams.h index 141ab1b6b..89f49d796 100644 --- a/src/ios/headers/FBOpenGraphActionShareDialogParams.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphActionShareDialogParams.h @@ -1,12 +1,12 @@ /* - * Copyright 2013 Facebook + * 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. @@ -15,17 +15,17 @@ */ #import + #import "FBDialogsParams.h" +#import "FBOpenGraphAction.h" extern NSString *const FBPostObject; -@protocol FBOpenGraphAction; - /*! @class FBOpenGraphActionShareDialogParams - + @abstract - This object is used to encapsulate state for parameters to an Open Graph share + This object is used to encapsulate state for parameters to an Open Graph share dialog that opens in the Facebook app. */ @interface FBOpenGraphActionShareDialogParams : FBDialogsParams diff --git a/src/ios/headers/FBOpenGraphObject.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphObject.h similarity index 97% rename from src/ios/headers/FBOpenGraphObject.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphObject.h index 43b3af1f0..be73a3bd7 100644 --- a/src/ios/headers/FBOpenGraphObject.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphObject.h @@ -4,9 +4,9 @@ * 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/xlicenses/LICENSE-2.0 - + * + * 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. @@ -15,16 +15,17 @@ */ #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. diff --git a/src/ios/headers/FBPlacePickerViewController.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBPlacePickerViewController.h similarity index 97% rename from src/ios/headers/FBPlacePickerViewController.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBPlacePickerViewController.h index 23c56767f..735cf9226 100644 --- a/src/ios/headers/FBPlacePickerViewController.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBPlacePickerViewController.h @@ -6,7 +6,7 @@ * 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. @@ -14,33 +14,34 @@ * limitations under the License. */ -#import #import +#import + +#import "FBCacheDescriptor.h" #import "FBGraphPlace.h" #import "FBSession.h" -#import "FBCacheDescriptor.h" #import "FBViewController.h" @protocol FBPlacePickerDelegate; /*! @class FBPlacePickerViewController - + @abstract - The `FBPlacePickerViewController` class creates a controller object that manages + 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 + 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 @@ -124,7 +125,7 @@ /*! @abstract Initializes a place picker view controller. - + @param aDecoder An unarchiver object. */ - (id)initWithCoder:(NSCoder *)aDecoder; @@ -132,7 +133,7 @@ /*! @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. */ @@ -141,12 +142,12 @@ /*! @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; @@ -155,8 +156,8 @@ @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. @@ -166,7 +167,7 @@ /*! @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. @@ -175,21 +176,21 @@ /*! @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` + 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. + @param fieldsForRequest Addtional fields to fetch when making the Graph API call to get place data. */ + (FBCacheDescriptor*)cacheDescriptorWithLocationCoordinate:(CLLocationCoordinate2D)locationCoordinate radiusInMeters:(NSInteger)radiusInMeters @@ -200,10 +201,10 @@ @end /*! - @protocol - + @protocol + @abstract - The `FBPlacePickerDelegate` protocol defines the methods used to receive event + The `FBPlacePickerDelegate` protocol defines the methods used to receive event notifications and allow for deeper control of the view. */ @@ -215,10 +216,10 @@ Tells the delegate that data has been loaded. @discussion - The object's `tableView` property is automatically + 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; @@ -226,7 +227,7 @@ /*! @abstract Tells the delegate that the selection has changed. - + @param placePicker The place picker view controller whose selection changed. */ - (void)placePickerViewControllerSelectionDidChange:(FBPlacePickerViewController *)placePicker; @@ -234,10 +235,10 @@ /*! @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. */ diff --git a/src/ios/headers/FBProfilePictureView.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBProfilePictureView.h similarity index 91% rename from src/ios/headers/FBProfilePictureView.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBProfilePictureView.h index d876c42ea..c1f31c6c2 100644 --- a/src/ios/headers/FBProfilePictureView.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBProfilePictureView.h @@ -4,9 +4,9 @@ * 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. @@ -16,34 +16,34 @@ #import -/*! +/*! @typedef FBProfilePictureCropping enum - - @abstract + + @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. - + 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 + 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. + of https://developers.facebook.com/docs/reference/api. */ @interface FBProfilePictureView : UIView @@ -69,11 +69,11 @@ typedef enum { /*! @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. */ -- (id)initWithProfileID:(NSString*)profileID +- (id)initWithProfileID:(NSString*)profileID pictureCropping:(FBProfilePictureCropping)pictureCropping; diff --git a/src/ios/headers/FBRequest.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBRequest.h similarity index 94% rename from src/ios/headers/FBRequest.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBRequest.h index e7355919f..187bd7a63 100644 --- a/src/ios/headers/FBRequest.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBRequest.h @@ -14,15 +14,16 @@ * limitations under the License. */ -#import #import -#import "FBRequestConnection.h" +#import + #import "FBGraphObject.h" -#import "FBOpenGraphObject.h" #import "FBOpenGraphAction.h" +#import "FBOpenGraphObject.h" +#import "FBRequestConnection.h" /*! The base URL used for graph requests */ -extern NSString* const FBGraphBasePath; +extern NSString* const FBGraphBasePath __attribute__((deprecated)); // up-front decl's @protocol FBRequestDelegate; @@ -203,7 +204,7 @@ typedef NSUInteger FBRequestState __attribute__((deprecated)); 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; +@property (nonatomic, retain, readonly) NSMutableDictionary *parameters; /*! @abstract @@ -214,7 +215,7 @@ typedef NSUInteger FBRequestState __attribute__((deprecated)); the object initiliazation. Make any required modifications prior to sending the request. */ -@property(nonatomic, retain) FBSession *session; +@property (nonatomic, retain) FBSession *session; /*! @abstract @@ -225,7 +226,7 @@ typedef NSUInteger FBRequestState __attribute__((deprecated)); the object initiliazation. Make any required modifications prior to sending the request. */ -@property(nonatomic, copy) NSString *graphPath; +@property (nonatomic, copy) NSString *graphPath; /*! @abstract @@ -239,7 +240,7 @@ typedef NSUInteger FBRequestState __attribute__((deprecated)); 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; +@property (nonatomic, copy) NSString *restMethod; /*! @abstract @@ -250,7 +251,7 @@ typedef NSUInteger FBRequestState __attribute__((deprecated)); the object initiliazation. Make any required modifications prior to sending the request. */ -@property(nonatomic, copy) NSString *HTTPMethod; +@property (nonatomic, copy) NSString *HTTPMethod; /*! @abstract @@ -261,7 +262,7 @@ typedef NSUInteger FBRequestState __attribute__((deprecated)); the object initiliazation. Make any required modifications prior to sending the request. */ -@property(nonatomic, retain) id graphObject; +@property (nonatomic, retain) id graphObject; /*! @methodgroup Instance methods @@ -278,6 +279,7 @@ typedef NSUInteger FBRequestState __attribute__((deprecated)); 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; @@ -381,38 +383,38 @@ typedef NSUInteger FBRequestState __attribute__((deprecated)); /*! @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 + @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 + @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 @@ -453,99 +455,101 @@ typedef NSUInteger FBRequestState __attribute__((deprecated)); /*! @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, + + @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. If the session is not open, then the appID|clientToken are used to construct the access - token for the request. - - @discussion - This method will thrown an exception if either <[FBSettings defaultAppID]> or <[FBSettings clientToken]> are `nil`. The appID won't be nil when the pList - includes the appID, or if it's explicitly set. The clientToken needs to be set via <[FBSettings setClientToken:]>. - + 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 itself returning `nil` indicates that either the user has opted-out (via iOS) from Ad Tracking, or a specific Facebook user cannot - be identified. + + 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 @@ -554,36 +558,36 @@ typedef NSUInteger FBRequestState __attribute__((deprecated)); /*! @method - + @abstract - Returns a newly initialized request object that can be used to create a user owned + 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. @@ -600,36 +604,36 @@ typedef NSUInteger FBRequestState __attribute__((deprecated)); /*! @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. @@ -646,21 +650,21 @@ typedef NSUInteger FBRequestState __attribute__((deprecated)); /*! @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; diff --git a/src/ios/headers/FBRequestConnection.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBRequestConnection.h similarity index 80% rename from src/ios/headers/FBRequestConnection.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBRequestConnection.h index 8e7ec6e1d..140267f9b 100644 --- a/src/ios/headers/FBRequestConnection.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBRequestConnection.h @@ -14,8 +14,9 @@ * limitations under the License. */ -#import #import +#import + #import "FBGraphObject.h" // up-front decl's @@ -24,6 +25,52 @@ @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. @@ -54,7 +101,7 @@ extern NSString *const FBNonJSONResponseProperty; @param error The `NSError` representing any error that occurred. */ -typedef void (^FBRequestHandler)(FBRequestConnection *connection, +typedef void (^FBRequestHandler)(FBRequestConnection *connection, id result, NSError *error); @@ -65,7 +112,7 @@ typedef void (^FBRequestHandler)(FBRequestConnection *connection, The `FBRequestConnection` represents a single connection to Facebook to service a request. @discussion - The request settings are encapsulated in a reusable object. The + 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. @@ -93,17 +140,17 @@ typedef void (^FBRequestHandler)(FBRequestConnection *connection, @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 + 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. */ - + - (id)initWithTimeout:(NSTimeInterval)timeout; // properties @@ -114,13 +161,13 @@ typedef void (^FBRequestHandler)(FBRequestConnection *connection, @discussion This property can be used to create a `NSURLRequest` without using - `FBRequestConnection` to send that request. It is legal to set this property + `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; +@property (nonatomic, retain, readwrite) NSMutableURLRequest *urlRequest; /*! @abstract @@ -133,7 +180,21 @@ typedef void (^FBRequestHandler)(FBRequestConnection *connection, 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; +@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 @@ -141,17 +202,17 @@ typedef void (^FBRequestHandler)(FBRequestConnection *connection, /*! @method - + @abstract - This method adds an object to this connection and then calls - on the connection. - + This method adds an object to this connection. + @discussion - The completion handler is retained until the block is called upon the + 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; @@ -160,8 +221,7 @@ typedef void (^FBRequestHandler)(FBRequestConnection *connection, @method @abstract - This method adds an object to this connection and then calls - on the connection. + This method adds an object to this connection. @discussion The completion handler is retained until the block is called upon the @@ -171,16 +231,40 @@ typedef void (^FBRequestHandler)(FBRequestConnection *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. + @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/ ). + 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 */ @@ -189,22 +273,22 @@ typedef void (^FBRequestHandler)(FBRequestConnection *connection, @method @abstract - This method starts a connection with the server and is capable of handling all of the + 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 + 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 + - `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; @@ -218,7 +302,7 @@ typedef void (^FBRequestHandler)(FBRequestConnection *connection, @discussion Synchronously calls any handlers indicating the request was cancelled. Cancel - does not guarantee that the request-related processing will cease. It + 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. @@ -227,39 +311,39 @@ typedef void (^FBRequestHandler)(FBRequestConnection *connection, /*! @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 + 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 + 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 + 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. */ @@ -268,11 +352,11 @@ typedef void (^FBRequestHandler)(FBRequestConnection *connection, /*! @method - + @abstract - Simple method to make a graph API post of a status update. The request + 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. */ @@ -281,15 +365,15 @@ typedef void (^FBRequestHandler)(FBRequestConnection *connection, /*! @method - + @abstract - Simple method to make a graph API post of a status update. The request + 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 + @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 + @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. */ @@ -300,26 +384,26 @@ typedef void (^FBRequestHandler)(FBRequestConnection *connection, /*! @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 + + 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 + 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. @@ -332,33 +416,32 @@ typedef void (^FBRequestHandler)(FBRequestConnection *connection, /*! @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. If the session is not open, then the appID|clientToken are used to construct the access - token for the request. - + If `nil`, then the activeSession is used. + @discussion - This method will thrown an exception if either <[FBSettings defaultAppID]> or <[FBSettings clientToken]> are `nil`. The appID won't be nil when the pList - includes the appID, or if it's explicitly set. The clientToken needs to be set via <[FBSettings setClientToken:]>. - + 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 itself returning `nil` indicates that either the user has opted-out (via iOS) from Ad Tracking, or a specific Facebook user cannot - be identified. - + + 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 @@ -366,14 +449,14 @@ typedef void (^FBRequestHandler)(FBRequestConnection *connection, /*! @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 + 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. */ @@ -382,12 +465,12 @@ typedef void (^FBRequestHandler)(FBRequestConnection *connection, /*! @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. + 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. */ @@ -396,38 +479,41 @@ typedef void (^FBRequestHandler)(FBRequestConnection *connection, /*! @method - + @abstract - Simple method to post an object using the graph API, creates an object for + 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 @@ -437,15 +523,15 @@ typedef void (^FBRequestHandler)(FBRequestConnection *connection, /*! @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 @@ -453,13 +539,13 @@ typedef void (^FBRequestHandler)(FBRequestConnection *connection, /*! @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. @@ -478,13 +564,13 @@ typedef void (^FBRequestHandler)(FBRequestConnection *connection, /*! @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. @@ -494,13 +580,13 @@ typedef void (^FBRequestHandler)(FBRequestConnection *connection, /*! @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. @@ -519,18 +605,18 @@ typedef void (^FBRequestHandler)(FBRequestConnection *connection, /*! @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. */ diff --git a/src/ios/headers/FBSession.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSession.h similarity index 91% rename from src/ios/headers/FBSession.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSession.h index e807488e2..63b01877d 100644 --- a/src/ios/headers/FBSession.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSession.h @@ -14,13 +14,13 @@ * limitations under the License. */ -#import #import +#import // up-front decl's +@class FBAccessTokenData; @class FBSession; @class FBSessionTokenCachingStrategy; -@class FBAccessTokenData; #define FB_SESSIONSTATETERMINALBIT (1 << 8) @@ -42,11 +42,11 @@ extern NSString *const FBSessionDidBecomeOpenActiveSessionNotification; /*! NSNotificationCenter name indicating that there is no longer an open active session */ extern NSString *const FBSessionDidBecomeClosedActiveSessionNotification; -/*! +/*! @typedef FBSessionState enum - + @abstract Passed to handler block each time a session state changes - + @discussion */ typedef enum { @@ -59,15 +59,15 @@ typedef enum { /*! 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 + /*! 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; @@ -78,22 +78,22 @@ typedef enum { /*! helper macro to test for states that are terminal */ #define FB_ISSESSIONSTATETERMINAL(state) (0 != (state & FB_SESSIONSTATETERMINALBIT)) -/*! +/*! @typedef FBSessionLoginBehavior enum - - @abstract + + @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 + 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 + 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. - + 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 @@ -112,13 +112,13 @@ typedef enum { /*! @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 + 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. */ @@ -135,11 +135,11 @@ typedef enum { /*! @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 @@ -161,42 +161,54 @@ typedef enum { 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, +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 + + @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 */ @@ -207,20 +219,20 @@ typedef void (^FBSessionRenewSystemCredentialsHandler)(ACAccountCredentialRenewR @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. + 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 @@ -232,7 +244,7 @@ typedef void (^FBSessionRenewSystemCredentialsHandler)(ACAccountCredentialRenewR /*! @method - @abstract + @abstract Returns a newly initialized Facebook session with default values for the parameters to . */ @@ -240,15 +252,15 @@ typedef void (^FBSessionRenewSystemCredentialsHandler)(ACAccountCredentialRenewR /*! @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. The basic_info permission must be explicitly requested at first login, and is no + authentication flow. The basic_info permission must be explicitly requested at first login, and is no longer inferred, (subject to an active migration.) The default is nil. - + @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. @@ -258,18 +270,18 @@ typedef void (^FBSessionRenewSystemCredentialsHandler)(ACAccountCredentialRenewR /*! @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. The basic_info permission must be explicitly requested at first login, and is no longer inferred, (subject to an active migration.) The default is nil. @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 the plist. 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. @@ -281,19 +293,19 @@ typedef void (^FBSessionRenewSystemCredentialsHandler)(ACAccountCredentialRenewR /*! @method - + @abstract - Following are the descriptions of the arguments along with their + 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. The basic_info permission must be explicitly requested at first login, and is no longer inferred, (subject to an active migration.) The default is nil. @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 the plist. 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 @@ -305,57 +317,57 @@ typedef void (^FBSessionRenewSystemCredentialsHandler)(ACAccountCredentialRenewR urlSchemeSuffix:(NSString*)urlSchemeSuffix tokenCacheStrategy:(FBSessionTokenCachingStrategy*)tokenCachingStrategy; -// instance readonly properties +// instance readonly properties /*! @abstract Indicates whether the session is open and ready for use. */ -@property(readonly) BOOL isOpen; +@property (readonly) BOOL isOpen; /*! @abstract Detailed session state */ -@property(readonly) FBSessionState state; +@property (readonly) FBSessionState state; /*! @abstract Identifies the Facebook app which the session object represents. */ -@property(readonly, copy) NSString *appID; +@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; +@property (readonly, copy) NSString *urlSchemeSuffix; -/*! @abstract The access token for the session object. +/*! @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. +/*! @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; +@property (readonly, copy) NSArray *permissions; -/*! @abstract Specifies the login type used to authenticate the user. +/*! @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; +@property (readonly, copy) FBAccessTokenData *accessTokenData; /*! @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 + 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 @@ -365,23 +377,23 @@ __attribute__((deprecated)); */ - (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 + 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. @@ -391,21 +403,21 @@ __attribute__((deprecated)); /*! @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 + 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). - + 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. */ @@ -426,13 +438,13 @@ __attribute__((deprecated)); /*! @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) @@ -445,12 +457,12 @@ __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. */ @@ -461,14 +473,14 @@ __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. */ @@ -480,14 +492,14 @@ __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 + 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 @@ -496,16 +508,16 @@ __attribute__((deprecated)); /*! @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 + 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 @@ -517,7 +529,7 @@ __attribute__((deprecated)); 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; @@ -530,6 +542,19 @@ __attribute__((deprecated)); */ - (void)handleDidBecomeActive; +/*! + @abstract + Assign the block to be invoked for session state changes. + + @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; + /*! @methodgroup Class methods */ @@ -539,22 +564,22 @@ __attribute__((deprecated)); 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 + + 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 + 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 + 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 were the session + 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; @@ -564,13 +589,13 @@ __attribute__((deprecated)); 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 + 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 + 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. @@ -578,20 +603,20 @@ __attribute__((deprecated)); @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 + 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 were the session + 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 seperate 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 + 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 @@ -604,29 +629,29 @@ __attribute__((deprecated)); 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. The basic_info permission must be explicitly requested at first login, and is no longer + authentication flow. The basic_info permission must be explicitly requested at first login, and is no longer inferred, (subject to an active migration.) 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 were the session + 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 @@ -637,31 +662,31 @@ __attribute__((deprecated)); 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.) + + @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 were the session + 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 @@ -672,7 +697,7 @@ __attribute__((deprecated)); @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 @@ -685,9 +710,9 @@ __attribute__((deprecated)); @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. @@ -696,10 +721,10 @@ __attribute__((deprecated)); /*! @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. @@ -708,7 +733,7 @@ __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. @@ -724,7 +749,7 @@ __attribute__((deprecated)); 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)); @@ -742,17 +767,17 @@ __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. */ diff --git a/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSessionManualTokenCachingStrategy.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSessionManualTokenCachingStrategy.h new file mode 100644 index 000000000..f3789d978 --- /dev/null +++ b/src/ios/frameworks/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/src/ios/headers/FBSessionTokenCachingStrategy.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSessionTokenCachingStrategy.h similarity index 92% rename from src/ios/headers/FBSessionTokenCachingStrategy.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSessionTokenCachingStrategy.h index 128991f31..6190e53b9 100644 --- a/src/ios/headers/FBSessionTokenCachingStrategy.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSessionTokenCachingStrategy.h @@ -15,32 +15,33 @@ */ #import + #import "FBAccessTokenData.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. - + 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 + 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`. */ @@ -52,18 +53,18 @@ - (id)init; /*! - @abstract + @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" */ - (id)initWithUserDefaultTokenInformationKeyName:(NSString*)tokenInformationKeyName; /*! - @abstract + @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. @@ -79,9 +80,9 @@ - (void)cacheFBAccessTokenData:(FBAccessTokenData *)accessToken; /*! - @abstract + @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. @@ -94,21 +95,25 @@ /*! @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 + @abstract Called by (and overridden by inheritors), in order delete any cached information for the current token */ - (void)clearToken; /*! - @abstract + @abstract Helper function called by the SDK as well as apps, in order to fetch the default strategy instance. */ + (FBSessionTokenCachingStrategy*)defaultInstance; @@ -120,10 +125,10 @@ + (FBSessionTokenCachingStrategy*)nullCacheInstance; /*! - @abstract + @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; @@ -150,3 +155,6 @@ extern NSString *const FBTokenInformationLoginTypeLoginKey; // The key to use with token information dictionaries to get the latest known permissions extern NSString *const FBTokenInformationPermissionsKey; + +// The key to use with token information dictionaries to get the date the permissions were last refreshed. +extern NSString *const FBTokenInformationPermissionsRefreshDateKey; diff --git a/src/ios/headers/FBSettings.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSettings.h similarity index 64% rename from src/ios/headers/FBSettings.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSettings.h index a7008bd8e..a9fc57bfa 100644 --- a/src/ios/headers/FBSettings.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSettings.h @@ -36,17 +36,20 @@ extern NSString *const FBLoggingBehaviorSessionStateTransitions; /*! Log performance characteristics */ extern NSString *const FBLoggingBehaviorPerformanceCharacteristics; -/*! Log Insights interactions */ -extern NSString *const FBLoggingBehaviorInsights; +/*! Log FBAppEvents interactions */ +extern NSString *const FBLoggingBehaviorAppEvents; + +/*! Log Informational occurrences */ +extern NSString *const FBLoggingBehaviorInformational; /*! Log errors likely to be preventable by the developer. This is in the default set of enabled logging behaviors. */ 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 */ @@ -54,26 +57,46 @@ typedef void (^FBInstallResponseDataHandler)(FBGraphObject *response, NSError *e /*! @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, + FBBetaFeaturesNone = 0, #if defined(DEBUG) || defined(FB_BUILD_ONLY) - FBBetaFeaturesShareDialog = 1 << 0, - FBBetaFeaturesOpenGraphShareDialog = 1 << 1, + FBBetaFeaturesShareDialog = 1 << 0, + FBBetaFeaturesOpenGraphShareDialog = 1 << 1, #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 +}; + @interface FBSettings : NSObject /*! @method - + + @abstract Retrieve the current iOS SDK version. + + */ ++ (NSString *)sdkVersion; + +/*! + @method + @abstract Retrieve the current Facebook SDK logging behavior. - + */ + (NSSet *)loggingBehavior; @@ -88,80 +111,86 @@ typedef enum : NSUInteger { */ + (void)setLoggingBehavior:(NSSet *)loggingBehavior; -/*! @abstract Retreive the current auto publish behavior. Defaults to YES. */ -+ (BOOL)shouldAutoPublishInstall; +/*! @abstract deprecated method */ ++ (BOOL)shouldAutoPublishInstall __attribute__ ((deprecated)); + +/*! @abstract deprecated method */ ++ (void)setShouldAutoPublishInstall:(BOOL)autoPublishInstall __attribute__ ((deprecated)); /*! @method - @abstract Sets whether the SDK will automatically publish an install to Facebook during first FBSession init - or on first network request to Facebook. + @abstract This method has been replaced by [FBAppEvents activateApp] */ ++ (void)publishInstall:(NSString *)appID __attribute__ ((deprecated("use [FBAppEvents activateApp] instead"))); - @param autoPublishInstall If YES, automatically publish the install; if NO, do not. +/*! + @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)setShouldAutoPublishInstall:(BOOL)autoPublishInstall; ++ (void)publishInstall:(NSString *)appID + withHandler:(FBInstallResponseDataHandler)handler __attribute__ ((deprecated)); + -// For best results, call this function during app activation. /*! @method - @abstract Manually publish an attributed install to the facebook graph. 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]. + @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. */ -+ (void)publishInstall:(NSString *)appID; ++ (NSString *)appVersion; /*! @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. + @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 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. + @param appVersion The version identifier of the iOS app. */ -+ (void)publishInstall:(NSString *)appID - withHandler:(FBInstallResponseDataHandler)handler; ++ (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. Calls to FBInsights logging events are examples of this, when there may - have been no user login established. - - @param clientToken The Facebook App's "client token", which, for a given appid can be found in the Security + 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. */ @@ -169,69 +198,99 @@ typedef enum : NSUInteger { /*! @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. The SDK allows the url - scheme suffix to be overridden per instance in certain cases (e.g. per instance of FBSession) - + + @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. The SDK allows the url - scheme suffix to be overridden per instance in certain cases (e.g. per instance of FBSession) + 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; @@ -240,11 +299,29 @@ typedef enum : NSUInteger { @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; + @end diff --git a/src/ios/headers/FBShareDialogParams.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBShareDialogParams.h similarity index 96% rename from src/ios/headers/FBShareDialogParams.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBShareDialogParams.h index 55e554c76..fc2832ccf 100644 --- a/src/ios/headers/FBShareDialogParams.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBShareDialogParams.h @@ -6,7 +6,7 @@ * 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. @@ -15,22 +15,23 @@ */ #import + #import "FBDialogsParams.h" /*! @class FBShareDialogParams - + @abstract This object is used to encapsulate state for parameters to a share dialog that opens in the Facebook app. */ @interface FBShareDialogParams : FBDialogsParams -/*! @abstract The URL link to be attached to the post. Only "http" or "https" +/*! @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 +/*! @abstract The name, or title associated with the link. Is only used if the link is non-nil. */ @property (nonatomic, copy) NSString *name; @@ -42,7 +43,7 @@ link is non-nil. */ @property (nonatomic, copy) NSString *description; -/*! @abstract The link to a thumbnail to associate with the post. Is only used +/*! @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.*/ @property (nonatomic, copy) NSURL *picture; @@ -50,11 +51,11 @@ 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 +/*! @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 +/*! @abstract A text reference for the category of the post, used on Facebook Insights. */ @property (nonatomic, copy) NSString *ref; diff --git a/src/ios/headers/FBTestSession.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTestSession.h similarity index 95% rename from src/ios/headers/FBTestSession.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTestSession.h index 3bcd97061..707dad5fa 100644 --- a/src/ios/headers/FBTestSession.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTestSession.h @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + #import "FBSession.h" #if defined (DEBUG) @@ -24,13 +24,13 @@ #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. */ 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. @@ -39,18 +39,18 @@ 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 @@ -58,7 +58,7 @@ extern NSString *kThirdTestUserTag; 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 @@ -75,21 +75,24 @@ extern NSString *kThirdTestUserTag; @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 + + @param permissions array of strings naming permissions to authorize; nil indicates a common default set of permissions should be used for unit testing */ + (id)sessionWithSharedUserWithPermissions:(NSArray*)permissions; @@ -97,37 +100,37 @@ extern NSString *kThirdTestUserTag; /*! @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). - + 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 + + @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. */ -+ (id)sessionWithSharedUserWithPermissions:(NSArray*)permissions ++ (id)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 + + @param permissions array of strings naming permissions to authorize; nil indicates a common default set of permissions should be used for unit testing */ + (id)sessionWithPrivateUserWithPermissions:(NSArray*)permissions; diff --git a/src/ios/headers/FBUserSettingsViewController.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBUserSettingsViewController.h similarity index 98% rename from src/ios/headers/FBUserSettingsViewController.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBUserSettingsViewController.h index a15f12a1e..5df08e757 100644 --- a/src/ios/headers/FBUserSettingsViewController.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBUserSettingsViewController.h @@ -4,9 +4,9 @@ * 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. @@ -15,12 +15,13 @@ */ #import + #import "FBSession.h" #import "FBViewController.h" /*! - @protocol - + @protocol + @abstract The `FBUserSettingsDelegate` protocol defines the methods called by a . */ @@ -79,7 +80,7 @@ /*! @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 @@ -100,16 +101,16 @@ /*! @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. + 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 diff --git a/src/ios/headers/FBViewController.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBViewController.h similarity index 97% rename from src/ios/headers/FBViewController.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBViewController.h index 489a6d6d7..3025fd8b7 100644 --- a/src/ios/headers/FBViewController.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBViewController.h @@ -4,9 +4,9 @@ * 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. @@ -20,20 +20,20 @@ /*! @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 - + @protocol + @abstract The `FBViewControllerDelegate` protocol defines the methods called when the Cancel or Done buttons are pressed in a . @@ -45,7 +45,7 @@ typedef void (^FBModalCompletionHandler)(FBViewController *sender, BOOL donePres /*! @abstract Called when the Cancel button is pressed on a modally-presented . - + @param sender The view controller sending the message. */ - (void)facebookViewControllerCancelWasPressed:(id)sender; @@ -63,7 +63,7 @@ typedef void (^FBModalCompletionHandler)(FBViewController *sender, BOOL donePres /*! @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 @@ -104,8 +104,8 @@ typedef void (^FBModalCompletionHandler)(FBViewController *sender, BOOL donePres /*! @abstract Provides a wrapper that presents the view controller modally and automatically dismisses it - when either the Done or Cancel button is pressed. - + 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. diff --git a/src/ios/headers/FBWebDialogs.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBWebDialogs.h similarity index 97% rename from src/ios/headers/FBWebDialogs.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBWebDialogs.h index 5b267790c..8b0429e19 100644 --- a/src/ios/headers/FBWebDialogs.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBWebDialogs.h @@ -6,7 +6,7 @@ * 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. @@ -22,12 +22,12 @@ /*! @typedef FBWebDialogResult 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. Note, that cancel operations represent completed dialog operations. + /*! 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, /*! 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. */ @@ -36,7 +36,7 @@ typedef enum { /*! @typedef - + @abstract Defines a handler that will be called in response to the web dialog being dismissed */ @@ -47,24 +47,24 @@ typedef void (^FBWebDialogHandler)( /*! @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/) + 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. */ @@ -75,20 +75,20 @@ typedef void (^FBWebDialogHandler)( /*! @abstract - Presents a Facebook web dialog (https://developers.facebook.com/docs/reference/dialogs/) + 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 + + @param delegate An optional delegate to allow for advanced processing of web based dialogs. See 'FBWebDialogsDelegate' for more details. */ + (void)presentDialogModallyWithSession:(FBSession *)session @@ -100,16 +100,16 @@ typedef void (^FBWebDialogHandler)( /*! @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 @@ -121,18 +121,18 @@ typedef void (^FBWebDialogHandler)( /*! @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. @@ -147,12 +147,12 @@ typedef void (^FBWebDialogHandler)( /*! @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 @@ -163,9 +163,9 @@ typedef void (^FBWebDialogHandler)( /*! @protocol - + @abstract - The `FBWebDialogsDelegate` protocol enables the plugging of advanced behaviors into + 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 @@ -178,11 +178,11 @@ typedef void (^FBWebDialogHandler)( /*! @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 @@ -193,13 +193,13 @@ typedef void (^FBWebDialogHandler)( @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 @@ -210,17 +210,17 @@ typedef void (^FBWebDialogHandler)( /*! @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 diff --git a/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/Facebook.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/Facebook.h new file mode 100644 index 000000000..c1b238797 --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/Facebook.h @@ -0,0 +1,281 @@ +/* + * 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{ + id _sessionDelegate; + NSMutableSet* _requests; + FBSession* _session; + FBSessionManualTokenCachingStrategy *_tokenCaching; + FBDialog* _fbDialog; + NSString* _appId; + NSString* _urlSchemeSuffix; + BOOL _isExtendingAccessToken; + FBRequest *_requestExtendingAccessToken; + NSDate* _lastAccessTokenUpdate; + FBFrictionlessRequestSettings* _frictionlessRequestSettings; +} + +@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; + +- (id)initWithAppId:(NSString *)appId + andDelegate:(id)delegate; + +- (id)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/src/ios/headers/FacebookSDK.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FacebookSDK.h similarity index 95% rename from src/ios/headers/FacebookSDK.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FacebookSDK.h index 57bee0b51..40147efb5 100644 --- a/src/ios/headers/FacebookSDK.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FacebookSDK.h @@ -15,45 +15,42 @@ */ // core -#import "FBSession.h" -#import "FBRequest.h" -#import "FBError.h" -#import "NSError+FBError.h" -#import "FBSettings.h" -#import "FBInsights.h" +#import "FBAccessTokenData.h" #import "FBAppCall.h" +#import "FBAppEvents.h" +#import "FBCacheDescriptor.h" +#import "FBDialogs.h" +#import "FBError.h" #import "FBErrorUtility.h" -#import "FBSessionTokenCachingStrategy.h" -#import "FBAccessTokenData.h" - -// graph -#import "FBGraphUser.h" -#import "FBGraphPlace.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 "FBLoginView.h" +#import "FBNativeDialogs.h" // deprecated, use FBDialogs.h #import "FBOpenGraphAction.h" +#import "FBOpenGraphActionShareDialogParams.h" #import "FBOpenGraphObject.h" - -// ux -#import "FBLoginView.h" -#import "FBProfilePictureView.h" -#import "FBUserSettingsViewController.h" #import "FBPlacePickerViewController.h" -#import "FBFriendPickerViewController.h" -#import "FBCacheDescriptor.h" -#import "FBNativeDialogs.h" // deprecated, use FBDialogs.h -#import "FBDialogs.h" +#import "FBProfilePictureView.h" +#import "FBRequest.h" +#import "FBSession.h" +#import "FBSessionTokenCachingStrategy.h" +#import "FBSettings.h" #import "FBShareDialogParams.h" -#import "FBOpenGraphActionShareDialogParams.h" +#import "FBUserSettingsViewController.h" #import "FBWebDialogs.h" -#import "FBFrictionlessRecipientCache.h" +#import "NSError+FBError.h" /*! @header - + @abstract Library header, import this to import all of the public types in the Facebook SDK - + @discussion //////////////////////////////////////////////////////////////////////////////// @@ -65,7 +62,7 @@ * 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 @@ -75,20 +72,20 @@ 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 + (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 |
@@ -104,13 +101,13 @@
 
  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 
+ 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 
+ *Scenario Objects*, which provide deeper turn-key capibilities for useful
  mobile scenarios.
- 
+
  Use example (low barrier use case):
 
  
@@ -118,13 +115,13 @@
 
 // log on to Facebook
 [FBSession sessionOpenWithPermissions:nil
-                    completionHandler:^(FBSession *session, 
-                                        FBSessionState status, 
+                    completionHandler:^(FBSession *session,
+                                        FBSessionState status,
                                         NSError *error) {
                         if (session.isOpen) {
                             // request basic information for the user
                             [FBRequestConnection startWithGraphPath:@"me"
-                                                  completionHandler:^void(FBRequestConnection *request, 
+                                                  completionHandler:^void(FBRequestConnection *request,
                                                                           id result,
                                                                           NSError *error) {
                                                       if (!error) {
@@ -135,5 +132,8 @@
                     }];
  @/textblock
  
- + */ + +#define FB_IOS_SDK_VERSION_STRING @"3.11.1" + diff --git a/src/ios/headers/NSError+FBError.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/NSError+FBError.h similarity index 96% rename from src/ios/headers/NSError+FBError.h rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/NSError+FBError.h index 423a66358..61659a5d3 100644 --- a/src/ios/headers/NSError+FBError.h +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/DeprecatedHeaders/NSError+FBError.h @@ -18,16 +18,16 @@ /*! @category NSError(FBError) - + @abstract - Adds additional properties to NSError to provide more information for Facebook related errors. + 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. @@ -39,11 +39,11 @@ /*! @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 + 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; diff --git a/src/ios/frameworks/FacebookSDK.framework/Versions/A/FacebookSDK b/src/ios/frameworks/FacebookSDK.framework/Versions/A/FacebookSDK new file mode 100644 index 000000000..a0a22e37d Binary files /dev/null and b/src/ios/frameworks/FacebookSDK.framework/Versions/A/FacebookSDK differ diff --git a/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBAccessTokenData.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBAccessTokenData.h new file mode 100644 index 000000000..f28039b44 --- /dev/null +++ b/src/ios/frameworks/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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBAppCall.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBAppCall.h new file mode 100644 index 000000000..97569258e --- /dev/null +++ b/src/ios/frameworks/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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBAppEvents.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBAppEvents.h new file mode 100644 index 000000000..d9415d2af --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBAppEvents.h @@ -0,0 +1,451 @@ +/* + * 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" + +/*! + + @typedef FBAppEventsFlushBehavior enum + + @abstract + Control when sends log events to the server + + @discussion + + */ +typedef enum { + + /*! Flush automatically: periodically (once a minute or every 100 logged events) and always at app reactivation. */ + FBAppEventsFlushBehaviorAuto, + + /*! 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, + +} FBAppEventsFlushBehavior; + +/* + * Constant used by NSNotificationCenter for results of flushing AppEvents event logs + */ + +/*! NSNotificationCenter name indicating a result of a failed log flush attempt */ +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. */ +extern NSString *const FBAppEventNameActivatedApp; + +/*! Log this event when a user has completed registration with the app. */ +extern NSString *const FBAppEventNameCompletedRegistration; + +/*! Log this event when a user has viewed a form of content in the app. */ +extern NSString *const FBAppEventNameViewedContent; + +/*! Log this event when a user has performed a search within the app. */ +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. */ +extern NSString *const FBAppEventNameRated; + +/*! Log this event when the user has completed a tutorial in the app. */ +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. */ +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. */ +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. */ +extern NSString *const FBAppEventNameInitiatedCheckout; + +/*! Log this event when the user has entered their payment info. */ +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. */ +extern NSString *const FBAppEventNamePurchased; + +// Gaming related + +/*! Log this event when the user has achieved a level in the app. */ +extern NSString *const FBAppEventNameAchievedLevel; + +/*! Log this event when the user has unlocked an achievement in the app. */ +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. */ +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 . */ +extern NSString *const FBAppEventParameterNameCurrency; + +/*! Parameter key used to specify method user has used to register for the app, e.g., "Facebook", "email", "Twitter", etc */ +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. */ +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. */ +extern NSString *const FBAppEventParameterNameContentID; + +/*! Parameter key used to specify the string provided by the user for a search operation. */ +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. */ +extern NSString *const FBAppEventParameterNameSuccess; + +/*! Parameter key used to specify the maximum rating available for the `FBAppEventNameRate` event. E.g., "5" or "10". */ +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. */ +extern NSString *const FBAppEventParameterNamePaymentInfoAvailable; + +/*! Parameter key used to specify how many items are being processed for an `FBAppEventNameInitiatedCheckout` or `FBAppEventNamePurchased` event. */ +extern NSString *const FBAppEventParameterNameNumItems; + +/*! Parameter key used to specify the level achieved in a `FBAppEventNameAchieved` event. */ +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. */ +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 */ +extern NSString *const FBAppEventParameterValueYes; + +/*! No-valued parameter value to be used with parameter keys that need a Yes/No value */ +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 10. 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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBAppLinkData.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBAppLinkData.h new file mode 100644 index 000000000..dfdcd2e65 --- /dev/null +++ b/src/ios/frameworks/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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBCacheDescriptor.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBCacheDescriptor.h new file mode 100644 index 000000000..cf0b34dab --- /dev/null +++ b/src/ios/frameworks/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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBDialogs.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBDialogs.h new file mode 100644 index 000000000..1d84796a3 --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBDialogs.h @@ -0,0 +1,492 @@ +/* + * 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; + +/*! + @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 + +/*! + @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; + +/*! + @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:(FBShareDialogParams *)params; + +/*! + @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:(FBShareDialogParams *)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 + 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:(FBOpenGraphActionShareDialogParams *)params; + +/*! + @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:(FBOpenGraphActionShareDialogParams *)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; + +@end diff --git a/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBDialogsData.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBDialogsData.h new file mode 100644 index 000000000..bffbc46c3 --- /dev/null +++ b/src/ios/frameworks/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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBDialogsParams.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBDialogsParams.h new file mode 100644 index 000000000..9197de598 --- /dev/null +++ b/src/ios/frameworks/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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBError.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBError.h new file mode 100644 index 000000000..70ef2a4a4 --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBError.h @@ -0,0 +1,372 @@ +/* + * 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 + +/*! + The NSError domain of all errors returned by the Facebook SDK. +*/ +extern NSString *const FacebookSDKDomain; + +/*! + The NSError domain of all errors surfaced by the Facebook SDK that + were returned by the Facebook Application + */ +extern NSString *const FacebookNativeApplicationDomain; + +/*! + The key in the userInfo NSDictionary of NSError where you can find + the inner NSError (if any). +*/ +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. +*/ +extern NSString *const FBErrorParsedJSONResponseKey; + +/*! + The key in the userInfo NSDictionary of NSError indicating + the HTTP status code of the response (if any). +*/ +extern NSString *const FBErrorHTTPStatusCodeKey; + +/*! + @abstract Error codes returned by the Facebook SDK in NSError. + + @discussion + These are valid only in the scope of FacebookSDKDomain. + */ +typedef enum 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, +} FBErrorCode; + +/*! + @abstract Error codes returned by the Facebook SDK in NSError. + + @discussion + These are valid only in the scope of FacebookNativeApplicationDomain. + */ +typedef enum 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, + +} FBNativeApplicationErrorCode; + +/*! + @typedef FBErrorCategory enum + + @abstract Indicates the Facebook SDK classification for the error + + @discussion + */ +typedef enum { + /*! 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, +} FBErrorCategory; + +/*! + The key in the userInfo NSDictionary of NSError where you can find + the inner NSError (if any). + */ +extern NSString *const FBErrorInnerErrorKey; + +/*! + The key in the userInfo NSDictionary of NSError where you can find + the session associated with the error (if any). +*/ +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. + */ +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*. +*/ +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. + */ +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. +*/ +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. + */ +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. + */ +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. + */ +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. + */ +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. + */ +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. + */ +extern NSString *const FBErrorLoginFailedReasonSystemError; +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. + */ +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. + */ +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. + */ +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. + */ +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*. +*/ +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. +*/ +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. +*/ +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. + */ +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) +*/ +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'. + */ +extern NSString *const FBErrorDialogInvalidOpenGraphActionParameters; + +/*! + The key in the userInfo NSDictionary of NSError for errors + encountered with `FBAppEvents` operations (error.code equals FBErrorAppEvents). +*/ +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 + */ +extern NSString *const FBInvalidOperationException; + +// Facebook SDK also raises exceptions the following common exceptions: +// NSInvalidArgumentException + diff --git a/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBErrorUtility.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBErrorUtility.h new file mode 100644 index 000000000..61ae2cae7 --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBErrorUtility.h @@ -0,0 +1,66 @@ +/* + * 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. + */ + + +/*! + @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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBFrictionlessRecipientCache.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBFrictionlessRecipientCache.h new file mode 100644 index 000000000..09f8d9d01 --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBFrictionlessRecipientCache.h @@ -0,0 +1,87 @@ +/* + * 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 + Initializes an empty cache instance + */ +- (id)init; + +/*! @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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBFriendPickerViewController.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBFriendPickerViewController.h new file mode 100644 index 000000000..6c8af5b53 --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBFriendPickerViewController.h @@ -0,0 +1,296 @@ +/* + * 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 FBFriendSortOrdering enum + + @abstract Indicates the order in which friends should be listed in the friend picker. + + @discussion + */ +typedef enum { + /*! Sort friends by first, middle, last names. */ + FBFriendSortByFirstName, + /*! Sort friends by last, first, middle names. */ + FBFriendSortByLastName +} FBFriendSortOrdering; + +/*! + @typedef FBFriendDisplayOrdering enum + + @abstract Indicates whether friends should be displayed first-name-first or last-name-first. + + @discussion + */ +typedef enum { + /*! Display friends as First Middle Last. */ + FBFriendDisplayByFirstName, + /*! Display friends as Last First Middle. */ + FBFriendDisplayByLastName, +} FBFriendDisplayOrdering; + + +/*! + @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. + */ +- (id)init; + +/*! + @abstract + Initializes a friend picker view controller. + + @param aDecoder An unarchiver object. + */ +- (id)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. + */ +- (id)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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBGraphLocation.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBGraphLocation.h new file mode 100644 index 000000000..7f71ce653 --- /dev/null +++ b/src/ios/frameworks/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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBGraphObject.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBGraphObject.h new file mode 100644 index 000000000..74460f6f3 --- /dev/null +++ b/src/ios/frameworks/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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBGraphPlace.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBGraphPlace.h new file mode 100644 index 000000000..40e144fd0 --- /dev/null +++ b/src/ios/frameworks/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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBGraphUser.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBGraphUser.h new file mode 100644 index 000000000..645ea1d91 --- /dev/null +++ b/src/ios/frameworks/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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBInsights.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBInsights.h new file mode 100644 index 000000000..d1a35dee1 --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBInsights.h @@ -0,0 +1,57 @@ +/* + * 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" + +/*! + @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; + +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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBLoginView.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBLoginView.h new file mode 100644 index 000000000..4f75e3a11 --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBLoginView.h @@ -0,0 +1,189 @@ +/* + * 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" + +@protocol FBLoginViewDelegate; + +/*! + @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. + */ +@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. The basic_info permission must be explicitly requested at + first login, and is no longer inferred, (subject to an active migration.) + + @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 FBSessionLoginBehaviorUseSystemAccountIfPresent. + */ +@property (nonatomic) FBSessionLoginBehavior loginBehavior; + + +/*! + @abstract + Initializes and returns an `FBLoginView` object. The underlying session has basic permissions granted to it. + */ +- (id)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. + */ +- (id)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. + + */ +- (id)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. + + */ +- (id)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. + */ +@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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBNativeDialogs.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBNativeDialogs.h new file mode 100644 index 000000000..f8723fc5c --- /dev/null +++ b/src/ios/frameworks/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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphAction.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphAction.h new file mode 100644 index 000000000..adc5ef45c --- /dev/null +++ b/src/ios/frameworks/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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphActionShareDialogParams.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphActionShareDialogParams.h new file mode 100644 index 000000000..89f49d796 --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphActionShareDialogParams.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 "FBDialogsParams.h" +#import "FBOpenGraphAction.h" + +extern NSString *const FBPostObject; + +/*! + @class FBOpenGraphActionShareDialogParams + + @abstract + This object is used to encapsulate state for parameters to an Open Graph share + dialog that opens in the Facebook app. + */ +@interface FBOpenGraphActionShareDialogParams : 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; + +@end diff --git a/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphObject.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphObject.h new file mode 100644 index 000000000..be73a3bd7 --- /dev/null +++ b/src/ios/frameworks/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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBPlacePickerViewController.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBPlacePickerViewController.h new file mode 100644 index 000000000..735cf9226 --- /dev/null +++ b/src/ios/frameworks/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. + */ +- (id)init; + +/*! + @abstract + Initializes a place picker view controller. + + @param aDecoder An unarchiver object. + */ +- (id)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. + */ +- (id)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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBProfilePictureView.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBProfilePictureView.h new file mode 100644 index 000000000..c1f31c6c2 --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBProfilePictureView.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 + +/*! + @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. + */ +- (id)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. + */ +- (id)initWithProfileID:(NSString*)profileID + pictureCropping:(FBProfilePictureCropping)pictureCropping; + + +@end diff --git a/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBRequest.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBRequest.h new file mode 100644 index 000000000..187bd7a63 --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBRequest.h @@ -0,0 +1,672 @@ +/* + * 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" + +/*! The base URL used for graph requests */ +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; + 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. +*/ +- (id)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". +*/ +- (id)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. +*/ +- (id)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. +*/ +- (id)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. + +*/ +- (id)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 + 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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBRequestConnection.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBRequestConnection.h new file mode 100644 index 000000000..140267f9b --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBRequestConnection.h @@ -0,0 +1,626 @@ +/* + * 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" + +// 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. +*/ +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. +*/ +- (id)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. +*/ + +- (id)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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBSession.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBSession.h new file mode 100644 index 000000000..63b01877d --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBSession.h @@ -0,0 +1,785 @@ +/* + * 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 + +// 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 */ +extern NSString *const FBSessionDidSetActiveSessionNotification; + +/*! NSNotificationCenter name indicating that an active session was unset */ +extern NSString *const FBSessionDidUnsetActiveSessionNotification; + +/*! NSNotificationCenter name indicating that the active session is open */ +extern NSString *const FBSessionDidBecomeOpenActiveSessionNotification; + +/*! NSNotificationCenter name indicating that there is no longer an open active session */ +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, +} 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 . + */ +- (id)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. The basic_info permission must be explicitly requested at first login, and is no + longer inferred, (subject to an active migration.) The default is nil. + + @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. + + */ +- (id)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. The basic_info permission must be explicitly requested at first login, and is no longer inferred, (subject to an active migration.) The default is nil. + @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. + */ +- (id)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. The basic_info permission must be explicitly requested at first login, and is no longer inferred, (subject to an active migration.) The default is nil. + @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. + */ +- (id)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; + +/*! + @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 + 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. + + @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; + +/*! + @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. The basic_info permission must be explicitly requested at first login, and is no longer + inferred, (subject to an active migration.) 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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBSessionTokenCachingStrategy.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBSessionTokenCachingStrategy.h new file mode 100644 index 000000000..6190e53b9 --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBSessionTokenCachingStrategy.h @@ -0,0 +1,160 @@ +/* + * 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" + +/*! + @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 + */ +- (id)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" + */ +- (id)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 +extern NSString *const FBTokenInformationTokenKey; + +// The to use with token information dictionaries to get and set the expiration date +extern NSString *const FBTokenInformationExpirationDateKey; + +// The to use with token information dictionaries to get and set the refresh date +extern NSString *const FBTokenInformationRefreshDateKey; + +// The key to use with token information dictionaries to get the related user's fbid +extern NSString *const FBTokenInformationUserFBIDKey; + +// The key to use with token information dictionaries to determine whether the token was fetched via Facebook Login +extern NSString *const FBTokenInformationIsFacebookLoginKey; + +// The key to use with token information dictionaries to determine whether the token was fetched via the OS +extern NSString *const FBTokenInformationLoginTypeLoginKey; + +// The key to use with token information dictionaries to get the latest known permissions +extern NSString *const FBTokenInformationPermissionsKey; + +// The key to use with token information dictionaries to get the date the permissions were last refreshed. +extern NSString *const FBTokenInformationPermissionsRefreshDateKey; diff --git a/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBSettings.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBSettings.h new file mode 100644 index 000000000..a9fc57bfa --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBSettings.h @@ -0,0 +1,327 @@ +/* + * 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 + +/* + * Constants defining logging behavior. Use with <[FBSettings setLoggingBehavior]>. + */ + +/*! Log requests from FBRequest* classes */ +extern NSString *const FBLoggingBehaviorFBRequests; + +/*! Log requests from FBURLConnection* classes */ +extern NSString *const FBLoggingBehaviorFBURLConnections; + +/*! Include access token in logging. */ +extern NSString *const FBLoggingBehaviorAccessTokens; + +/*! Log session state transitions. */ +extern NSString *const FBLoggingBehaviorSessionStateTransitions; + +/*! Log performance characteristics */ +extern NSString *const FBLoggingBehaviorPerformanceCharacteristics; + +/*! Log FBAppEvents interactions */ +extern NSString *const FBLoggingBehaviorAppEvents; + +/*! Log Informational occurrences */ +extern NSString *const FBLoggingBehaviorInformational; + +/*! Log errors likely to be preventable by the developer. This is in the default set of enabled logging behaviors. */ +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, +#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 +}; + +@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; + +@end diff --git a/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBShareDialogParams.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBShareDialogParams.h new file mode 100644 index 000000000..fc2832ccf --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBShareDialogParams.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 + +#import "FBDialogsParams.h" + +/*! + @class FBShareDialogParams + + @abstract + This object is used to encapsulate state for parameters to a share dialog that + opens in the Facebook app. + */ +@interface FBShareDialogParams : 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.*/ +@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; + +@end diff --git a/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBTestSession.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBTestSession.h new file mode 100644 index 000000000..707dad5fa --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBTestSession.h @@ -0,0 +1,138 @@ +/* + * 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" + +#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. + */ +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. + */ +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 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 + */ ++ (id)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. + */ ++ (id)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 + */ ++ (id)sessionWithPrivateUserWithPermissions:(NSArray*)permissions; + +@end diff --git a/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBUserSettingsViewController.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBUserSettingsViewController.h new file mode 100644 index 000000000..5df08e757 --- /dev/null +++ b/src/ios/frameworks/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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBViewController.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBViewController.h new file mode 100644 index 000000000..3025fd8b7 --- /dev/null +++ b/src/ios/frameworks/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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBWebDialogs.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBWebDialogs.h new file mode 100644 index 000000000..8b0429e19 --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FBWebDialogs.h @@ -0,0 +1,234 @@ +/* + * 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 FBWebDialogResult 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. Note, that cancel operations represent completed dialog operations. + The url argument may be used to distinguish between success and user-cancelled cases */ + FBWebDialogResultDialogCompleted, + /*! 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 +} FBWebDialogResult; + +/*! + @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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FacebookSDK.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FacebookSDK.h new file mode 100644 index 000000000..40147efb5 --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/FacebookSDK.h @@ -0,0 +1,139 @@ +/* + * 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 "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 "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.11.1" + diff --git a/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/NSError+FBError.h b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Headers/NSError+FBError.h new file mode 100644 index 000000000..61659a5d3 --- /dev/null +++ b/src/ios/frameworks/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/src/ios/resources/FBUserSettingsViewResources.bundle/Contents/Resources/en.lproj/Localizable.strings b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/Contents/Resources/en.lproj/Localizable.strings similarity index 100% rename from src/ios/resources/FBUserSettingsViewResources.bundle/Contents/Resources/en.lproj/Localizable.strings rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/Contents/Resources/en.lproj/Localizable.strings diff --git a/src/ios/resources/FBUserSettingsViewResources.bundle/Contents/Resources/he.lproj/Localizable.strings b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/Contents/Resources/he.lproj/Localizable.strings similarity index 100% rename from src/ios/resources/FBUserSettingsViewResources.bundle/Contents/Resources/he.lproj/Localizable.strings rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/Contents/Resources/he.lproj/Localizable.strings diff --git a/src/ios/resources/FBUserSettingsViewResources.bundle/images/facebook-logo.png b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/facebook-logo.png similarity index 100% rename from src/ios/resources/FBUserSettingsViewResources.bundle/images/facebook-logo.png rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/facebook-logo.png diff --git a/src/ios/resources/FBUserSettingsViewResources.bundle/images/facebook-logo@2x.png b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/facebook-logo@2x.png similarity index 100% rename from src/ios/resources/FBUserSettingsViewResources.bundle/images/facebook-logo@2x.png rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/facebook-logo@2x.png diff --git a/src/ios/resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadLandscape.jpg b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadLandscape.jpg similarity index 100% rename from src/ios/resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadLandscape.jpg rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadLandscape.jpg diff --git a/src/ios/resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadLandscape@2x.jpg b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadLandscape@2x.jpg similarity index 100% rename from src/ios/resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadLandscape@2x.jpg rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadLandscape@2x.jpg diff --git a/src/ios/resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadPortrait.jpg b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadPortrait.jpg similarity index 100% rename from src/ios/resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadPortrait.jpg rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadPortrait.jpg diff --git a/src/ios/resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadPortrait@2x.jpg b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadPortrait@2x.jpg similarity index 100% rename from src/ios/resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadPortrait@2x.jpg rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadPortrait@2x.jpg diff --git a/src/ios/resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPhonePortrait.jpg b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPhonePortrait.jpg similarity index 100% rename from src/ios/resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPhonePortrait.jpg rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPhonePortrait.jpg diff --git a/src/ios/resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPhonePortrait@2x.jpg b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPhonePortrait@2x.jpg similarity index 100% rename from src/ios/resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPhonePortrait@2x.jpg rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPhonePortrait@2x.jpg diff --git a/src/ios/resources/FBUserSettingsViewResources.bundle/images/silver-button-normal.png b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-normal.png similarity index 100% rename from src/ios/resources/FBUserSettingsViewResources.bundle/images/silver-button-normal.png rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-normal.png diff --git a/src/ios/resources/FBUserSettingsViewResources.bundle/images/silver-button-normal@2x.png b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-normal@2x.png similarity index 100% rename from src/ios/resources/FBUserSettingsViewResources.bundle/images/silver-button-normal@2x.png rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-normal@2x.png diff --git a/src/ios/resources/FBUserSettingsViewResources.bundle/images/silver-button-pressed.png b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-pressed.png similarity index 100% rename from src/ios/resources/FBUserSettingsViewResources.bundle/images/silver-button-pressed.png rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-pressed.png diff --git a/src/ios/resources/FBUserSettingsViewResources.bundle/images/silver-button-pressed@2x.png b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-pressed@2x.png similarity index 100% rename from src/ios/resources/FBUserSettingsViewResources.bundle/images/silver-button-pressed@2x.png rename to src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-pressed@2x.png diff --git a/src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FacebookSDKResources.bundle.README b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/FacebookSDKResources.bundle.README new file mode 100644 index 000000000..3ae35b450 --- /dev/null +++ b/src/ios/frameworks/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/src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/Info.plist b/src/ios/frameworks/FacebookSDK.framework/Versions/A/Resources/Info.plist new file mode 100644 index 000000000..0dd599a29 --- /dev/null +++ b/src/ios/frameworks/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/src/ios/frameworks/FacebookSDK.framework/Versions/Current b/src/ios/frameworks/FacebookSDK.framework/Versions/Current new file mode 120000 index 000000000..044dcb929 --- /dev/null +++ b/src/ios/frameworks/FacebookSDK.framework/Versions/Current @@ -0,0 +1 @@ +./A \ No newline at end of file diff --git a/src/ios/headers/FBInsights.h b/src/ios/headers/FBInsights.h deleted file mode 100644 index 93287e0bf..000000000 --- a/src/ios/headers/FBInsights.h +++ /dev/null @@ -1,283 +0,0 @@ -/* - * 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" - -/*! - @typedef FBInsightsFlushBehavior enum - - @abstract - Control when sends log events to the server - - @discussion - If an instance of an app doesn't send during its lifetime, or can't establish connectivity, the - events will be stashed for the next run and sent then. - */ -typedef enum { - - /*! Flush automatically: periodically and always at app reactivation. */ - FBInsightsFlushBehaviorAuto, - - /*! Only flush when explicitFlush 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 flush. */ - FBInsightsFlushBehaviorExplicitOnly, - -} FBInsightsFlushBehavior; - -/* - * Constant used by NSNotificationCenter for results of flushing Insights event logs - */ - -/*! NSNotificationCenter name indicating a result of a log flush attempt */ -extern NSString *const FBInsightsLoggingResultNotification; - -/*! - @class FBInsights - - @abstract - Client-side event logging for specialized application analytics available through Facebook Insights - and Conversion Pixel conversion tracking for ads optimization. - - @discussion - The `FBInsights` static class has a few related roles: - - + Logging predefined events to Facebook Application 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 'purchase' events to later be used for ads optimization around lifetime value. - - + Logging 'conversion pixels' for use in ads conversion tracking and optimization. - - + 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 `FBInsights`: - - + 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. - - when a time threshold is passed. - - 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 `FBInsights` class in thread-safe in that events may be logged from any of the app's threads. - - Some things to note when logging events: - - + 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 10. 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 - + The length of each parameter value can be no more than on the order of 100 characters. - + When logging events, the "client token" must be set. An exception will be thrown if it isn't. See - [FBSettings setClientToken] for more information. - - */ -@interface FBInsights : NSObject - -/* - * Global, session wide properties - */ - -/*! - @method - - @abstract - Gets the application version to the provided string. Insights allows breakdown of - events by app version. - */ -+ (NSString *)appVersion; - -/*! - @method - - @abstract - Sets the application version to the provided string. Insights allows breakdown of - events by app version. - - @param appVersion The version identifier of the iOS app that events are being logged through. - Enables analysis and breakdown of logged events by app version. - */ -+ (void)setAppVersion:(NSString *)appVersion; - -/* - * 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 `FBInsights` event queue, unless the `flushBehavior` is set - to `FBInsightsFlushBehaviorExplicitOnly`. The "client token" must be set via [FBSettings setClientToken] prior to - calling this method. An exception is thrown if it's not. - - */ -+ (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 `FBInsights` documentation. - - @discussion This event immediately triggers a flush of the `FBInsights` event queue, unless the `flushBehavior` is set - to `FBInsightsFlushBehaviorExplicitOnly`. The "client token" must be set via [FBSettings setClientToken] prior to - calling this method. An exception is thrown if it's not. - - */ -+ (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 `FBInsights` documentation. - - @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 `FBInsights` event queue, unless the `flushBehavior` is set - to `FBInsightsFlushBehaviorExplicitOnly`. The "client token" must be set via [FBSettings setClientToken] prior to - calling this method. An exception is thrown if it's not. - - */ -+ (void)logPurchase:(double)purchaseAmount - currency:(NSString *)currency - parameters:(NSDictionary *)parameters - session:(FBSession *)session; - -/* - * Logging conversion pixels for Ads Optimization/Conversion Tracking. See https://www.facebook.com/help/435189689870514 to learn more. - */ - -/*! - @method - - @abstract - Log, or "Fire" a Conversion Pixel. Conversion Pixels are used for Ads Conversion Tracking. See https://www.facebook.com/help/435189689870514 to learn more. - - @param pixelID Numeric ID for the conversion pixel to be logged. See https://www.facebook.com/help/435189689870514 to learn how to create - a conversion pixel. - - @param value Value of what the logging of this pixel is worth to you. The currency that this is expressed in doesn't matter, so long as it is consistent across all logging for this pixel. - This value will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346). - - @discussion This event immediately triggers a flush of the `FBInsights` event queue, unless the `flushBehavior` is set - to `FBInsightsFlushBehaviorExplicitOnly`. The "client token" must be set via [FBSettings setClientToken] prior to - calling this method. An exception is thrown if it's not. - */ -+ (void)logConversionPixel:(NSString *)pixelID - valueOfPixel:(double)value; - -/*! - @method - - @abstract - Log, or "Fire" a Conversion Pixel. Conversion Pixels are used for Ads Conversion Tracking. See https://www.facebook.com/help/435189689870514 to learn more. - - @param pixelID Numeric ID for the conversion pixel to be logged. See https://www.facebook.com/help/435189689870514 to learn how to create - a conversion pixel. - - @param value Value of what the logging of this pixel is worth to you. The currency that this is expressed in doesn't matter, so long as it is consistent across all logging for this pixel. - This value will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346). - - @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 `FBInsights` event queue, unless the `flushBehavior` is set - to `FBInsightsFlushBehaviorExplicitOnly`. The "client token" must be set via [FBSettings setClientToken] prior to - calling this method. An exception is thrown if it's not. - - */ -+ (void)logConversionPixel:(NSString *)pixelID - valueOfPixel:(double)value - session:(FBSession *)session; - - -/* - * Control over event batching/flushing - */ - - -/*! - @method - - @abstract - Get the current event flushing behavior specifying when events are sent back to Facebook servers. - */ -+ (FBInsightsFlushBehavior)flushBehavior; - -/*! - @method - - @abstract - Set the current event flushing behavior specifying when events are sent back to Facebook servers. - - @param flushBehavior The desired `FBInsightsFlushBehavior` to be used. - */ -+ (void)setFlushBehavior:(FBInsightsFlushBehavior)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 `FBInsightsLoggingResultNotification`. - */ -+ (void)flush; - - -@end diff --git a/src/ios/resources/FacebookSDKResources.bundle/Contents/Resources/en.lproj/Localizable.strings b/src/ios/resources/FacebookSDKResources.bundle/Contents/Resources/en.lproj/Localizable.strings deleted file mode 100644 index b9283537b..000000000 Binary files a/src/ios/resources/FacebookSDKResources.bundle/Contents/Resources/en.lproj/Localizable.strings and /dev/null differ diff --git a/src/ios/resources/FacebookSDKResources.bundle/Contents/Resources/he.lproj/Localizable.strings b/src/ios/resources/FacebookSDKResources.bundle/Contents/Resources/he.lproj/Localizable.strings deleted file mode 100644 index ad008339d..000000000 Binary files a/src/ios/resources/FacebookSDKResources.bundle/Contents/Resources/he.lproj/Localizable.strings and /dev/null differ diff --git a/src/ios/resources/FacebookSDKResources.bundle/FBDialog/images/close.png b/src/ios/resources/FacebookSDKResources.bundle/FBDialog/images/close.png deleted file mode 100644 index ad0147460..000000000 Binary files a/src/ios/resources/FacebookSDKResources.bundle/FBDialog/images/close.png and /dev/null differ diff --git a/src/ios/resources/FacebookSDKResources.bundle/FBDialog/images/close@2x.png b/src/ios/resources/FacebookSDKResources.bundle/FBDialog/images/close@2x.png deleted file mode 100644 index e3aff5ae5..000000000 Binary files a/src/ios/resources/FacebookSDKResources.bundle/FBDialog/images/close@2x.png and /dev/null differ diff --git a/src/ios/resources/FacebookSDKResources.bundle/FBDialog/images/fbicon.png b/src/ios/resources/FacebookSDKResources.bundle/FBDialog/images/fbicon.png deleted file mode 100644 index 413396be6..000000000 Binary files a/src/ios/resources/FacebookSDKResources.bundle/FBDialog/images/fbicon.png and /dev/null differ diff --git a/src/ios/resources/FacebookSDKResources.bundle/FBFriendPickerView/images/default.png b/src/ios/resources/FacebookSDKResources.bundle/FBFriendPickerView/images/default.png deleted file mode 100755 index 9762eb85c..000000000 Binary files a/src/ios/resources/FacebookSDKResources.bundle/FBFriendPickerView/images/default.png and /dev/null differ diff --git a/src/ios/resources/FacebookSDKResources.bundle/FBLoginView/images/bluetint.png b/src/ios/resources/FacebookSDKResources.bundle/FBLoginView/images/bluetint.png deleted file mode 100644 index adef9c05b..000000000 Binary files a/src/ios/resources/FacebookSDKResources.bundle/FBLoginView/images/bluetint.png and /dev/null differ diff --git a/src/ios/resources/FacebookSDKResources.bundle/FBLoginView/images/f_logo.png b/src/ios/resources/FacebookSDKResources.bundle/FBLoginView/images/f_logo.png deleted file mode 100644 index 9443a881d..000000000 Binary files a/src/ios/resources/FacebookSDKResources.bundle/FBLoginView/images/f_logo.png and /dev/null differ diff --git a/src/ios/resources/FacebookSDKResources.bundle/FBLoginView/images/facebook.png b/src/ios/resources/FacebookSDKResources.bundle/FBLoginView/images/facebook.png deleted file mode 100755 index daf8097b1..000000000 Binary files a/src/ios/resources/FacebookSDKResources.bundle/FBLoginView/images/facebook.png and /dev/null differ diff --git a/src/ios/resources/FacebookSDKResources.bundle/FBLoginView/images/login-button-small-pressed.png b/src/ios/resources/FacebookSDKResources.bundle/FBLoginView/images/login-button-small-pressed.png deleted file mode 100644 index 31c69fe57..000000000 Binary files a/src/ios/resources/FacebookSDKResources.bundle/FBLoginView/images/login-button-small-pressed.png and /dev/null differ diff --git a/src/ios/resources/FacebookSDKResources.bundle/FBLoginView/images/login-button-small-pressed@2x.png b/src/ios/resources/FacebookSDKResources.bundle/FBLoginView/images/login-button-small-pressed@2x.png deleted file mode 100644 index bd2696592..000000000 Binary files a/src/ios/resources/FacebookSDKResources.bundle/FBLoginView/images/login-button-small-pressed@2x.png and /dev/null differ diff --git a/src/ios/resources/FacebookSDKResources.bundle/FBLoginView/images/login-button-small.png b/src/ios/resources/FacebookSDKResources.bundle/FBLoginView/images/login-button-small.png deleted file mode 100644 index 22aa4fad6..000000000 Binary files a/src/ios/resources/FacebookSDKResources.bundle/FBLoginView/images/login-button-small.png and /dev/null differ diff --git a/src/ios/resources/FacebookSDKResources.bundle/FBLoginView/images/login-button-small@2x.png b/src/ios/resources/FacebookSDKResources.bundle/FBLoginView/images/login-button-small@2x.png deleted file mode 100644 index 857c489bf..000000000 Binary files a/src/ios/resources/FacebookSDKResources.bundle/FBLoginView/images/login-button-small@2x.png and /dev/null differ diff --git a/src/ios/resources/FacebookSDKResources.bundle/FBPlacePickerView/images/fb_generic_place.png b/src/ios/resources/FacebookSDKResources.bundle/FBPlacePickerView/images/fb_generic_place.png deleted file mode 100755 index 97ec3e608..000000000 Binary files a/src/ios/resources/FacebookSDKResources.bundle/FBPlacePickerView/images/fb_generic_place.png and /dev/null differ diff --git a/src/ios/resources/FacebookSDKResources.bundle/FBProfilePictureView/images/fb_blank_profile_portrait.png b/src/ios/resources/FacebookSDKResources.bundle/FBProfilePictureView/images/fb_blank_profile_portrait.png deleted file mode 100644 index 107d7f89e..000000000 Binary files a/src/ios/resources/FacebookSDKResources.bundle/FBProfilePictureView/images/fb_blank_profile_portrait.png and /dev/null differ diff --git a/src/ios/resources/FacebookSDKResources.bundle/FBProfilePictureView/images/fb_blank_profile_square.png b/src/ios/resources/FacebookSDKResources.bundle/FBProfilePictureView/images/fb_blank_profile_square.png deleted file mode 100644 index 8b4a76a0e..000000000 Binary files a/src/ios/resources/FacebookSDKResources.bundle/FBProfilePictureView/images/fb_blank_profile_square.png and /dev/null differ diff --git a/www/phonegap/plugin/facebookConnectPlugin/facebookConnectPlugin.js b/www/phonegap/plugin/facebookConnectPlugin/facebookConnectPlugin.js new file mode 100644 index 000000000..7150e94af --- /dev/null +++ b/www/phonegap/plugin/facebookConnectPlugin/facebookConnectPlugin.js @@ -0,0 +1,32 @@ +/* + * @author Ally Ogilvie + * @copyright Wizcorp Inc. [ Incorporated Wizards ] 2014 + * @file - facebookConnectPlugin.js + * @about - JavaScript interface for PhoneGap bridge to Facebook Connect SDK + * + * + */ + +var exec = require("cordova/exec"); + +var facebookConnectPlugin = { + + getLoginStatus: function(s, f) { + cordova.exec(s, f, "FacebookConnectPlugin", "getLoginStatus", []); + }, + + showDialog: function(options, s, f) { + cordova.exec(s, f, "FacebookConnectPlugin", "showDialog", [options]); + }, + + login: function(permissions, s, f) { + cordova.exec(s, f, "FacebookConnectPlugin", "login", permissions); + }, + + logout: function(s, f) { + cordova.exec(s, f, "FacebookConnectPlugin", "logout", []); + } + +}; + +module.exports = facebookConnectPlugin;