New file |
| | |
| | | # |
| | | # Be sure to run `pod spec lint WAFbImpl.podspec' to ensure this is a |
| | | # valid spec and to remove all comments including this before submitting the spec. |
| | | # |
| | | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html |
| | | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ |
| | | # |
| | | |
| | | Pod::Spec.new do |s| |
| | | |
| | | s.name = 'WAFbImpl' |
| | | s.version = '3.6.0' |
| | | s.summary = 'WAFbImpl framework in testing environment.' |
| | | s.license = 'MIT' |
| | | s.author = { "Wuyx" => "wuyixin_gh@gamehollywood.com" } |
| | | s.homepage = 'http://172.16.100.58:7070/summary/WAFbImpl.git' |
| | | s.source = { :git => "http://admin@172.16.100.58:7070/r/WAFbImpl.git" , :tag => s.version} |
| | | s.platform = :ios |
| | | s.ios.deployment_target = "7.0" |
| | | s.vendored_frameworks = 'frameworks/*.framework' |
| | | s.resources = ['config/*.xml'] |
| | | s.requires_arc = true |
| | | s.dependency 'WASdkIntf', '~> 3.6.0' #此处添加私有库依赖 |
| | | s.dependency 'WASdkImpl', '~> 3.6.0' |
| | | end |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <config> |
| | | <version val="FB3.6"/> |
| | | <comps> |
| | | <!-- 用户模块 --> |
| | | <comp module="USR" plaf="FACEBOOK" mandatory="NO" value="WAFBUser" desc="FACEBOOK用户账户"/> |
| | | |
| | | <!-- 数据收集模块 --> |
| | | <comp module="TRA" plaf="FACEBOOK" mandatory="NO" value="WAFBTrack" desc="FACEBOOK数据统计"/> |
| | | |
| | | <!-- 公共模块 --> |
| | | <comp module="CORE" plaf="FACEBOOK" mandatory="YES" value="WAFBCore" desc="公共模块"/> |
| | | |
| | | <!-- 社交模块 --> |
| | | <comp module="SOC" plaf="FACEBOOK" mandatory="NO" value="WAFBSocial" desc="Facebook社交"/> |
| | | </comps> |
| | | <ops> |
| | | <op type="copy" category="res" isFile="NO" from="frameworks" to="wasdk/fb/frameworks" /> |
| | | </ops> |
| | | </config> |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2014, Facebook, Inc. |
| | | * All rights reserved. |
| | | * |
| | | * This source code is licensed under the BSD-style license found in the |
| | | * LICENSE file in the root directory of this source tree. An additional grant |
| | | * of patent rights can be found in the PATENTS file in the same directory. |
| | | * |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /*! The version of the App Link protocol that this library supports */ |
| | | FOUNDATION_EXPORT NSString *const BFAppLinkVersion; |
| | | |
| | | /*! |
| | | Contains App Link metadata relevant for navigation on this device |
| | | derived from the HTML at a given URL. |
| | | */ |
| | | @interface BFAppLink : NSObject |
| | | |
| | | /*! |
| | | Creates a BFAppLink with the given list of BFAppLinkTargets and target URL. |
| | | |
| | | Generally, this will only be used by implementers of the BFAppLinkResolving protocol, |
| | | as these implementers will produce App Link metadata for a given URL. |
| | | |
| | | @param sourceURL the URL from which this App Link is derived |
| | | @param targets an ordered list of BFAppLinkTargets for this platform derived |
| | | from App Link metadata. |
| | | @param webURL the fallback web URL, if any, for the app link. |
| | | */ |
| | | + (instancetype)appLinkWithSourceURL:(NSURL *)sourceURL |
| | | targets:(NSArray *)targets |
| | | webURL:(NSURL *)webURL; |
| | | |
| | | /*! The URL from which this BFAppLink was derived */ |
| | | @property (nonatomic, strong, readonly) NSURL *sourceURL; |
| | | |
| | | /*! |
| | | The ordered list of targets applicable to this platform that will be used |
| | | for navigation. |
| | | */ |
| | | @property (nonatomic, copy, readonly) NSArray *targets; |
| | | |
| | | /*! The fallback web URL to use if no targets are installed on this device. */ |
| | | @property (nonatomic, strong, readonly) NSURL *webURL; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2014, Facebook, Inc. |
| | | * All rights reserved. |
| | | * |
| | | * This source code is licensed under the BSD-style license found in the |
| | | * LICENSE file in the root directory of this source tree. An additional grant |
| | | * of patent rights can be found in the PATENTS file in the same directory. |
| | | * |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <Bolts/BFAppLink.h> |
| | | |
| | | /*! |
| | | The result of calling navigate on a BFAppLinkNavigation |
| | | */ |
| | | typedef NS_ENUM(NSInteger, BFAppLinkNavigationType) { |
| | | /*! Indicates that the navigation failed and no app was opened */ |
| | | BFAppLinkNavigationTypeFailure, |
| | | /*! Indicates that the navigation succeeded by opening the URL in the browser */ |
| | | BFAppLinkNavigationTypeBrowser, |
| | | /*! Indicates that the navigation succeeded by opening the URL in an app on the device */ |
| | | BFAppLinkNavigationTypeApp |
| | | }; |
| | | |
| | | @protocol BFAppLinkResolving; |
| | | @class BFTask; |
| | | |
| | | /*! |
| | | Represents a pending request to navigate to an App Link. Most developers will |
| | | simply use navigateToURLInBackground: to open a URL, but developers can build |
| | | custom requests with additional navigation and app data attached to them by |
| | | creating BFAppLinkNavigations themselves. |
| | | */ |
| | | @interface BFAppLinkNavigation : NSObject |
| | | |
| | | /*! |
| | | The extras for the AppLinkNavigation. This will generally contain application-specific |
| | | data that should be passed along with the request, such as advertiser or affiliate IDs or |
| | | other such metadata relevant on this device. |
| | | */ |
| | | @property (nonatomic, copy, readonly) NSDictionary *extras; |
| | | |
| | | /*! |
| | | The al_applink_data for the AppLinkNavigation. This will generally contain data common to |
| | | navigation attempts such as back-links, user agents, and other information that may be used |
| | | in routing and handling an App Link request. |
| | | */ |
| | | @property (nonatomic, copy, readonly) NSDictionary *appLinkData; |
| | | |
| | | /*! The AppLink to navigate to */ |
| | | @property (nonatomic, strong, readonly) BFAppLink *appLink; |
| | | |
| | | /*! Creates an AppLinkNavigation with the given link, extras, and App Link data */ |
| | | + (instancetype)navigationWithAppLink:(BFAppLink *)appLink |
| | | extras:(NSDictionary *)extras |
| | | appLinkData:(NSDictionary *)appLinkData; |
| | | |
| | | /*! Performs the navigation */ |
| | | - (BFAppLinkNavigationType)navigate:(NSError **)error; |
| | | |
| | | /*! Returns a BFAppLink for the given URL */ |
| | | + (BFTask *)resolveAppLinkInBackground:(NSURL *)destination; |
| | | |
| | | /*! Returns a BFAppLink for the given URL using the given App Link resolution strategy */ |
| | | + (BFTask *)resolveAppLinkInBackground:(NSURL *)destination resolver:(id<BFAppLinkResolving>)resolver; |
| | | |
| | | /*! Navigates to a BFAppLink and returns whether it opened in-app or in-browser */ |
| | | + (BFAppLinkNavigationType)navigateToAppLink:(BFAppLink *)link error:(NSError **)error; |
| | | |
| | | /*! Navigates to a URL (an asynchronous action) and returns a BFNavigationType */ |
| | | + (BFTask *)navigateToURLInBackground:(NSURL *)destination; |
| | | |
| | | /*! |
| | | Navigates to a URL (an asynchronous action) using the given App Link resolution |
| | | strategy and returns a BFNavigationType |
| | | */ |
| | | + (BFTask *)navigateToURLInBackground:(NSURL *)destination resolver:(id<BFAppLinkResolving>)resolver; |
| | | |
| | | /*! |
| | | Gets the default resolver to be used for App Link resolution. If the developer has not set one explicitly, |
| | | a basic, built-in resolver will be used. |
| | | */ |
| | | + (id<BFAppLinkResolving>)defaultResolver; |
| | | |
| | | /*! |
| | | Sets the default resolver to be used for App Link resolution. Setting this to nil will revert the |
| | | default resolver to the basic, built-in resolver provided by Bolts. |
| | | */ |
| | | + (void)setDefaultResolver:(id<BFAppLinkResolving>)resolver; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2014, Facebook, Inc. |
| | | * All rights reserved. |
| | | * |
| | | * This source code is licensed under the BSD-style license found in the |
| | | * LICENSE file in the root directory of this source tree. An additional grant |
| | | * of patent rights can be found in the PATENTS file in the same directory. |
| | | * |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | @class BFTask; |
| | | |
| | | /*! |
| | | Implement this protocol to provide an alternate strategy for resolving |
| | | App Links that may include pre-fetching, caching, or querying for App Link |
| | | data from an index provided by a service provider. |
| | | */ |
| | | @protocol BFAppLinkResolving <NSObject> |
| | | |
| | | /*! |
| | | Asynchronously resolves App Link data for a given URL. |
| | | |
| | | @param url The URL to resolve into an App Link. |
| | | @returns A BFTask that will return a BFAppLink for the given URL. |
| | | */ |
| | | - (BFTask *)appLinkFromURLInBackground:(NSURL *)url; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2014, Facebook, Inc. |
| | | * All rights reserved. |
| | | * |
| | | * This source code is licensed under the BSD-style license found in the |
| | | * LICENSE file in the root directory of this source tree. An additional grant |
| | | * of patent rights can be found in the PATENTS file in the same directory. |
| | | * |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | #import <Bolts/BFAppLinkReturnToRefererView.h> |
| | | |
| | | @class BFAppLink; |
| | | @class BFAppLinkReturnToRefererController; |
| | | |
| | | /*! |
| | | Protocol that a class can implement in order to be notified when the user has navigated back |
| | | to the referer of an App Link. |
| | | */ |
| | | @protocol BFAppLinkReturnToRefererControllerDelegate <NSObject> |
| | | |
| | | @optional |
| | | |
| | | /*! Called when the user has tapped to navigate, but before the navigation has been performed. */ |
| | | - (void)returnToRefererController:(BFAppLinkReturnToRefererController *)controller |
| | | willNavigateToAppLink:(BFAppLink *)appLink; |
| | | |
| | | /*! Called after the navigation has been attempted, with an indication of whether the referer |
| | | app link was successfully opened. */ |
| | | - (void)returnToRefererController:(BFAppLinkReturnToRefererController *)controller |
| | | didNavigateToAppLink:(BFAppLink *)url |
| | | type:(BFAppLinkNavigationType)type; |
| | | |
| | | @end |
| | | |
| | | /*! |
| | | A controller class that implements default behavior for a BFAppLinkReturnToRefererView, including |
| | | the ability to display the view above the navigation bar for navigation-based apps. |
| | | */ |
| | | @interface BFAppLinkReturnToRefererController : NSObject <BFAppLinkReturnToRefererViewDelegate> |
| | | |
| | | /*! |
| | | The delegate that will be notified when the user navigates back to the referer. |
| | | */ |
| | | @property (nonatomic, weak) id<BFAppLinkReturnToRefererControllerDelegate> delegate; |
| | | |
| | | /*! |
| | | The BFAppLinkReturnToRefererView this controller is controlling. |
| | | */ |
| | | @property (nonatomic, strong) BFAppLinkReturnToRefererView *view; |
| | | |
| | | /*! |
| | | Initializes a controller suitable for controlling a BFAppLinkReturnToRefererView that is to be displayed |
| | | contained within another UIView (i.e., not displayed above the navigation bar). |
| | | */ |
| | | - (instancetype)init; |
| | | |
| | | /*! |
| | | Initializes a controller suitable for controlling a BFAppLinkReturnToRefererView that is to be displayed |
| | | displayed above the navigation bar. |
| | | */ |
| | | - (instancetype)initForDisplayAboveNavController:(UINavigationController *)navController; |
| | | |
| | | /*! |
| | | Removes the view entirely from the navigation controller it is currently displayed in. |
| | | */ |
| | | - (void)removeFromNavController; |
| | | |
| | | /*! |
| | | Shows the BFAppLinkReturnToRefererView with the specified referer information. If nil or missing data, |
| | | the view will not be displayed. */ |
| | | - (void)showViewForRefererAppLink:(BFAppLink *)refererAppLink; |
| | | |
| | | /*! |
| | | Shows the BFAppLinkReturnToRefererView with referer information extracted from the specified URL. |
| | | If nil or missing referer App Link data, the view will not be displayed. */ |
| | | - (void)showViewForRefererURL:(NSURL *)url; |
| | | |
| | | /*! |
| | | Closes the view, possibly animating it. |
| | | */ |
| | | - (void)closeViewAnimated:(BOOL)animated; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2014, Facebook, Inc. |
| | | * All rights reserved. |
| | | * |
| | | * This source code is licensed under the BSD-style license found in the |
| | | * LICENSE file in the root directory of this source tree. An additional grant |
| | | * of patent rights can be found in the PATENTS file in the same directory. |
| | | * |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | #import <Bolts/BFAppLinkNavigation.h> |
| | | |
| | | @class BFAppLinkReturnToRefererView; |
| | | @class BFURL; |
| | | |
| | | typedef NS_ENUM(NSUInteger, BFIncludeStatusBarInSize) { |
| | | BFIncludeStatusBarInSizeNever, |
| | | BFIncludeStatusBarInSizeIOS7AndLater, |
| | | BFIncludeStatusBarInSizeAlways, |
| | | }; |
| | | |
| | | /*! |
| | | Protocol that a class can implement in order to be notified when the user has navigated back |
| | | to the referer of an App Link. |
| | | */ |
| | | @protocol BFAppLinkReturnToRefererViewDelegate <NSObject> |
| | | |
| | | /*! |
| | | Called when the user has tapped inside the close button. |
| | | */ |
| | | - (void)returnToRefererViewDidTapInsideCloseButton:(BFAppLinkReturnToRefererView *)view; |
| | | |
| | | /*! |
| | | Called when the user has tapped inside the App Link portion of the view. |
| | | */ |
| | | - (void)returnToRefererViewDidTapInsideLink:(BFAppLinkReturnToRefererView *)view |
| | | link:(BFAppLink *)link; |
| | | |
| | | @end |
| | | |
| | | /*! |
| | | Provides a UIView that displays a button allowing users to navigate back to the |
| | | application that launched the App Link currently being handled, if the App Link |
| | | contained referer data. The user can also close the view by clicking a close button |
| | | rather than navigating away. If the view is provided an App Link that does not contain |
| | | referer data, it will have zero size and no UI will be displayed. |
| | | */ |
| | | @interface BFAppLinkReturnToRefererView : UIView |
| | | |
| | | /*! |
| | | The delegate that will be notified when the user navigates back to the referer. |
| | | */ |
| | | @property (nonatomic, weak) id<BFAppLinkReturnToRefererViewDelegate> delegate; |
| | | |
| | | /*! |
| | | The color of the text label and close button. |
| | | */ |
| | | @property (nonatomic, strong) UIColor *textColor; |
| | | |
| | | @property (nonatomic, strong) BFAppLink *refererAppLink; |
| | | |
| | | /*! |
| | | Indicates whether to extend the size of the view to include the current status bar |
| | | size, for use in scenarios where the view might extend under the status bar on iOS 7 and |
| | | above; this property has no effect on earlier versions of iOS. |
| | | */ |
| | | @property (nonatomic, assign) BFIncludeStatusBarInSize includeStatusBarInSize; |
| | | |
| | | /*! |
| | | Indicates whether the user has closed the view by clicking the close button. |
| | | */ |
| | | @property (nonatomic, assign) BOOL closed; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2014, Facebook, Inc. |
| | | * All rights reserved. |
| | | * |
| | | * This source code is licensed under the BSD-style license found in the |
| | | * LICENSE file in the root directory of this source tree. An additional grant |
| | | * of patent rights can be found in the PATENTS file in the same directory. |
| | | * |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /*! |
| | | Represents a target defined in App Link metadata, consisting of at least |
| | | a URL, and optionally an App Store ID and name. |
| | | */ |
| | | @interface BFAppLinkTarget : NSObject |
| | | |
| | | /*! Creates a BFAppLinkTarget with the given app site and target URL. */ |
| | | + (instancetype)appLinkTargetWithURL:(NSURL *)url |
| | | appStoreId:(NSString *)appStoreId |
| | | appName:(NSString *)appName; |
| | | |
| | | /*! The URL prefix for this app link target */ |
| | | @property (nonatomic, strong, readonly) NSURL *URL; |
| | | |
| | | /*! The app ID for the app store */ |
| | | @property (nonatomic, copy, readonly) NSString *appStoreId; |
| | | |
| | | /*! The name of the app */ |
| | | @property (nonatomic, copy, readonly) NSString *appName; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2014, Facebook, Inc. |
| | | * All rights reserved. |
| | | * |
| | | * This source code is licensed under the BSD-style license found in the |
| | | * LICENSE file in the root directory of this source tree. An additional grant |
| | | * of patent rights can be found in the PATENTS file in the same directory. |
| | | * |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <Bolts/BFCancellationTokenRegistration.h> |
| | | |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | /*! |
| | | A block that will be called when a token is cancelled. |
| | | */ |
| | | typedef void(^BFCancellationBlock)(); |
| | | |
| | | /*! |
| | | The consumer view of a CancellationToken. |
| | | Propagates notification that operations should be canceled. |
| | | A BFCancellationToken has methods to inspect whether the token has been cancelled. |
| | | */ |
| | | @interface BFCancellationToken : NSObject |
| | | |
| | | /*! |
| | | Whether cancellation has been requested for this token source. |
| | | */ |
| | | @property (nonatomic, assign, readonly, getter=isCancellationRequested) BOOL cancellationRequested; |
| | | |
| | | /*! |
| | | Register a block to be notified when the token is cancelled. |
| | | If the token is already cancelled the delegate will be notified immediately. |
| | | */ |
| | | - (BFCancellationTokenRegistration *)registerCancellationObserverWithBlock:(BFCancellationBlock)block; |
| | | |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2014, Facebook, Inc. |
| | | * All rights reserved. |
| | | * |
| | | * This source code is licensed under the BSD-style license found in the |
| | | * LICENSE file in the root directory of this source tree. An additional grant |
| | | * of patent rights can be found in the PATENTS file in the same directory. |
| | | * |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | /*! |
| | | Represents the registration of a cancellation observer with a cancellation token. |
| | | Can be used to unregister the observer at a later time. |
| | | */ |
| | | @interface BFCancellationTokenRegistration : NSObject |
| | | |
| | | /*! |
| | | Removes the cancellation observer registered with the token |
| | | and releases all resources associated with this registration. |
| | | */ |
| | | - (void)dispose; |
| | | |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2014, Facebook, Inc. |
| | | * All rights reserved. |
| | | * |
| | | * This source code is licensed under the BSD-style license found in the |
| | | * LICENSE file in the root directory of this source tree. An additional grant |
| | | * of patent rights can be found in the PATENTS file in the same directory. |
| | | * |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | @class BFCancellationToken; |
| | | |
| | | /*! |
| | | BFCancellationTokenSource represents the producer side of a CancellationToken. |
| | | Signals to a CancellationToken that it should be canceled. |
| | | It is a cancellation token that also has methods |
| | | for changing the state of a token by cancelling it. |
| | | */ |
| | | @interface BFCancellationTokenSource : NSObject |
| | | |
| | | /*! |
| | | Creates a new cancellation token source. |
| | | */ |
| | | + (instancetype)cancellationTokenSource; |
| | | |
| | | /*! |
| | | The cancellation token associated with this CancellationTokenSource. |
| | | */ |
| | | @property (nonatomic, strong, readonly) BFCancellationToken *token; |
| | | |
| | | /*! |
| | | Whether cancellation has been requested for this token source. |
| | | */ |
| | | @property (nonatomic, assign, readonly, getter=isCancellationRequested) BOOL cancellationRequested; |
| | | |
| | | /*! |
| | | Cancels the token if it has not already been cancelled. |
| | | */ |
| | | - (void)cancel; |
| | | |
| | | /*! |
| | | Schedules a cancel operation on this CancellationTokenSource after the specified number of milliseconds. |
| | | @param millis The number of milliseconds to wait before completing the returned task. |
| | | If delay is `0` the cancel is executed immediately. If delay is `-1` any scheduled cancellation is stopped. |
| | | */ |
| | | - (void)cancelAfterDelay:(int)millis; |
| | | |
| | | /*! |
| | | Releases all resources associated with this token source, |
| | | including disposing of all registrations. |
| | | */ |
| | | - (void)dispose; |
| | | |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2014, Facebook, Inc. |
| | | * All rights reserved. |
| | | * |
| | | * This source code is licensed under the BSD-style license found in the |
| | | * LICENSE file in the root directory of this source tree. An additional grant |
| | | * of patent rights can be found in the PATENTS file in the same directory. |
| | | * |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | /*! |
| | | An object that can run a given block. |
| | | */ |
| | | @interface BFExecutor : NSObject |
| | | |
| | | /*! |
| | | Returns a default executor, which runs continuations immediately until the call stack gets too |
| | | deep, then dispatches to a new GCD queue. |
| | | */ |
| | | + (instancetype)defaultExecutor; |
| | | |
| | | /*! |
| | | Returns an executor that runs continuations on the thread where the previous task was completed. |
| | | */ |
| | | + (instancetype)immediateExecutor; |
| | | |
| | | /*! |
| | | Returns an executor that runs continuations on the main thread. |
| | | */ |
| | | + (instancetype)mainThreadExecutor; |
| | | |
| | | /*! |
| | | Returns a new executor that uses the given block to execute continuations. |
| | | @param block The block to use. |
| | | */ |
| | | + (instancetype)executorWithBlock:(void(^)(void(^block)()))block; |
| | | |
| | | /*! |
| | | Returns a new executor that runs continuations on the given queue. |
| | | @param queue The instance of `dispatch_queue_t` to dispatch all continuations onto. |
| | | */ |
| | | + (instancetype)executorWithDispatchQueue:(dispatch_queue_t)queue; |
| | | |
| | | /*! |
| | | Returns a new executor that runs continuations on the given queue. |
| | | @param queue The instance of `NSOperationQueue` to run all continuations on. |
| | | */ |
| | | + (instancetype)executorWithOperationQueue:(NSOperationQueue *)queue; |
| | | |
| | | /*! |
| | | Runs the given block using this executor's particular strategy. |
| | | @param block The block to execute. |
| | | */ |
| | | - (void)execute:(void(^)())block; |
| | | |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2014, Facebook, Inc. |
| | | * All rights reserved. |
| | | * |
| | | * This source code is licensed under the BSD-style license found in the |
| | | * LICENSE file in the root directory of this source tree. An additional grant |
| | | * of patent rights can be found in the PATENTS file in the same directory. |
| | | * |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /*! The name of the notification posted by BFMeasurementEvent */ |
| | | FOUNDATION_EXPORT NSString *const BFMeasurementEventNotificationName; |
| | | |
| | | /*! Defines keys in the userInfo object for the notification named BFMeasurementEventNotificationName */ |
| | | /*! The string field for the name of the event */ |
| | | FOUNDATION_EXPORT NSString *const BFMeasurementEventNameKey; |
| | | /*! The dictionary field for the arguments of the event */ |
| | | FOUNDATION_EXPORT NSString *const BFMeasurementEventArgsKey; |
| | | |
| | | /*! Bolts Events raised by BFMeasurementEvent for Applink */ |
| | | /*! |
| | | The name of the event posted when [BFURL URLWithURL:] is called successfully. This represents the successful parsing of an app link URL. |
| | | */ |
| | | FOUNDATION_EXPORT NSString *const BFAppLinkParseEventName; |
| | | |
| | | /*! |
| | | The name of the event posted when [BFURL URLWithInboundURL:] is called successfully. |
| | | This represents parsing an inbound app link URL from a different application |
| | | */ |
| | | FOUNDATION_EXPORT NSString *const BFAppLinkNavigateInEventName; |
| | | |
| | | /*! The event raised when the user navigates from your app to other apps */ |
| | | FOUNDATION_EXPORT NSString *const BFAppLinkNavigateOutEventName; |
| | | |
| | | /*! |
| | | The event raised when the user navigates out from your app and back to the referrer app. |
| | | e.g when the user leaves your app after tapping the back-to-referrer navigation bar |
| | | */ |
| | | FOUNDATION_EXPORT NSString *const BFAppLinkNavigateBackToReferrerEventName; |
| | | |
| | | @interface BFMeasurementEvent : NSObject |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2014, Facebook, Inc. |
| | | * All rights reserved. |
| | | * |
| | | * This source code is licensed under the BSD-style license found in the |
| | | * LICENSE file in the root directory of this source tree. An additional grant |
| | | * of patent rights can be found in the PATENTS file in the same directory. |
| | | * |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <Bolts/BFCancellationToken.h> |
| | | |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | /*! |
| | | Error domain used if there was multiple errors on <BFTask taskForCompletionOfAllTasks:>. |
| | | */ |
| | | extern NSString *const BFTaskErrorDomain; |
| | | |
| | | /*! |
| | | An error code used for <BFTask taskForCompletionOfAllTasks:>, if there were multiple errors. |
| | | */ |
| | | extern NSInteger const kBFMultipleErrorsError; |
| | | |
| | | /*! |
| | | An exception that is thrown if there was multiple exceptions on <BFTask taskForCompletionOfAllTasks:>. |
| | | */ |
| | | extern NSString *const BFTaskMultipleExceptionsException; |
| | | |
| | | /*! |
| | | An error userInfo key used if there were multiple errors on <BFTask taskForCompletionOfAllTasks:>. |
| | | Value type is `NSArray<NSError *> *`. |
| | | */ |
| | | extern NSString *const BFTaskMultipleErrorsUserInfoKey; |
| | | |
| | | /*! |
| | | An error userInfo key used if there were multiple exceptions on <BFTask taskForCompletionOfAllTasks:>. |
| | | Value type is `NSArray<NSException *> *`. |
| | | */ |
| | | extern NSString *const BFTaskMultipleExceptionsUserInfoKey; |
| | | |
| | | @class BFExecutor; |
| | | @class BFTask; |
| | | |
| | | /*! |
| | | The consumer view of a Task. A BFTask has methods to |
| | | inspect the state of the task, and to add continuations to |
| | | be run once the task is complete. |
| | | */ |
| | | @interface BFTask<__covariant ResultType> : NSObject |
| | | |
| | | /*! |
| | | A block that can act as a continuation for a task. |
| | | */ |
| | | typedef __nullable id(^BFContinuationBlock)(BFTask<ResultType> *task); |
| | | |
| | | /*! |
| | | Creates a task that is already completed with the given result. |
| | | @param result The result for the task. |
| | | */ |
| | | + (instancetype)taskWithResult:(nullable ResultType)result; |
| | | |
| | | /*! |
| | | Creates a task that is already completed with the given error. |
| | | @param error The error for the task. |
| | | */ |
| | | + (instancetype)taskWithError:(NSError *)error; |
| | | |
| | | /*! |
| | | Creates a task that is already completed with the given exception. |
| | | @param exception The exception for the task. |
| | | */ |
| | | + (instancetype)taskWithException:(NSException *)exception; |
| | | |
| | | /*! |
| | | Creates a task that is already cancelled. |
| | | */ |
| | | + (instancetype)cancelledTask; |
| | | |
| | | /*! |
| | | Returns a task that will be completed (with result == nil) once |
| | | all of the input tasks have completed. |
| | | @param tasks An `NSArray` of the tasks to use as an input. |
| | | */ |
| | | + (instancetype)taskForCompletionOfAllTasks:(nullable NSArray<BFTask *> *)tasks; |
| | | |
| | | /*! |
| | | Returns a task that will be completed once all of the input tasks have completed. |
| | | If all tasks complete successfully without being faulted or cancelled the result will be |
| | | an `NSArray` of all task results in the order they were provided. |
| | | @param tasks An `NSArray` of the tasks to use as an input. |
| | | */ |
| | | + (instancetype)taskForCompletionOfAllTasksWithResults:(nullable NSArray<BFTask *> *)tasks; |
| | | |
| | | /*! |
| | | Returns a task that will be completed once there is at least one successful task. |
| | | The first task to successuly complete will set the result, all other tasks results are |
| | | ignored. |
| | | @param tasks An `NSArray` of the tasks to use as an input. |
| | | */ |
| | | + (instancetype)taskForCompletionOfAnyTask:(nullable NSArray<BFTask *> *)tasks; |
| | | |
| | | /*! |
| | | Returns a task that will be completed a certain amount of time in the future. |
| | | @param millis The approximate number of milliseconds to wait before the |
| | | task will be finished (with result == nil). |
| | | */ |
| | | + (instancetype)taskWithDelay:(int)millis; |
| | | |
| | | /*! |
| | | Returns a task that will be completed a certain amount of time in the future. |
| | | @param millis The approximate number of milliseconds to wait before the |
| | | task will be finished (with result == nil). |
| | | @param token The cancellation token (optional). |
| | | */ |
| | | + (instancetype)taskWithDelay:(int)millis cancellationToken:(nullable BFCancellationToken *)token; |
| | | |
| | | /*! |
| | | Returns a task that will be completed after the given block completes with |
| | | the specified executor. |
| | | @param executor A BFExecutor responsible for determining how the |
| | | continuation block will be run. |
| | | @param block The block to immediately schedule to run with the given executor. |
| | | @returns A task that will be completed after block has run. |
| | | If block returns a BFTask, then the task returned from |
| | | this method will not be completed until that task is completed. |
| | | */ |
| | | + (instancetype)taskFromExecutor:(BFExecutor *)executor withBlock:(nullable id (^)())block; |
| | | |
| | | // Properties that will be set on the task once it is completed. |
| | | |
| | | /*! |
| | | The result of a successful task. |
| | | */ |
| | | @property (nullable, nonatomic, strong, readonly) ResultType result; |
| | | |
| | | /*! |
| | | The error of a failed task. |
| | | */ |
| | | @property (nullable, nonatomic, strong, readonly) NSError *error; |
| | | |
| | | /*! |
| | | The exception of a failed task. |
| | | */ |
| | | @property (nullable, nonatomic, strong, readonly) NSException *exception; |
| | | |
| | | /*! |
| | | Whether this task has been cancelled. |
| | | */ |
| | | @property (nonatomic, assign, readonly, getter=isCancelled) BOOL cancelled; |
| | | |
| | | /*! |
| | | Whether this task has completed due to an error or exception. |
| | | */ |
| | | @property (nonatomic, assign, readonly, getter=isFaulted) BOOL faulted; |
| | | |
| | | /*! |
| | | Whether this task has completed. |
| | | */ |
| | | @property (nonatomic, assign, readonly, getter=isCompleted) BOOL completed; |
| | | |
| | | /*! |
| | | Enqueues the given block to be run once this task is complete. |
| | | This method uses a default execution strategy. The block will be |
| | | run on the thread where the previous task completes, unless the |
| | | the stack depth is too deep, in which case it will be run on a |
| | | dispatch queue with default priority. |
| | | @param block The block to be run once this task is complete. |
| | | @returns A task that will be completed after block has run. |
| | | If block returns a BFTask, then the task returned from |
| | | this method will not be completed until that task is completed. |
| | | */ |
| | | - (BFTask *)continueWithBlock:(BFContinuationBlock)block; |
| | | |
| | | /*! |
| | | Enqueues the given block to be run once this task is complete. |
| | | This method uses a default execution strategy. The block will be |
| | | run on the thread where the previous task completes, unless the |
| | | the stack depth is too deep, in which case it will be run on a |
| | | dispatch queue with default priority. |
| | | @param block The block to be run once this task is complete. |
| | | @param cancellationToken The cancellation token (optional). |
| | | @returns A task that will be completed after block has run. |
| | | If block returns a BFTask, then the task returned from |
| | | this method will not be completed until that task is completed. |
| | | */ |
| | | - (BFTask *)continueWithBlock:(BFContinuationBlock)block cancellationToken:(nullable BFCancellationToken *)cancellationToken; |
| | | |
| | | /*! |
| | | Enqueues the given block to be run once this task is complete. |
| | | @param executor A BFExecutor responsible for determining how the |
| | | continuation block will be run. |
| | | @param block The block to be run once this task is complete. |
| | | @returns A task that will be completed after block has run. |
| | | If block returns a BFTask, then the task returned from |
| | | this method will not be completed until that task is completed. |
| | | */ |
| | | - (BFTask *)continueWithExecutor:(BFExecutor *)executor withBlock:(BFContinuationBlock)block; |
| | | /*! |
| | | Enqueues the given block to be run once this task is complete. |
| | | @param executor A BFExecutor responsible for determining how the |
| | | continuation block will be run. |
| | | @param block The block to be run once this task is complete. |
| | | @param cancellationToken The cancellation token (optional). |
| | | @returns A task that will be completed after block has run. |
| | | If block returns a BFTask, then the task returned from |
| | | his method will not be completed until that task is completed. |
| | | */ |
| | | - (BFTask *)continueWithExecutor:(BFExecutor *)executor |
| | | block:(BFContinuationBlock)block |
| | | cancellationToken:(nullable BFCancellationToken *)cancellationToken; |
| | | |
| | | /*! |
| | | Identical to continueWithBlock:, except that the block is only run |
| | | if this task did not produce a cancellation, error, or exception. |
| | | If it did, then the failure will be propagated to the returned |
| | | task. |
| | | @param block The block to be run once this task is complete. |
| | | @returns A task that will be completed after block has run. |
| | | If block returns a BFTask, then the task returned from |
| | | this method will not be completed until that task is completed. |
| | | */ |
| | | - (BFTask *)continueWithSuccessBlock:(BFContinuationBlock)block; |
| | | |
| | | /*! |
| | | Identical to continueWithBlock:, except that the block is only run |
| | | if this task did not produce a cancellation, error, or exception. |
| | | If it did, then the failure will be propagated to the returned |
| | | task. |
| | | @param block The block to be run once this task is complete. |
| | | @param cancellationToken The cancellation token (optional). |
| | | @returns A task that will be completed after block has run. |
| | | If block returns a BFTask, then the task returned from |
| | | this method will not be completed until that task is completed. |
| | | */ |
| | | - (BFTask *)continueWithSuccessBlock:(BFContinuationBlock)block cancellationToken:(nullable BFCancellationToken *)cancellationToken; |
| | | |
| | | /*! |
| | | Identical to continueWithExecutor:withBlock:, except that the block |
| | | is only run if this task did not produce a cancellation, error, or |
| | | exception. If it did, then the failure will be propagated to the |
| | | returned task. |
| | | @param executor A BFExecutor responsible for determining how the |
| | | continuation block will be run. |
| | | @param block The block to be run once this task is complete. |
| | | @returns A task that will be completed after block has run. |
| | | If block returns a BFTask, then the task returned from |
| | | this method will not be completed until that task is completed. |
| | | */ |
| | | - (BFTask *)continueWithExecutor:(BFExecutor *)executor withSuccessBlock:(BFContinuationBlock)block; |
| | | |
| | | /*! |
| | | Identical to continueWithExecutor:withBlock:, except that the block |
| | | is only run if this task did not produce a cancellation, error, or |
| | | exception. If it did, then the failure will be propagated to the |
| | | returned task. |
| | | @param executor A BFExecutor responsible for determining how the |
| | | continuation block will be run. |
| | | @param block The block to be run once this task is complete. |
| | | @param cancellationToken The cancellation token (optional). |
| | | @returns A task that will be completed after block has run. |
| | | If block returns a BFTask, then the task returned from |
| | | this method will not be completed until that task is completed. |
| | | */ |
| | | - (BFTask *)continueWithExecutor:(BFExecutor *)executor |
| | | successBlock:(BFContinuationBlock)block |
| | | cancellationToken:(nullable BFCancellationToken *)cancellationToken; |
| | | |
| | | /*! |
| | | Waits until this operation is completed. |
| | | This method is inefficient and consumes a thread resource while |
| | | it's running. It should be avoided. This method logs a warning |
| | | message if it is used on the main thread. |
| | | */ |
| | | - (void)waitUntilFinished; |
| | | |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2014, Facebook, Inc. |
| | | * All rights reserved. |
| | | * |
| | | * This source code is licensed under the BSD-style license found in the |
| | | * LICENSE file in the root directory of this source tree. An additional grant |
| | | * of patent rights can be found in the PATENTS file in the same directory. |
| | | * |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | @class BFTask<ResultType>; |
| | | |
| | | /*! |
| | | A BFTaskCompletionSource represents the producer side of tasks. |
| | | It is a task that also has methods for changing the state of the |
| | | task by settings its completion values. |
| | | */ |
| | | @interface BFTaskCompletionSource<__covariant ResultType> : NSObject |
| | | |
| | | /*! |
| | | Creates a new unfinished task. |
| | | */ |
| | | + (instancetype)taskCompletionSource; |
| | | |
| | | /*! |
| | | The task associated with this TaskCompletionSource. |
| | | */ |
| | | @property (nonatomic, strong, readonly) BFTask<ResultType> *task; |
| | | |
| | | /*! |
| | | Completes the task by setting the result. |
| | | Attempting to set this for a completed task will raise an exception. |
| | | @param result The result of the task. |
| | | */ |
| | | - (void)setResult:(nullable ResultType)result; |
| | | |
| | | /*! |
| | | Completes the task by setting the error. |
| | | Attempting to set this for a completed task will raise an exception. |
| | | @param error The error for the task. |
| | | */ |
| | | - (void)setError:(NSError *)error; |
| | | |
| | | /*! |
| | | Completes the task by setting an exception. |
| | | Attempting to set this for a completed task will raise an exception. |
| | | @param exception The exception for the task. |
| | | */ |
| | | - (void)setException:(NSException *)exception; |
| | | |
| | | /*! |
| | | Completes the task by marking it as cancelled. |
| | | Attempting to set this for a completed task will raise an exception. |
| | | */ |
| | | - (void)cancel; |
| | | |
| | | /*! |
| | | Sets the result of the task if it wasn't already completed. |
| | | @returns whether the new value was set. |
| | | */ |
| | | - (BOOL)trySetResult:(nullable ResultType)result; |
| | | |
| | | /*! |
| | | Sets the error of the task if it wasn't already completed. |
| | | @param error The error for the task. |
| | | @returns whether the new value was set. |
| | | */ |
| | | - (BOOL)trySetError:(NSError *)error; |
| | | |
| | | /*! |
| | | Sets the exception of the task if it wasn't already completed. |
| | | @param exception The exception for the task. |
| | | @returns whether the new value was set. |
| | | */ |
| | | - (BOOL)trySetException:(NSException *)exception; |
| | | |
| | | /*! |
| | | Sets the cancellation state of the task if it wasn't already completed. |
| | | @returns whether the new value was set. |
| | | */ |
| | | - (BOOL)trySetCancelled; |
| | | |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2014, Facebook, Inc. |
| | | * All rights reserved. |
| | | * |
| | | * This source code is licensed under the BSD-style license found in the |
| | | * LICENSE file in the root directory of this source tree. An additional grant |
| | | * of patent rights can be found in the PATENTS file in the same directory. |
| | | * |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | @class BFAppLink; |
| | | |
| | | /*! |
| | | Provides a set of utilities for working with NSURLs, such as parsing of query parameters |
| | | and handling for App Link requests. |
| | | */ |
| | | @interface BFURL : NSObject |
| | | |
| | | /*! |
| | | Creates a link target from a raw URL. |
| | | On success, this posts the BFAppLinkParseEventName measurement event. If you are constructing the BFURL within your application delegate's |
| | | application:openURL:sourceApplication:annotation:, you should instead use URLWithInboundURL:sourceApplication: |
| | | to support better BFMeasurementEvent notifications |
| | | @param url The instance of `NSURL` to create BFURL from. |
| | | */ |
| | | + (BFURL *)URLWithURL:(NSURL *)url; |
| | | |
| | | /*! |
| | | Creates a link target from a raw URL received from an external application. This is typically called from the app delegate's |
| | | application:openURL:sourceApplication:annotation: and will post the BFAppLinkNavigateInEventName measurement event. |
| | | @param url The instance of `NSURL` to create BFURL from. |
| | | @param sourceApplication the bundle ID of the app that is requesting your app to open the URL. The same sourceApplication in application:openURL:sourceApplication:annotation: |
| | | */ |
| | | + (BFURL *)URLWithInboundURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication; |
| | | |
| | | /*! |
| | | Gets the target URL. If the link is an App Link, this is the target of the App Link. |
| | | Otherwise, it is the url that created the target. |
| | | */ |
| | | @property (nonatomic, strong, readonly) NSURL *targetURL; |
| | | |
| | | /*! |
| | | Gets the query parameters for the target, parsed into an NSDictionary. |
| | | */ |
| | | @property (nonatomic, strong, readonly) NSDictionary *targetQueryParameters; |
| | | |
| | | /*! |
| | | If this link target is an App Link, this is the data found in al_applink_data. |
| | | Otherwise, it is nil. |
| | | */ |
| | | @property (nonatomic, strong, readonly) NSDictionary *appLinkData; |
| | | |
| | | /*! |
| | | If this link target is an App Link, this is the data found in extras. |
| | | */ |
| | | @property (nonatomic, strong, readonly) NSDictionary *appLinkExtras; |
| | | |
| | | /*! |
| | | The App Link indicating how to navigate back to the referer app, if any. |
| | | */ |
| | | @property (nonatomic, strong, readonly) BFAppLink *appLinkReferer; |
| | | |
| | | /*! |
| | | The URL that was used to create this BFURL. |
| | | */ |
| | | @property (nonatomic, strong, readonly) NSURL *inputURL; |
| | | |
| | | /*! |
| | | The query parameters of the inputURL, parsed into an NSDictionary. |
| | | */ |
| | | @property (nonatomic, strong, readonly) NSDictionary *inputQueryParameters; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2014, Facebook, Inc. |
| | | * All rights reserved. |
| | | * |
| | | * This source code is licensed under the BSD-style license found in the |
| | | * LICENSE file in the root directory of this source tree. An additional grant |
| | | * of patent rights can be found in the PATENTS file in the same directory. |
| | | * |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <Bolts/BFAppLinkResolving.h> |
| | | |
| | | /*! |
| | | A reference implementation for an App Link resolver that uses a hidden UIWebView |
| | | to parse the HTML containing App Link metadata. |
| | | */ |
| | | @interface BFWebViewAppLinkResolver : NSObject <BFAppLinkResolving> |
| | | |
| | | /*! |
| | | Gets the instance of a BFWebViewAppLinkResolver. |
| | | */ |
| | | + (instancetype)sharedInstance; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * Copyright (c) 2014, Facebook, Inc. |
| | | * All rights reserved. |
| | | * |
| | | * This source code is licensed under the BSD-style license found in the |
| | | * LICENSE file in the root directory of this source tree. An additional grant |
| | | * of patent rights can be found in the PATENTS file in the same directory. |
| | | * |
| | | */ |
| | | |
| | | #import <Bolts/BFCancellationToken.h> |
| | | #import <Bolts/BFCancellationTokenRegistration.h> |
| | | #import <Bolts/BFCancellationTokenSource.h> |
| | | #import <Bolts/BFExecutor.h> |
| | | #import <Bolts/BFTask.h> |
| | | #import <Bolts/BFTaskCompletionSource.h> |
| | | |
| | | #if __has_include(<Bolts/BFAppLink.h>) && TARGET_OS_IPHONE && !TARGET_OS_WATCH && !TARGET_OS_TV |
| | | #import <Bolts/BFAppLink.h> |
| | | #import <Bolts/BFAppLinkNavigation.h> |
| | | #import <Bolts/BFAppLinkResolving.h> |
| | | #import <Bolts/BFAppLinkReturnToRefererController.h> |
| | | #import <Bolts/BFAppLinkReturnToRefererView.h> |
| | | #import <Bolts/BFAppLinkTarget.h> |
| | | #import <Bolts/BFMeasurementEvent.h> |
| | | #import <Bolts/BFURL.h> |
| | | #import <Bolts/BFWebViewAppLinkResolver.h> |
| | | #endif |
| | | |
| | | |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | /** |
| | | A string containing the version of the Bolts Framework used by the current application. |
| | | */ |
| | | extern NSString *const BoltsFrameworkVersionString; |
| | | |
| | | NS_ASSUME_NONNULL_END |
New file |
| | |
| | | framework module Bolts { |
| | | umbrella header "Bolts.h" |
| | | |
| | | export * |
| | | module * { export * } |
| | | |
| | | explicit module BFAppLinkResolving { |
| | | header "BFAppLinkResolving.h" |
| | | export * |
| | | } |
| | | explicit module BFWebViewAppLinkResolver { |
| | | header "BFWebViewAppLinkResolver.h" |
| | | export * |
| | | } |
| | | } |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKCopying.h> |
| | | #import <FBSDKCoreKit/FBSDKGraphRequestConnection.h> |
| | | #import <FBSDKCoreKit/FBSDKMacros.h> |
| | | |
| | | /*! |
| | | @abstract Notification indicating that the `currentAccessToken` has changed. |
| | | @discussion the userInfo dictionary of the notification will contain keys |
| | | `FBSDKAccessTokenChangeOldKey` and |
| | | `FBSDKAccessTokenChangeNewKey`. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKAccessTokenDidChangeNotification; |
| | | |
| | | /*! |
| | | @abstract A key in the notification's userInfo that will be set |
| | | if and only if the user ID changed between the old and new tokens. |
| | | @discussion Token refreshes can occur automatically with the SDK |
| | | which do not change the user. If you're only interested in user |
| | | changes (such as logging out), you should check for the existence |
| | | of this key. The value is a NSNumber with a boolValue. |
| | | |
| | | On a fresh start of the app where the SDK reads in the cached value |
| | | of an access token, this key will also exist since the access token |
| | | is moving from a null state (no user) to a non-null state (user). |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKAccessTokenDidChangeUserID; |
| | | |
| | | /* |
| | | @abstract key in notification's userInfo object for getting the old token. |
| | | @discussion If there was no old token, the key will not be present. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKAccessTokenChangeOldKey; |
| | | |
| | | /* |
| | | @abstract key in notification's userInfo object for getting the new token. |
| | | @discussion If there is no new token, the key will not be present. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKAccessTokenChangeNewKey; |
| | | |
| | | |
| | | /*! |
| | | @class FBSDKAccessToken |
| | | @abstract Represents an immutable access token for using Facebook services. |
| | | */ |
| | | @interface FBSDKAccessToken : NSObject<FBSDKCopying, NSSecureCoding> |
| | | |
| | | /*! |
| | | @abstract Returns the app ID. |
| | | */ |
| | | @property (readonly, copy, nonatomic) NSString *appID; |
| | | |
| | | /*! |
| | | @abstract Returns the known declined permissions. |
| | | */ |
| | | @property (readonly, copy, nonatomic) NSSet *declinedPermissions; |
| | | |
| | | /*! |
| | | @abstract Returns the expiration date. |
| | | */ |
| | | @property (readonly, copy, nonatomic) NSDate *expirationDate; |
| | | |
| | | /*! |
| | | @abstract Returns the known granted permissions. |
| | | */ |
| | | @property (readonly, copy, nonatomic) NSSet *permissions; |
| | | |
| | | /*! |
| | | @abstract Returns the date the token was last refreshed. |
| | | */ |
| | | @property (readonly, copy, nonatomic) NSDate *refreshDate; |
| | | |
| | | /*! |
| | | @abstract Returns the opaque token string. |
| | | */ |
| | | @property (readonly, copy, nonatomic) NSString *tokenString; |
| | | |
| | | /*! |
| | | @abstract Returns the user ID. |
| | | */ |
| | | @property (readonly, copy, nonatomic) NSString *userID; |
| | | |
| | | - (instancetype)init NS_UNAVAILABLE; |
| | | + (instancetype)new NS_UNAVAILABLE; |
| | | |
| | | /*! |
| | | @abstract Initializes a new instance. |
| | | @param tokenString the opaque token string. |
| | | @param permissions the granted permissions. Note this is converted to NSSet and is only |
| | | an NSArray for the convenience of literal syntax. |
| | | @param declinedPermissions the declined permissions. Note this is converted to NSSet and is only |
| | | an NSArray for the convenience of literal syntax. |
| | | @param appID the app ID. |
| | | @param userID the user ID. |
| | | @param expirationDate the optional expiration date (defaults to distantFuture). |
| | | @param refreshDate the optional date the token was last refreshed (defaults to today). |
| | | @discussion This initializer should only be used for advanced apps that |
| | | manage tokens explicitly. Typical login flows only need to use `FBSDKLoginManager` |
| | | along with `+currentAccessToken`. |
| | | */ |
| | | - (instancetype)initWithTokenString:(NSString *)tokenString |
| | | permissions:(NSArray *)permissions |
| | | declinedPermissions:(NSArray *)declinedPermissions |
| | | appID:(NSString *)appID |
| | | userID:(NSString *)userID |
| | | expirationDate:(NSDate *)expirationDate |
| | | refreshDate:(NSDate *)refreshDate |
| | | NS_DESIGNATED_INITIALIZER; |
| | | |
| | | /*! |
| | | @abstract Convenience getter to determine if a permission has been granted |
| | | @param permission The permission to check. |
| | | */ |
| | | - (BOOL)hasGranted:(NSString *)permission; |
| | | |
| | | /*! |
| | | @abstract Compares the receiver to another FBSDKAccessToken |
| | | @param token The other token |
| | | @return YES if the receiver's values are equal to the other token's values; otherwise NO |
| | | */ |
| | | - (BOOL)isEqualToAccessToken:(FBSDKAccessToken *)token; |
| | | |
| | | /*! |
| | | @abstract Returns the "global" access token that represents the currently logged in user. |
| | | @discussion The `currentAccessToken` is a convenient representation of the token of the |
| | | current user and is used by other SDK components (like `FBSDKLoginManager`). |
| | | */ |
| | | + (FBSDKAccessToken *)currentAccessToken; |
| | | |
| | | /*! |
| | | @abstract Sets the "global" access token that represents the currently logged in user. |
| | | @param token The access token to set. |
| | | @discussion This will broadcast a notification and save the token to the app keychain. |
| | | */ |
| | | + (void)setCurrentAccessToken:(FBSDKAccessToken *)token; |
| | | |
| | | /*! |
| | | @abstract Refresh the current access token's permission state and extend the token's expiration date, |
| | | if possible. |
| | | @param completionHandler an optional callback handler that can surface any errors related to permission refreshing. |
| | | @discussion On a successful refresh, the currentAccessToken will be updated so you typically only need to |
| | | observe the `FBSDKAccessTokenDidChangeNotification` notification. |
| | | |
| | | If a token is already expired, it cannot be refreshed. |
| | | */ |
| | | + (void)refreshCurrentAccessToken:(FBSDKGraphRequestHandler)completionHandler; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import "FBSDKMacros.h" |
| | | |
| | | @class FBSDKAccessToken; |
| | | @class FBSDKGraphRequest; |
| | | |
| | | /*! @abstract NSNotificationCenter name indicating a result of a failed log flush attempt. The posted object will be an NSError instance. */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventsLoggingResultNotification; |
| | | |
| | | /*! @abstract optional plist key ("FacebookLoggingOverrideAppID") for setting `loggingOverrideAppID` */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventsOverrideAppIDBundleKey; |
| | | |
| | | /*! |
| | | |
| | | @typedef NS_ENUM (NSUInteger, FBSDKAppEventsFlushBehavior) |
| | | |
| | | @abstract Specifies when `FBSDKAppEvents` sends log events to the server. |
| | | |
| | | */ |
| | | typedef NS_ENUM(NSUInteger, FBSDKAppEventsFlushBehavior) |
| | | { |
| | | |
| | | /*! Flush automatically: periodically (once a minute or every 100 logged events) and always at app reactivation. */ |
| | | FBSDKAppEventsFlushBehaviorAuto = 0, |
| | | |
| | | /*! Only flush when the `flush` method is called. When an app is moved to background/terminated, the |
| | | events are persisted and re-established at activation, but they will only be written with an |
| | | explicit call to `flush`. */ |
| | | FBSDKAppEventsFlushBehaviorExplicitOnly, |
| | | |
| | | }; |
| | | |
| | | /*! |
| | | @methodgroup Predefined event names for logging events common to many apps. Logging occurs through the `logEvent` family of methods on `FBSDKAppEvents`. |
| | | Common event parameters are provided in the `FBSDKAppEventsParameterNames*` constants. |
| | | */ |
| | | |
| | | /*! Log this event when the user has achieved a level in the app. */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventNameAchievedLevel; |
| | | |
| | | /*! Log this event when the user has entered their payment info. */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventNameAddedPaymentInfo; |
| | | |
| | | /*! Log this event when the user has added an item to their cart. The valueToSum passed to logEvent should be the item's price. */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventNameAddedToCart; |
| | | |
| | | /*! Log this event when the user has added an item to their wishlist. The valueToSum passed to logEvent should be the item's price. */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventNameAddedToWishlist; |
| | | |
| | | /*! Log this event when a user has completed registration with the app. */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventNameCompletedRegistration; |
| | | |
| | | /*! Log this event when the user has completed a tutorial in the app. */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventNameCompletedTutorial; |
| | | |
| | | /*! Log this event when the user has entered the checkout process. The valueToSum passed to logEvent should be the total price in the cart. */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventNameInitiatedCheckout; |
| | | |
| | | /*! Log this event when the user has rated an item in the app. The valueToSum passed to logEvent should be the numeric rating. */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventNameRated; |
| | | |
| | | /*! Log this event when a user has performed a search within the app. */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventNameSearched; |
| | | |
| | | /*! Log this event when the user has spent app credits. The valueToSum passed to logEvent should be the number of credits spent. */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventNameSpentCredits; |
| | | |
| | | /*! Log this event when the user has unlocked an achievement in the app. */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventNameUnlockedAchievement; |
| | | |
| | | /*! Log this event when a user has viewed a form of content in the app. */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventNameViewedContent; |
| | | |
| | | /*! |
| | | @methodgroup Predefined event name parameters for common additional information to accompany events logged through the `logEvent` family |
| | | of methods on `FBSDKAppEvents`. Common event names are provided in the `FBAppEventName*` constants. |
| | | */ |
| | | |
| | | /*! Parameter key used to specify an ID for the specific piece of content being logged about. Could be an EAN, article identifier, etc., depending on the nature of the app. */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameContentID; |
| | | |
| | | /*! Parameter key used to specify a generic content type/family for the logged event, e.g. "music", "photo", "video". Options to use will vary based upon what the app is all about. */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameContentType; |
| | | |
| | | /*! 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 <http://en.wikipedia.org/wiki/ISO_4217>. */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameCurrency; |
| | | |
| | | /*! Parameter key used to specify a description appropriate to the event being logged. E.g., the name of the achievement unlocked in the `FBAppEventNameAchievementUnlocked` event. */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameDescription; |
| | | |
| | | /*! Parameter key used to specify the level achieved in a `FBAppEventNameAchieved` event. */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameLevel; |
| | | |
| | | /*! Parameter key used to specify the maximum rating available for the `FBAppEventNameRate` event. E.g., "5" or "10". */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameMaxRatingValue; |
| | | |
| | | /*! Parameter key used to specify how many items are being processed for an `FBAppEventNameInitiatedCheckout` or `FBAppEventNamePurchased` event. */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameNumItems; |
| | | |
| | | /*! Parameter key used to specify whether payment info is available for the `FBAppEventNameInitiatedCheckout` event. `FBSDKAppEventParameterValueYes` and `FBSDKAppEventParameterValueNo` are good canonical values to use for this parameter. */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventParameterNamePaymentInfoAvailable; |
| | | |
| | | /*! Parameter key used to specify method user has used to register for the app, e.g., "Facebook", "email", "Twitter", etc */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameRegistrationMethod; |
| | | |
| | | /*! Parameter key used to specify the string provided by the user for a search operation. */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameSearchString; |
| | | |
| | | /*! Parameter key used to specify whether the activity being logged about was successful or not. `FBSDKAppEventParameterValueYes` and `FBSDKAppEventParameterValueNo` are good canonical values to use for this parameter. */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameSuccess; |
| | | |
| | | /* |
| | | @methodgroup Predefined values to assign to event parameters that accompany events logged through the `logEvent` family |
| | | of methods on `FBSDKAppEvents`. Common event parameters are provided in the `FBSDKAppEventParameterName*` constants. |
| | | */ |
| | | |
| | | /*! Yes-valued parameter value to be used with parameter keys that need a Yes/No value */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventParameterValueYes; |
| | | |
| | | /*! No-valued parameter value to be used with parameter keys that need a Yes/No value */ |
| | | FBSDK_EXTERN NSString *const FBSDKAppEventParameterValueNo; |
| | | |
| | | |
| | | /*! |
| | | |
| | | @class FBSDKAppEvents |
| | | |
| | | @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 `FBSDKAppEvents` 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 `FBSDKAppEvents`: |
| | | |
| | | + 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 15 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 `FBSDKAppEvents` class is thread-safe in that events may be logged from any of the app's threads. |
| | | |
| | | + The developer can set the `flushBehavior` on `FBSDKAppEvents` 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 `FBSDKLoggingBehaviorAppEvents` 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 1000. |
| | | + There is a limit to the number of unique parameter names in the provided parameters that can |
| | | be used per event, on the order of 25. This is not just for an individual call, but for all |
| | | invocations for that eventName. |
| | | + Event names and parameter names (the keys in the NSDictionary) must be between 2 and 40 characters, and |
| | | must consist of alphanumeric characters, _, -, or spaces. |
| | | + The length of each parameter value can be no more than on the order of 100 characters. |
| | | |
| | | */ |
| | | @interface FBSDKAppEvents : NSObject |
| | | |
| | | /* |
| | | * Basic event logging |
| | | */ |
| | | |
| | | /*! |
| | | |
| | | @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 `FBSDKAppEvents` documentation. |
| | | |
| | | */ |
| | | + (void)logEvent:(NSString *)eventName; |
| | | |
| | | /*! |
| | | |
| | | @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 `FBSDKAppEvents` 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; |
| | | |
| | | |
| | | /*! |
| | | |
| | | @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 `FBSDKAppEvents` 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 `FBSDKAppEvents` documentation. Commonly used parameter names |
| | | are provided in `FBSDKAppEventParameterName*` constants. |
| | | */ |
| | | + (void)logEvent:(NSString *)eventName |
| | | parameters:(NSDictionary *)parameters; |
| | | |
| | | /*! |
| | | |
| | | @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 `FBSDKAppEvents` 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 `FBSDKAppEvents` documentation. Commonly used parameter names |
| | | are provided in `FBSDKAppEventParameterName*` constants. |
| | | |
| | | */ |
| | | + (void)logEvent:(NSString *)eventName |
| | | valueToSum:(double)valueToSum |
| | | parameters:(NSDictionary *)parameters; |
| | | |
| | | |
| | | /*! |
| | | |
| | | @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 <FBSession>. 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 `FBSDKAppEvents` 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 `FBSDKAppEvents` documentation. Commonly used parameter names |
| | | are provided in `FBSDKAppEventParameterName*` constants. |
| | | |
| | | @param accessToken The optional access token to log the event as. |
| | | */ |
| | | + (void)logEvent:(NSString *)eventName |
| | | valueToSum:(NSNumber *)valueToSum |
| | | parameters:(NSDictionary *)parameters |
| | | accessToken:(FBSDKAccessToken *)accessToken; |
| | | |
| | | /* |
| | | * Purchase logging |
| | | */ |
| | | |
| | | /*! |
| | | |
| | | @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 <http://en.wikipedia.org/wiki/ISO_4217>. |
| | | |
| | | @discussion This event immediately triggers a flush of the `FBSDKAppEvents` event queue, unless the `flushBehavior` is set |
| | | to `FBSDKAppEventsFlushBehaviorExplicitOnly`. |
| | | |
| | | */ |
| | | + (void)logPurchase:(double)purchaseAmount |
| | | currency:(NSString *)currency; |
| | | |
| | | /*! |
| | | |
| | | @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 <http://en.wikipedia.org/wiki/ISO_4217>. |
| | | |
| | | @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 `FBSDKAppEvents` documentation. Commonly used parameter names |
| | | are provided in `FBSDKAppEventParameterName*` constants. |
| | | |
| | | @discussion This event immediately triggers a flush of the `FBSDKAppEvents` event queue, unless the `flushBehavior` is set |
| | | to `FBSDKAppEventsFlushBehaviorExplicitOnly`. |
| | | |
| | | */ |
| | | + (void)logPurchase:(double)purchaseAmount |
| | | currency:(NSString *)currency |
| | | parameters:(NSDictionary *)parameters; |
| | | |
| | | /*! |
| | | |
| | | @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 <FBSession> 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 <http://en.wikipedia.org/wiki/ISO_4217>. |
| | | |
| | | @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 `FBSDKAppEvents` documentation. Commonly used parameter names |
| | | are provided in `FBSDKAppEventParameterName*` constants. |
| | | |
| | | @param accessToken The optional access token to log the event as. |
| | | |
| | | @discussion This event immediately triggers a flush of the `FBSDKAppEvents` event queue, unless the `flushBehavior` is set |
| | | to `FBSDKAppEventsFlushBehaviorExplicitOnly`. |
| | | |
| | | */ |
| | | + (void)logPurchase:(double)purchaseAmount |
| | | currency:(NSString *)currency |
| | | parameters:(NSDictionary *)parameters |
| | | accessToken:(FBSDKAccessToken *)accessToken; |
| | | |
| | | |
| | | /* |
| | | * Push Notifications Logging |
| | | */ |
| | | |
| | | /*! |
| | | @abstract |
| | | Log an app event that tracks that the application was open via Push Notification. |
| | | |
| | | @param payload Notification payload received via `UIApplicationDelegate`. |
| | | */ |
| | | + (void)logPushNotificationOpen:(NSDictionary *)payload; |
| | | |
| | | /*! |
| | | @abstract |
| | | Log an app event that tracks that a custom action was taken from a push notification. |
| | | |
| | | @param payload Notification payload received via `UIApplicationDelegate`. |
| | | @param action Name of the action that was taken. |
| | | */ |
| | | + (void)logPushNotificationOpen:(NSDictionary *)payload action:(NSString *)action; |
| | | |
| | | /*! |
| | | |
| | | @abstract |
| | | Notifies the events system that the app has launched and, when appropriate, logs an "activated app" event. Should typically be placed in the |
| | | app delegates' `applicationDidBecomeActive:` method. |
| | | |
| | | This method also takes care of logging the event indicating the first time this app has been launched, which, among other things, is used to |
| | | track user acquisition and app install ads conversions. |
| | | |
| | | @discussion |
| | | `activateApp` will not log an event on every app launch, since launches happen every time the app is backgrounded and then foregrounded. |
| | | "activated app" events will be logged when the app has not been active for more than 60 seconds. This method also causes a "deactivated app" |
| | | event to be logged when sessions are "completed", and these events are logged with the session length, with an indication of how much |
| | | time has elapsed between sessions, and with the number of background/foreground interruptions that session had. This data |
| | | is all visible in your app's App Events Insights. |
| | | */ |
| | | + (void)activateApp; |
| | | |
| | | /* |
| | | * Push Notifications Registration |
| | | */ |
| | | |
| | | /*! |
| | | @abstract |
| | | Sets a device token to register the current application installation for push notifications. |
| | | |
| | | @discussion |
| | | Sets a device token from `NSData` representation that you get from `UIApplicationDelegate.-application:didRegisterForRemoteNotificationsWithDeviceToken:`. |
| | | |
| | | @param deviceToken Device token data. |
| | | */ |
| | | + (void)setPushNotificationsDeviceToken:(NSData *)deviceToken; |
| | | |
| | | /* |
| | | * Control over event batching/flushing |
| | | */ |
| | | |
| | | /*! |
| | | |
| | | @abstract |
| | | Get the current event flushing behavior specifying when events are sent back to Facebook servers. |
| | | */ |
| | | + (FBSDKAppEventsFlushBehavior)flushBehavior; |
| | | |
| | | /*! |
| | | |
| | | @abstract |
| | | Set the current event flushing behavior specifying when events are sent back to Facebook servers. |
| | | |
| | | @param flushBehavior The desired `FBSDKAppEventsFlushBehavior` to be used. |
| | | */ |
| | | + (void)setFlushBehavior:(FBSDKAppEventsFlushBehavior)flushBehavior; |
| | | |
| | | /*! |
| | | @abstract |
| | | Set the 'override' App ID for App Event logging. |
| | | |
| | | @discussion |
| | | In some cases, apps want to use one Facebook App ID for login and social presence and another |
| | | for App Event logging. (An example is if multiple apps from the same company share an app ID for login, but |
| | | want distinct logging.) By default, this value is `nil`, and defers to the `FBSDKAppEventsOverrideAppIDBundleKey` |
| | | plist value. If that's not set, it defaults to `[FBSDKSettings appID]`. |
| | | |
| | | This should be set before any other calls are made to `FBSDKAppEvents`. Thus, you should set it in your application |
| | | delegate's `application:didFinishLaunchingWithOptions:` delegate. |
| | | |
| | | @param appID The Facebook App ID to be used for App Event logging. |
| | | */ |
| | | + (void)setLoggingOverrideAppID:(NSString *)appID; |
| | | |
| | | /*! |
| | | @abstract |
| | | Get the 'override' App ID for App Event logging. |
| | | |
| | | @see setLoggingOverrideAppID: |
| | | |
| | | */ |
| | | + (NSString *)loggingOverrideAppID; |
| | | |
| | | |
| | | /*! |
| | | @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 `FBSDKAppEventsLoggingResultNotification`. |
| | | */ |
| | | + (void)flush; |
| | | |
| | | /*! |
| | | @abstract |
| | | Creates 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 accessToken The access token to use to establish the user's identity for users logged into Facebook through this app. |
| | | If `nil`, then the `[FBSDKAccessToken currentAccessToken]` is used. |
| | | |
| | | @discussion |
| | | 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 access token is valid, |
| | | the ID will represent the user associated with that token; 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 `[FBSDKSettings limitEventAndDataUsage]` flag, or a specific Facebook user cannot be identified. |
| | | */ |
| | | + (FBSDKGraphRequest *)requestForCustomAudienceThirdPartyIDWithAccessToken:(FBSDKAccessToken *)accessToken; |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | @class BFTask; |
| | | |
| | | // Check if Bolts.framework is available for import |
| | | #if __has_include(<Bolts/BFAppLinkResolving.h>) |
| | | // Import it if it's available |
| | | # import <Bolts/BFAppLinkResolving.h> |
| | | #else |
| | | // Otherwise - redeclare BFAppLinkResolving protocol to resolve the problem of missing symbols |
| | | // Please note: Bolts.framework is still required for AppLink resolving to work, |
| | | // but this allows FBSDKCoreKit to weakly link Bolts.framework as well as this enables clang modulemaps to work. |
| | | |
| | | /*! |
| | | Implement this protocol to provide an alternate strategy for resolving |
| | | App Links that may include pre-fetching, caching, or querying for App Link |
| | | data from an index provided by a service provider. |
| | | */ |
| | | @protocol BFAppLinkResolving <NSObject> |
| | | |
| | | /*! |
| | | Asynchronously resolves App Link data for a given URL. |
| | | |
| | | @param url The URL to resolve into an App Link. |
| | | @returns A BFTask that will return a BFAppLink for the given URL. |
| | | */ |
| | | - (BFTask *)appLinkFromURLInBackground:(NSURL *)url; |
| | | |
| | | @end |
| | | |
| | | #endif |
| | | |
| | | /*! |
| | | @class FBSDKAppLinkResolver |
| | | |
| | | @abstract |
| | | Provides an implementation of the BFAppLinkResolving protocol that uses the Facebook App Link |
| | | Index API to resolve App Links given a URL. It also provides an additional helper method that can resolve |
| | | multiple App Links in a single call. |
| | | |
| | | @discussion |
| | | Usage of this type requires a client token. See `[FBSDKSettings setClientToken:]` and linking |
| | | Bolts.framework |
| | | */ |
| | | @interface FBSDKAppLinkResolver : NSObject<BFAppLinkResolving> |
| | | |
| | | /*! |
| | | @abstract Asynchronously resolves App Link data for multiple URLs. |
| | | |
| | | @param urls An array of NSURLs to resolve into App Links. |
| | | @returns A BFTask that will return dictionary mapping input NSURLs to their |
| | | corresponding BFAppLink. |
| | | |
| | | @discussion |
| | | You should set the client token before making this call. See `[FBSDKSettings setClientToken:]` |
| | | */ |
| | | - (BFTask *)appLinksFromURLsInBackground:(NSArray *)urls; |
| | | |
| | | /*! |
| | | @abstract Allocates and initializes a new instance of FBSDKAppLinkResolver. |
| | | */ |
| | | + (instancetype)resolver; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /*! |
| | | @abstract Describes the callback for fetchDeferredAppLink. |
| | | @param url the url representing the deferred App Link |
| | | @param error the error during the request, if any |
| | | |
| | | @discussion The url may also have a fb_click_time_utc query parameter that |
| | | represents when the click occurred that caused the deferred App Link to be created. |
| | | */ |
| | | typedef void (^FBSDKDeferredAppLinkHandler)(NSURL *url, NSError *error); |
| | | |
| | | |
| | | /*! |
| | | @abstract Describes the callback for fetchOrganicDeferredAppLink. |
| | | @param url the url representing the deferred App Link |
| | | */ |
| | | typedef void (^FBSDKDeferredAppInviteHandler)(NSURL *url); |
| | | |
| | | |
| | | /*! |
| | | @abstract Class containing App Links related utility methods. |
| | | */ |
| | | @interface FBSDKAppLinkUtility : NSObject |
| | | |
| | | /*! |
| | | @abstract |
| | | Call this method from the main thread to fetch deferred applink data if you use Mobile App |
| | | Engagement Ads (https://developers.facebook.com/docs/ads-for-apps/mobile-app-ads-engagement). |
| | | This may require a network round trip. If successful, the handler is invoked with the link |
| | | data (this will only return a valid URL once, and future calls will result in a nil URL |
| | | value in the callback). |
| | | |
| | | @param handler the handler to be invoked if there is deferred App Link data |
| | | |
| | | @discussion The handler 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:). |
| | | */ |
| | | + (void)fetchDeferredAppLink:(FBSDKDeferredAppLinkHandler)handler; |
| | | |
| | | /*! |
| | | @abstract Call this method from the main thread to fetch deferred deeplink for App Invites |
| | | Handler is called with deeplink url, if found, nil otherwise. |
| | | |
| | | @param handler Handler to be called when we fetch deeplink url. |
| | | |
| | | @return YES if async fetch process was started, NO if it failed to start. Note it returns NO |
| | | for versions < iOS 9. |
| | | |
| | | @discussion Call this method from the main thread to fetch deferred deeplink if you use App Invites. |
| | | This may require a network round trip. If successful, this will call the handler provided, with |
| | | deferred deeplink that was clicked by the user. If there is a error/timeout, handler will be called |
| | | with nil. |
| | | This method only works on iOS 9+ and returns NO otherwise. |
| | | 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 |
| | | didFinishLaunchingWithOptions:). |
| | | */ |
| | | + (BOOL)fetchDeferredAppInvite:(FBSDKDeferredAppInviteHandler)handler; |
| | | |
| | | /* |
| | | @abstract Call this method to fetch promotion code from the url, if it's present. This function |
| | | requires Bolts framework. |
| | | |
| | | Note: This throws an exception if Bolts.framework is not linked. Add '[BFURL class]' in intialize method |
| | | of your AppDelegate. |
| | | |
| | | @param url App Link url that was passed to the app. |
| | | |
| | | @return Promotion code string. |
| | | |
| | | @discussion Call this method to fetch App Invite Promotion Code from applink if present. |
| | | This can be used to fetch the promotion code that was associated with the invite when it |
| | | was created. This method should be called with the url from the openURL method. |
| | | */ |
| | | + (NSString*)appInvitePromotionCodeFromURL:(NSURL*)url; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | /*! |
| | | @class FBSDKApplicationDelegate |
| | | |
| | | @abstract |
| | | The FBSDKApplicationDelegate is designed to post process the results from Facebook Login |
| | | or Facebook Dialogs (or any action that requires switching over to the native Facebook |
| | | app or Safari). |
| | | |
| | | @discussion |
| | | The methods in this class are designed to mirror those in UIApplicationDelegate, and you |
| | | should call them in the respective methods in your AppDelegate implementation. |
| | | */ |
| | | @interface FBSDKApplicationDelegate : NSObject |
| | | |
| | | /*! |
| | | @abstract Gets the singleton instance. |
| | | */ |
| | | + (instancetype)sharedInstance; |
| | | |
| | | /*! |
| | | @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 Safari as part of SSO authorization flow or Facebook dialogs. |
| | | |
| | | @param application The application as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. |
| | | |
| | | @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 annotation The annotation as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. |
| | | |
| | | @return YES if the url was intended for the Facebook SDK, NO if not. |
| | | */ |
| | | - (BOOL)application:(UIApplication *)application |
| | | openURL:(NSURL *)url |
| | | sourceApplication:(NSString *)sourceApplication |
| | | annotation:(id)annotation; |
| | | |
| | | /*! |
| | | @abstract |
| | | Call this method from the [UIApplicationDelegate application:didFinishLaunchingWithOptions:] method |
| | | of the AppDelegate for your app. It should be invoked for the proper use of the Facebook SDK. |
| | | |
| | | @param application The application as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:]. |
| | | |
| | | @param launchOptions The launchOptions as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:]. |
| | | |
| | | @return YES if the url was intended for the Facebook SDK, NO if not. |
| | | */ |
| | | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | /*! |
| | | @abstract A base class for common SDK buttons. |
| | | */ |
| | | @interface FBSDKButton : UIButton |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKMacros.h> |
| | | |
| | | /*! |
| | | @abstract The error domain for all errors from FBSDKCoreKit. |
| | | @discussion Error codes from the SDK in the range 0-99 are reserved for this domain. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKErrorDomain; |
| | | |
| | | /*! |
| | | @typedef NS_ENUM(NSInteger, FBSDKErrorCode) |
| | | @abstract Error codes for FBSDKErrorDomain. |
| | | */ |
| | | typedef NS_ENUM(NSInteger, FBSDKErrorCode) |
| | | { |
| | | /*! |
| | | @abstract Reserved. |
| | | */ |
| | | FBSDKReservedErrorCode = 0, |
| | | |
| | | /*! |
| | | @abstract The error code for errors from invalid encryption on incoming encryption URLs. |
| | | */ |
| | | FBSDKEncryptionErrorCode, |
| | | |
| | | /*! |
| | | @abstract The error code for errors from invalid arguments to SDK methods. |
| | | */ |
| | | FBSDKInvalidArgumentErrorCode, |
| | | |
| | | /*! |
| | | @abstract The error code for unknown errors. |
| | | */ |
| | | FBSDKUnknownErrorCode, |
| | | |
| | | /*! |
| | | @abstract A request failed due to a network error. Use NSUnderlyingErrorKey to retrieve |
| | | the error object from the NSURLConnection for more information. |
| | | */ |
| | | FBSDKNetworkErrorCode, |
| | | |
| | | /*! |
| | | @abstract The error code for errors encounted during an App Events flush. |
| | | */ |
| | | FBSDKAppEventsFlushErrorCode, |
| | | |
| | | /*! |
| | | @abstract An endpoint that returns a binary response was used with FBSDKGraphRequestConnection. |
| | | @discussion Endpoints that return image/jpg, etc. should be accessed using NSURLRequest |
| | | */ |
| | | FBSDKGraphRequestNonTextMimeTypeReturnedErrorCode, |
| | | |
| | | /*! |
| | | @abstract The operation failed because the server returned an unexpected response. |
| | | @discussion You can get this error if you are not using the most recent SDK, or you are accessing a version of the |
| | | Graph API incompatible with the current SDK. |
| | | */ |
| | | FBSDKGraphRequestProtocolMismatchErrorCode, |
| | | |
| | | /*! |
| | | @abstract The Graph API returned an error. |
| | | @discussion See below for useful userInfo keys (beginning with FBSDKGraphRequestError*) |
| | | */ |
| | | FBSDKGraphRequestGraphAPIErrorCode, |
| | | |
| | | /*! |
| | | @abstract The specified dialog configuration is not available. |
| | | @discussion This error may signify that the configuration for the dialogs has not yet been downloaded from the server |
| | | or that the dialog is unavailable. Subsequent attempts to use the dialog may succeed as the configuration is loaded. |
| | | */ |
| | | FBSDKDialogUnavailableErrorCode, |
| | | |
| | | /*! |
| | | @abstract Indicates an operation failed because a required access token was not found. |
| | | */ |
| | | FBSDKAccessTokenRequiredErrorCode, |
| | | |
| | | /*! |
| | | @abstract Indicates an app switch (typically for a dialog) failed because the destination app is out of date. |
| | | */ |
| | | FBSDKAppVersionUnsupportedErrorCode, |
| | | |
| | | /*! |
| | | @abstract Indicates an app switch to the browser (typically for a dialog) failed. |
| | | */ |
| | | FBSDKBrowswerUnavailableErrorCode, |
| | | }; |
| | | |
| | | /*! |
| | | @typedef NS_ENUM(NSUInteger, FBSDKGraphRequestErrorCategory) |
| | | @abstract Describes the category of Facebook error. See `FBSDKGraphRequestErrorCategoryKey`. |
| | | */ |
| | | typedef NS_ENUM(NSUInteger, FBSDKGraphRequestErrorCategory) |
| | | { |
| | | /*! The default error category that is not known to be recoverable. Check `FBSDKLocalizedErrorDescriptionKey` for a user facing message. */ |
| | | FBSDKGraphRequestErrorCategoryOther = 0, |
| | | /*! Indicates the error is temporary (such as server throttling). While a recoveryAttempter will be provided with the error instance, the attempt is guaranteed to succeed so you can simply retry the operation if you do not want to present an alert. */ |
| | | FBSDKGraphRequestErrorCategoryTransient = 1, |
| | | /*! Indicates the error can be recovered (such as requiring a login). A recoveryAttempter will be provided with the error instance that can take UI action. */ |
| | | FBSDKGraphRequestErrorCategoryRecoverable = 2 |
| | | }; |
| | | |
| | | /* |
| | | @methodgroup error userInfo keys |
| | | */ |
| | | |
| | | /*! |
| | | @abstract The userInfo key for the invalid collection for errors with FBSDKInvalidArgumentErrorCode. |
| | | @discussion If the invalid argument is a collection, the collection can be found with this key and the individual |
| | | invalid item can be found with FBSDKErrorArgumentValueKey. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKErrorArgumentCollectionKey; |
| | | |
| | | /*! |
| | | @abstract The userInfo key for the invalid argument name for errors with FBSDKInvalidArgumentErrorCode. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKErrorArgumentNameKey; |
| | | |
| | | /*! |
| | | @abstract The userInfo key for the invalid argument value for errors with FBSDKInvalidArgumentErrorCode. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKErrorArgumentValueKey; |
| | | |
| | | /*! |
| | | @abstract The userInfo key for the message for developers in NSErrors that originate from the SDK. |
| | | @discussion The developer message will not be localized and is not intended to be presented within the app. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKErrorDeveloperMessageKey; |
| | | |
| | | /*! |
| | | @abstract The userInfo key describing a localized description that can be presented to the user. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKErrorLocalizedDescriptionKey; |
| | | |
| | | /*! |
| | | @abstract The userInfo key describing a localized title that can be presented to the user, used with `FBSDKLocalizedErrorDescriptionKey`. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKErrorLocalizedTitleKey; |
| | | |
| | | /* |
| | | @methodgroup FBSDKGraphRequest error userInfo keys |
| | | */ |
| | | |
| | | /*! |
| | | @abstract The userInfo key describing the error category, for error recovery purposes. |
| | | @discussion See `FBSDKGraphErrorRecoveryProcessor` and `[FBSDKGraphRequest disableErrorRecovery]`. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKGraphRequestErrorCategoryKey; |
| | | |
| | | /* |
| | | @abstract The userInfo key for the Graph API error code. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKGraphRequestErrorGraphErrorCode; |
| | | |
| | | /* |
| | | @abstract The userInfo key for the Graph API error subcode. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKGraphRequestErrorGraphErrorSubcode; |
| | | |
| | | /* |
| | | @abstract The userInfo key for the HTTP status code. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKGraphRequestErrorHTTPStatusCodeKey; |
| | | |
| | | /* |
| | | @abstract The userInfo key for the raw JSON response. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKGraphRequestErrorParsedJSONResponseKey; |
| | | |
| | | /*! |
| | | @abstract a formal protocol very similar to the informal protocol NSErrorRecoveryAttempting |
| | | */ |
| | | @protocol FBSDKErrorRecoveryAttempting<NSObject> |
| | | |
| | | /*! |
| | | @abstract attempt the recovery |
| | | @param error the error |
| | | @param recoveryOptionIndex the selected option index |
| | | @param delegate the delegate |
| | | @param didRecoverSelector the callback selector, see discussion. |
| | | @param contextInfo context info to pass back to callback selector, see discussion. |
| | | @discussion |
| | | Given that an error alert has been presented document-modally to the user, and the user has chosen one of the error's recovery options, attempt recovery from the error, and send the selected message to the specified delegate. The option index is an index into the error's array of localized recovery options. The method selected by didRecoverSelector must have the same signature as: |
| | | |
| | | - (void)didPresentErrorWithRecovery:(BOOL)didRecover contextInfo:(void *)contextInfo; |
| | | |
| | | The value passed for didRecover must be YES if error recovery was completely successful, NO otherwise. |
| | | */ |
| | | - (void)attemptRecoveryFromError:(NSError *)error optionIndex:(NSUInteger)recoveryOptionIndex delegate:(id)delegate didRecoverSelector:(SEL)didRecoverSelector contextInfo:(void *)contextInfo; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /*! |
| | | @abstract Extension protocol for NSCopying that adds the copy method, which is implemented on NSObject. |
| | | @discussion NSObject<NSCopying> implicitly conforms to this protocol. |
| | | */ |
| | | @protocol FBSDKCopying <NSCopying, NSObject> |
| | | |
| | | /*! |
| | | @abstract Implemented by NSObject as a convenience to copyWithZone:. |
| | | @return A copy of the receiver. |
| | | */ |
| | | - (id)copy; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKAccessToken.h> |
| | | #import <FBSDKCoreKit/FBSDKAppEvents.h> |
| | | #import <FBSDKCoreKit/FBSDKApplicationDelegate.h> |
| | | #import <FBSDKCoreKit/FBSDKButton.h> |
| | | #import <FBSDKCoreKit/FBSDKConstants.h> |
| | | #import <FBSDKCoreKit/FBSDKCopying.h> |
| | | #import <FBSDKCoreKit/FBSDKGraphRequest.h> |
| | | #import <FBSDKCoreKit/FBSDKGraphRequestConnection.h> |
| | | #import <FBSDKCoreKit/FBSDKGraphRequestDataAttachment.h> |
| | | #import <FBSDKCoreKit/FBSDKMacros.h> |
| | | #import <FBSDKCoreKit/FBSDKSettings.h> |
| | | #import <FBSDKCoreKit/FBSDKTestUsersManager.h> |
| | | #import <FBSDKCoreKit/FBSDKUtility.h> |
| | | |
| | | #if !TARGET_OS_TV |
| | | #import <FBSDKCoreKit/FBSDKAppLinkResolver.h> |
| | | #import <FBSDKCoreKit/FBSDKAppLinkUtility.h> |
| | | #import <FBSDKCoreKit/FBSDKGraphErrorRecoveryProcessor.h> |
| | | #import <FBSDKCoreKit/FBSDKMutableCopying.h> |
| | | #import <FBSDKCoreKit/FBSDKProfile.h> |
| | | #import <FBSDKCoreKit/FBSDKProfilePictureView.h> |
| | | #else |
| | | #import <FBSDKCoreKit/FBSDKDeviceButton.h> |
| | | #import <FBSDKCoreKit/FBSDKDeviceViewControllerBase.h> |
| | | #endif |
| | | |
| | | #define FBSDK_VERSION_STRING @"4.11.0" |
| | | #define FBSDK_TARGET_PLATFORM_VERSION @"v2.6" |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import "FBSDKConstants.h" |
| | | |
| | | @class FBSDKGraphErrorRecoveryProcessor; |
| | | @class FBSDKGraphRequest; |
| | | |
| | | /*! |
| | | @abstract Defines a delegate for `FBSDKGraphErrorRecoveryProcessor`. |
| | | */ |
| | | @protocol FBSDKGraphErrorRecoveryProcessorDelegate<NSObject> |
| | | |
| | | /*! |
| | | @abstract Indicates the error recovery has been attempted. |
| | | @param processor the processor instance. |
| | | @param didRecover YES if the recovery was successful. |
| | | @param error the error that that was attempted to be recovered from. |
| | | */ |
| | | - (void)processorDidAttemptRecovery:(FBSDKGraphErrorRecoveryProcessor *)processor didRecover:(BOOL)didRecover error:(NSError *)error; |
| | | |
| | | @optional |
| | | /*! |
| | | @abstract Indicates the processor is about to process the error. |
| | | @param processor the processor instance. |
| | | @param error the error is about to be processed. |
| | | @discussion return NO if the processor should not process the error. For example, |
| | | if you want to prevent alerts of localized messages but otherwise perform retries and recoveries, |
| | | you could return NO for errors where userInfo[FBSDKGraphRequestErrorCategoryKey] equal to FBSDKGraphRequestErrorCategoryOther |
| | | */ |
| | | - (BOOL)processorWillProcessError:(FBSDKGraphErrorRecoveryProcessor *)processor error:(NSError *)error; |
| | | |
| | | @end |
| | | |
| | | /*! |
| | | @abstract Defines a type that can process Facebook NSErrors with best practices. |
| | | @discussion Facebook NSErrors can contain FBSDKErrorRecoveryAttempting instances to recover from errors, or |
| | | localized messages to present to the user. This class will process the instances as follows: |
| | | |
| | | 1. If the error is temporary as indicated by FBSDKGraphRequestErrorCategoryKey, assume the recovery succeeded and |
| | | notify the delegate. |
| | | 2. If a FBSDKErrorRecoveryAttempting instance is available, display an alert (dispatched to main thread) |
| | | with the recovery options and call the instance's [ attemptRecoveryFromError:optionIndex:...]. |
| | | 3. If a FBSDKErrorRecoveryAttempting is not available, check the userInfo for FBSDKLocalizedErrorDescriptionKey |
| | | and present that in an alert (dispatched to main thread). |
| | | |
| | | By default, FBSDKGraphRequests use this type to process errors and retry the request upon a successful |
| | | recovery. |
| | | |
| | | Note that Facebook recovery attempters can present UI or even cause app switches (such as to login). Any such |
| | | work is dispatched to the main thread (therefore your request handlers may then run on the main thread). |
| | | |
| | | Login recovery requires FBSDKLoginKit. Login will use FBSDKLoginBehaviorNative and will prompt the user |
| | | for all permissions last granted. If any are declined on the new request, the recovery is not successful but |
| | | the `[FBSDKAccessToken currentAccessToken]` might still have been updated. |
| | | . |
| | | */ |
| | | @interface FBSDKGraphErrorRecoveryProcessor : NSObject |
| | | |
| | | /*! |
| | | @abstract Gets the delegate. Note this is a strong reference, and is nil'ed out after recovery is complete. |
| | | */ |
| | | @property (nonatomic, strong, readonly) id<FBSDKGraphErrorRecoveryProcessorDelegate>delegate; |
| | | |
| | | /*! |
| | | @abstract Attempts to process the error, return YES if the error can be processed. |
| | | @param error the error to process. |
| | | @param request the relateed request that may be reissued. |
| | | @param delegate the delegate that will be retained until recovery is complete. |
| | | */ |
| | | - (BOOL)processError:(NSError *)error request:(FBSDKGraphRequest *)request delegate:(id<FBSDKGraphErrorRecoveryProcessorDelegate>) delegate; |
| | | |
| | | /*! |
| | | @abstract The callback for FBSDKErrorRecoveryAttempting |
| | | @param didRecover if the recovery succeeded |
| | | @param contextInfo unused |
| | | */ |
| | | - (void)didPresentErrorWithRecovery:(BOOL)didRecover contextInfo:(void *)contextInfo; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKGraphRequestConnection.h> |
| | | |
| | | @class FBSDKAccessToken; |
| | | |
| | | /*! |
| | | @abstract Represents a request to the Facebook Graph API. |
| | | |
| | | @discussion `FBSDKGraphRequest` encapsulates the components of a request (the |
| | | Graph API path, the parameters, error recovery behavior) and should be |
| | | used in conjunction with `FBSDKGraphRequestConnection` to issue the request. |
| | | |
| | | Nearly all Graph APIs require an access token. Unless specified, the |
| | | `[FBSDKAccessToken currentAccessToken]` is used. Therefore, most requests |
| | | will require login first (see `FBSDKLoginManager` in FBSDKLoginKit.framework). |
| | | |
| | | A `- start` method is provided for convenience for single requests. |
| | | |
| | | By default, FBSDKGraphRequest will attempt to recover any errors returned from |
| | | Facebook. You can disable this via `disableErrorRecovery:`. |
| | | @see FBSDKGraphErrorRecoveryProcessor |
| | | */ |
| | | @interface FBSDKGraphRequest : NSObject |
| | | |
| | | /*! |
| | | @abstract Initializes a new instance that use use `[FBSDKAccessToken currentAccessToken]`. |
| | | @param graphPath the graph path (e.g., @"me"). |
| | | @param parameters the optional parameters dictionary. |
| | | */ |
| | | - (instancetype)initWithGraphPath:(NSString *)graphPath |
| | | parameters:(NSDictionary *)parameters; |
| | | |
| | | /*! |
| | | @abstract Initializes a new instance that use use `[FBSDKAccessToken currentAccessToken]`. |
| | | @param graphPath the graph path (e.g., @"me"). |
| | | @param parameters the optional parameters dictionary. |
| | | @param HTTPMethod the optional HTTP method. nil defaults to @"GET". |
| | | */ |
| | | - (instancetype)initWithGraphPath:(NSString *)graphPath |
| | | parameters:(NSDictionary *)parameters |
| | | HTTPMethod:(NSString *)HTTPMethod; |
| | | |
| | | /*! |
| | | @abstract Initializes a new instance. |
| | | @param graphPath the graph path (e.g., @"me"). |
| | | @param parameters the optional parameters dictionary. |
| | | @param tokenString the token string to use. Specifying nil will cause no token to be used. |
| | | @param version the optional Graph API version (e.g., @"v2.0"). nil defaults to FBSDK_TARGET_PLATFORM_VERSION. |
| | | @param HTTPMethod the optional HTTP method (e.g., @"POST"). nil defaults to @"GET". |
| | | */ |
| | | - (instancetype)initWithGraphPath:(NSString *)graphPath |
| | | parameters:(NSDictionary *)parameters |
| | | tokenString:(NSString *)tokenString |
| | | version:(NSString *)version |
| | | HTTPMethod:(NSString *)HTTPMethod |
| | | NS_DESIGNATED_INITIALIZER; |
| | | |
| | | /*! |
| | | @abstract The request parameters. |
| | | */ |
| | | @property (nonatomic, strong, readonly) NSMutableDictionary *parameters; |
| | | |
| | | /*! |
| | | @abstract The access token string used by the request. |
| | | */ |
| | | @property (nonatomic, copy, readonly) NSString *tokenString; |
| | | |
| | | /*! |
| | | @abstract The Graph API endpoint to use for the request, for example "me". |
| | | */ |
| | | @property (nonatomic, copy, readonly) NSString *graphPath; |
| | | |
| | | /*! |
| | | @abstract The HTTPMethod to use for the request, for example "GET" or "POST". |
| | | */ |
| | | @property (nonatomic, copy, readonly) NSString *HTTPMethod; |
| | | |
| | | /*! |
| | | @abstract The Graph API version to use (e.g., "v2.0") |
| | | */ |
| | | @property (nonatomic, copy, readonly) NSString *version; |
| | | |
| | | /*! |
| | | @abstract If set, disables the automatic error recovery mechanism. |
| | | @param disable whether to disable the automatic error recovery mechanism |
| | | @discussion By default, non-batched FBSDKGraphRequest instances will automatically try to recover |
| | | from errors by constructing a `FBSDKGraphErrorRecoveryProcessor` instance that |
| | | re-issues the request on successful recoveries. The re-issued request will call the same |
| | | handler as the receiver but may occur with a different `FBSDKGraphRequestConnection` instance. |
| | | |
| | | This will override [FBSDKSettings setGraphErrorRecoveryDisabled:]. |
| | | */ |
| | | - (void)setGraphErrorRecoveryDisabled:(BOOL)disable; |
| | | |
| | | /*! |
| | | @abstract Starts a connection to the Graph API. |
| | | @param handler The handler block to call when the request completes. |
| | | */ |
| | | - (FBSDKGraphRequestConnection *)startWithCompletionHandler:(FBSDKGraphRequestHandler)handler; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKMacros.h> |
| | | |
| | | @class FBSDKGraphRequest; |
| | | @class FBSDKGraphRequestConnection; |
| | | |
| | | /*! |
| | | @typedef FBSDKGraphRequestHandler |
| | | |
| | | @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 `FBSDKGraphRequestConnection` 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 (^FBSDKGraphRequestHandler)(FBSDKGraphRequestConnection *connection, |
| | | id result, |
| | | NSError *error); |
| | | |
| | | /*! |
| | | @protocol |
| | | |
| | | @abstract |
| | | The `FBSDKGraphRequestConnectionDelegate` protocol defines the methods used to receive network |
| | | activity progress information from a <FBSDKGraphRequestConnection>. |
| | | */ |
| | | @protocol FBSDKGraphRequestConnectionDelegate <NSObject> |
| | | |
| | | @optional |
| | | |
| | | /*! |
| | | @method |
| | | |
| | | @abstract |
| | | Tells the delegate the request connection will begin loading |
| | | |
| | | @discussion |
| | | If the <FBSDKGraphRequestConnection> is created using one of the convenience factory methods prefixed with |
| | | start, the object returned from the convenience method has already begun loading and this method |
| | | will not be called when the delegate is set. |
| | | |
| | | @param connection The request connection that is starting a network request |
| | | */ |
| | | - (void)requestConnectionWillBeginLoading:(FBSDKGraphRequestConnection *)connection; |
| | | |
| | | /*! |
| | | @method |
| | | |
| | | @abstract |
| | | Tells the delegate the request connection finished loading |
| | | |
| | | @discussion |
| | | If the request connection completes without a network error occuring then this method is called. |
| | | Invocation of this method does not indicate success of every <FBSDKGraphRequest> made, only that the |
| | | request connection has no further activity. Use the error argument passed to the FBSDKGraphRequestHandler |
| | | block to determine success or failure of each <FBSDKGraphRequest>. |
| | | |
| | | This method is invoked after the completion handler for each <FBSDKGraphRequest>. |
| | | |
| | | @param connection The request connection that successfully completed a network request |
| | | */ |
| | | - (void)requestConnectionDidFinishLoading:(FBSDKGraphRequestConnection *)connection; |
| | | |
| | | /*! |
| | | @method |
| | | |
| | | @abstract |
| | | Tells the delegate the request connection failed with an error |
| | | |
| | | @discussion |
| | | If the request connection fails with a network error then this method is called. The `error` |
| | | argument specifies why the network connection failed. The `NSError` object passed to the |
| | | FBSDKGraphRequestHandler block may contain additional information. |
| | | |
| | | @param connection The request connection that successfully completed a network request |
| | | @param error The `NSError` representing the network error that occurred, if any. May be nil |
| | | in some circumstances. Consult the `NSError` for the <FBSDKGraphRequest> for reliable |
| | | failure information. |
| | | */ |
| | | - (void)requestConnection:(FBSDKGraphRequestConnection *)connection |
| | | didFailWithError:(NSError *)error; |
| | | |
| | | /*! |
| | | @method |
| | | |
| | | @abstract |
| | | Tells the delegate how much data has been sent and is planned to send to the remote host |
| | | |
| | | @discussion |
| | | The byte count arguments refer to the aggregated <FBSDKGraphRequest> objects, not a particular <FBSDKGraphRequest>. |
| | | |
| | | Like `NSURLConnection`, the values may change in unexpected ways if data needs to be resent. |
| | | |
| | | @param connection The request connection transmitting data to a remote host |
| | | @param bytesWritten The number of bytes sent in the last transmission |
| | | @param totalBytesWritten The total number of bytes sent to the remote host |
| | | @param totalBytesExpectedToWrite The total number of bytes expected to send to the remote host |
| | | */ |
| | | - (void)requestConnection:(FBSDKGraphRequestConnection *)connection |
| | | didSendBodyData:(NSInteger)bytesWritten |
| | | totalBytesWritten:(NSInteger)totalBytesWritten |
| | | totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite; |
| | | |
| | | @end |
| | | |
| | | /*! |
| | | @class FBSDKGraphRequestConnection |
| | | |
| | | @abstract |
| | | The `FBSDKGraphRequestConnection` represents a single connection to Facebook to service a request. |
| | | |
| | | @discussion |
| | | The request settings are encapsulated in a reusable <FBSDKGraphRequest> object. The |
| | | `FBSDKGraphRequestConnection` object encapsulates the concerns of a single communication |
| | | e.g. starting a connection, canceling a connection, or batching requests. |
| | | |
| | | */ |
| | | @interface FBSDKGraphRequestConnection : NSObject |
| | | |
| | | /*! |
| | | @abstract |
| | | The delegate object that receives updates. |
| | | */ |
| | | @property (nonatomic, assign) id<FBSDKGraphRequestConnectionDelegate> delegate; |
| | | |
| | | /*! |
| | | @abstract Gets or sets the timeout interval to wait for a response before giving up. |
| | | */ |
| | | @property (nonatomic) NSTimeInterval timeout; |
| | | |
| | | /*! |
| | | @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 FBSDKGraphRequestHandler callback. |
| | | */ |
| | | @property (nonatomic, retain, readonly) NSHTTPURLResponse *URLResponse; |
| | | |
| | | /*! |
| | | @methodgroup Class methods |
| | | */ |
| | | |
| | | /*! |
| | | @method |
| | | |
| | | @abstract |
| | | This method sets the default timeout on all FBSDKGraphRequestConnection instances. Defaults to 60 seconds. |
| | | |
| | | @param defaultConnectionTimeout The timeout interval. |
| | | */ |
| | | + (void)setDefaultConnectionTimeout:(NSTimeInterval)defaultConnectionTimeout; |
| | | |
| | | /*! |
| | | @methodgroup Adding requests |
| | | */ |
| | | |
| | | /*! |
| | | @method |
| | | |
| | | @abstract |
| | | This method adds an <FBSDKGraphRequest> object to this 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. |
| | | |
| | | @discussion |
| | | The completion handler is retained until the block is called upon the |
| | | completion or cancellation of the connection. |
| | | */ |
| | | - (void)addRequest:(FBSDKGraphRequest *)request |
| | | completionHandler:(FBSDKGraphRequestHandler)handler; |
| | | |
| | | /*! |
| | | @method |
| | | |
| | | @abstract |
| | | This method adds an <FBSDKGraphRequest> object to this 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 <FBSDKGraphRequest> in the same |
| | | `FBSDKGraphRequestConnection` as described in |
| | | [Graph API Batch Requests]( https://developers.facebook.com/docs/reference/api/batch/ ). |
| | | |
| | | @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. |
| | | */ |
| | | - (void)addRequest:(FBSDKGraphRequest *)request |
| | | completionHandler:(FBSDKGraphRequestHandler)handler |
| | | batchEntryName:(NSString *)name; |
| | | |
| | | /*! |
| | | @method |
| | | |
| | | @abstract |
| | | This method adds an <FBSDKGraphRequest> object to this 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. |
| | | |
| | | @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". |
| | | |
| | | @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. |
| | | */ |
| | | - (void)addRequest:(FBSDKGraphRequest *)request |
| | | completionHandler:(FBSDKGraphRequestHandler)handler |
| | | batchParameters:(NSDictionary *)batchParameters; |
| | | |
| | | /*! |
| | | @methodgroup Instance methods |
| | | */ |
| | | |
| | | /*! |
| | | @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 |
| | | This method starts a connection with the server and is capable of handling all of the |
| | | requests that were added to the connection. |
| | | |
| | | @discussion By default, a connection is scheduled on the current thread in the default mode when it is created. |
| | | See `setDelegateQueue:` for other options. |
| | | |
| | | This method cannot be called twice for an `FBSDKGraphRequestConnection` instance. |
| | | */ |
| | | - (void)start; |
| | | |
| | | /*! |
| | | @abstract Determines the operation queue that is used to call methods on the connection's delegate. |
| | | @param queue The operation queue to use when calling delegate methods. |
| | | @discussion By default, a connection is scheduled on the current thread in the default mode when it is created. |
| | | You cannot reschedule a connection after it has started. |
| | | |
| | | This is very similar to `[NSURLConnection setDelegateQueue:]`. |
| | | */ |
| | | - (void)setDelegateQueue:(NSOperationQueue *)queue; |
| | | |
| | | /*! |
| | | @method |
| | | |
| | | @abstract |
| | | Overrides the default version for a batch request |
| | | |
| | | @discussion |
| | | The SDK automatically prepends a version part, such as "v2.0" to API paths in order to simplify API versioning |
| | | for applications. If you want to override the version part while using batch requests on the connection, call |
| | | this method to set the version for the batch request. |
| | | |
| | | @param version This is a string in the form @"v2.0" which will be used for the version part of an API path |
| | | */ |
| | | - (void)overrideVersionPartWith:(NSString *)version; |
| | | |
| | | @end |
| | | |
| | | /*! |
| | | @abstract The key in the result dictionary for requests to old versions of the Graph API |
| | | whose response is not a JSON object. |
| | | |
| | | @discussion When a request returns a non-JSON response (such as a "true" literal), that response |
| | | will be wrapped into a dictionary using this const as the key. This only applies for very few Graph API |
| | | prior to v2.1. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKNonJSONResponseProperty; |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /*! |
| | | @abstract A container class for data attachments so that additional metadata can be provided about the attachment. |
| | | */ |
| | | @interface FBSDKGraphRequestDataAttachment : NSObject |
| | | |
| | | /*! |
| | | @abstract Initializes the receiver with the attachment data and metadata. |
| | | @param data The attachment data (retained, not copied) |
| | | @param filename The filename for the attachment |
| | | @param contentType The content type for the attachment |
| | | */ |
| | | - (instancetype)initWithData:(NSData *)data |
| | | filename:(NSString *)filename |
| | | contentType:(NSString *)contentType |
| | | NS_DESIGNATED_INITIALIZER; |
| | | |
| | | /*! |
| | | @abstract The content type for the attachment. |
| | | */ |
| | | @property (nonatomic, copy, readonly) NSString *contentType; |
| | | |
| | | /*! |
| | | @abstract The attachment data. |
| | | */ |
| | | @property (nonatomic, strong, readonly) NSData *data; |
| | | |
| | | /*! |
| | | @abstract The filename for the attachment. |
| | | */ |
| | | @property (nonatomic, copy, readonly) NSString *filename; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #ifdef __cplusplus |
| | | #define FBSDK_EXTERN extern "C" __attribute__((visibility ("default"))) |
| | | #else |
| | | #define FBSDK_EXTERN extern __attribute__((visibility ("default"))) |
| | | #endif |
| | | |
| | | #define FBSDK_STATIC_INLINE static inline |
| | | |
| | | #define FBSDK_NO_DESIGNATED_INITIALIZER() \ |
| | | @throw [NSException exceptionWithName:NSInvalidArgumentException \ |
| | | reason:[NSString stringWithFormat:@"unrecognized selector sent to instance %p", self] \ |
| | | userInfo:nil] |
| | | |
| | | #define FBSDK_NOT_DESIGNATED_INITIALIZER(DESIGNATED_INITIALIZER) \ |
| | | @throw [NSException exceptionWithName:NSInvalidArgumentException \ |
| | | reason:[NSString stringWithFormat:@"Please use the designated initializer [%p %@]", \ |
| | | self, \ |
| | | NSStringFromSelector(@selector(DESIGNATED_INITIALIZER))] \ |
| | | userInfo:nil] |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKCopying.h> |
| | | |
| | | /*! |
| | | @abstract Extension protocol for NSMutableCopying that adds the mutableCopy method, which is implemented on NSObject. |
| | | @discussion NSObject<NSCopying, NSMutableCopying> implicitly conforms to this protocol. |
| | | */ |
| | | @protocol FBSDKMutableCopying <FBSDKCopying, NSMutableCopying> |
| | | |
| | | /*! |
| | | @abstract Implemented by NSObject as a convenience to mutableCopyWithZone:. |
| | | @return A mutable copy of the receiver. |
| | | */ |
| | | - (id)mutableCopy; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import "FBSDKMacros.h" |
| | | #import "FBSDKProfilePictureView.h" |
| | | |
| | | /*! |
| | | @abstract Notification indicating that the `currentProfile` has changed. |
| | | @discussion the userInfo dictionary of the notification will contain keys |
| | | `FBSDKProfileChangeOldKey` and |
| | | `FBSDKProfileChangeNewKey`. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKProfileDidChangeNotification; |
| | | |
| | | /* @abstract key in notification's userInfo object for getting the old profile. |
| | | @discussion If there was no old profile, the key will not be present. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKProfileChangeOldKey; |
| | | |
| | | /* @abstract key in notification's userInfo object for getting the new profile. |
| | | @discussion If there is no new profile, the key will not be present. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKProfileChangeNewKey; |
| | | |
| | | /*! |
| | | @abstract Represents an immutable Facebook profile |
| | | @discussion This class provides a global "currentProfile" instance to more easily |
| | | add social context to your application. When the profile changes, a notification is |
| | | posted so that you can update relevant parts of your UI and is persisted to NSUserDefaults. |
| | | |
| | | Typically, you will want to call `enableUpdatesOnAccessTokenChange:YES` so that |
| | | it automatically observes changes to the `[FBSDKAccessToken currentAccessToken]`. |
| | | |
| | | You can use this class to build your own `FBSDKProfilePictureView` or in place of typical requests to "/me". |
| | | */ |
| | | @interface FBSDKProfile : NSObject<NSCopying, NSSecureCoding> |
| | | |
| | | /*! |
| | | @abstract initializes a new instance. |
| | | @param userID the user ID |
| | | @param firstName the user's first name |
| | | @param middleName the user's middle name |
| | | @param lastName the user's last name |
| | | @param name the user's complete name |
| | | @param linkURL the link for this profile |
| | | @param refreshDate the optional date this profile was fetched. Defaults to [NSDate date]. |
| | | */ |
| | | - (instancetype)initWithUserID:(NSString *)userID |
| | | firstName:(NSString *)firstName |
| | | middleName:(NSString *)middleName |
| | | lastName:(NSString *)lastName |
| | | name:(NSString *)name |
| | | linkURL:(NSURL *)linkURL |
| | | refreshDate:(NSDate *)refreshDate NS_DESIGNATED_INITIALIZER; |
| | | /*! |
| | | @abstract The user id |
| | | */ |
| | | @property (nonatomic, readonly) NSString *userID; |
| | | /*! |
| | | @abstract The user's first name |
| | | */ |
| | | @property (nonatomic, readonly) NSString *firstName; |
| | | /*! |
| | | @abstract The user's middle name |
| | | */ |
| | | @property (nonatomic, readonly) NSString *middleName; |
| | | /*! |
| | | @abstract The user's last name |
| | | */ |
| | | @property (nonatomic, readonly) NSString *lastName; |
| | | /*! |
| | | @abstract The user's complete name |
| | | */ |
| | | @property (nonatomic, readonly) NSString *name; |
| | | /*! |
| | | @abstract A URL to the user's profile. |
| | | @discussion Consider using Bolts and `FBSDKAppLinkResolver` to resolve this |
| | | to an app link to link directly to the user's profile in the Facebook app. |
| | | */ |
| | | @property (nonatomic, readonly) NSURL *linkURL; |
| | | |
| | | /*! |
| | | @abstract The last time the profile data was fetched. |
| | | */ |
| | | @property (nonatomic, readonly) NSDate *refreshDate; |
| | | |
| | | /*! |
| | | @abstract Gets the current FBSDKProfile instance. |
| | | */ |
| | | + (FBSDKProfile *)currentProfile; |
| | | |
| | | /*! |
| | | @abstract Sets the current instance and posts the appropriate notification if the profile parameter is different |
| | | than the receiver. |
| | | @param profile the profile to set |
| | | @discussion This persists the profile to NSUserDefaults. |
| | | */ |
| | | + (void)setCurrentProfile:(FBSDKProfile *)profile; |
| | | |
| | | /*! |
| | | @abstract Indicates if `currentProfile` will automatically observe `FBSDKAccessTokenDidChangeNotification` notifications |
| | | @param enable YES is observing |
| | | @discussion If observing, this class will issue a graph request for public profile data when the current token's userID |
| | | differs from the current profile. You can observe `FBSDKProfileDidChangeNotification` for when the profile is updated. |
| | | |
| | | Note that if `[FBSDKAccessToken currentAccessToken]` is unset, the `currentProfile` instance remains. It's also possible |
| | | for `currentProfile` to return nil until the data is fetched. |
| | | */ |
| | | + (void)enableUpdatesOnAccessTokenChange:(BOOL)enable; |
| | | |
| | | /*! |
| | | @abstract Loads the current profile and passes it to the completion block. |
| | | @param completion The block to be executed once the profile is loaded |
| | | @discussion If the profile is already loaded, this method will call the completion block synchronously, otherwise it |
| | | will begin a graph request to update `currentProfile` and then call the completion block when finished. |
| | | */ |
| | | + (void)loadCurrentProfileWithCompletion:(void(^)(FBSDKProfile *profile, NSError *error))completion; |
| | | |
| | | /*! |
| | | @abstract A convenience method for returning a complete `NSURL` for retrieving the user's profile image. |
| | | @param mode The picture mode |
| | | @param size The height and width. This will be rounded to integer precision. |
| | | */ |
| | | - (NSURL *)imageURLForPictureMode:(FBSDKProfilePictureMode)mode size:(CGSize)size; |
| | | |
| | | /*! |
| | | @abstract A convenience method for returning a Graph API path for retrieving the user's profile image. |
| | | @deprecated use `imageURLForPictureMode:size:` instead |
| | | @discussion You can pass this to a `FBSDKGraphRequest` instance to download the image. |
| | | @param mode The picture mode |
| | | @param size The height and width. This will be rounded to integer precision. |
| | | */ |
| | | - (NSString *)imagePathForPictureMode:(FBSDKProfilePictureMode)mode size:(CGSize)size |
| | | __attribute__ ((deprecated("use imageURLForPictureMode:size: instead"))); |
| | | |
| | | /*! |
| | | @abstract Returns YES if the profile is equivalent to the receiver. |
| | | @param profile the profile to compare to. |
| | | */ |
| | | - (BOOL)isEqualToProfile:(FBSDKProfile *)profile; |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | /*! |
| | | @typedef FBSDKProfilePictureMode enum |
| | | @abstract Defines the aspect ratio mode for the source image of the profile picture. |
| | | */ |
| | | typedef NS_ENUM(NSUInteger, FBSDKProfilePictureMode) |
| | | { |
| | | /*! |
| | | @abstract A square cropped version of the image will be included in the view. |
| | | */ |
| | | FBSDKProfilePictureModeSquare, |
| | | /*! |
| | | @abstract The original picture's aspect ratio will be used for the source image in the view. |
| | | */ |
| | | FBSDKProfilePictureModeNormal, |
| | | }; |
| | | |
| | | /*! |
| | | @abstract A view to display a profile picture. |
| | | */ |
| | | @interface FBSDKProfilePictureView : UIView |
| | | |
| | | /*! |
| | | @abstract The mode for the receiver to determine the aspect ratio of the source image. |
| | | */ |
| | | @property (nonatomic, assign) FBSDKProfilePictureMode pictureMode; |
| | | |
| | | /*! |
| | | @abstract The profile ID to show the picture for. |
| | | */ |
| | | @property (nonatomic, copy) NSString *profileID; |
| | | |
| | | /*! |
| | | @abstract Explicitly marks the receiver as needing to update the image. |
| | | @discussion This method is called whenever any properties that affect the source image are modified, but this can also |
| | | be used to trigger a manual update of the image if it needs to be re-downloaded. |
| | | */ |
| | | - (void)setNeedsImageUpdate; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKMacros.h> |
| | | |
| | | /* |
| | | * Constants defining logging behavior. Use with <[FBSDKSettings setLoggingBehavior]>. |
| | | */ |
| | | |
| | | /*! Include access token in logging. */ |
| | | FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorAccessTokens; |
| | | |
| | | /*! Log performance characteristics */ |
| | | FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorPerformanceCharacteristics; |
| | | |
| | | /*! Log FBSDKAppEvents interactions */ |
| | | FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorAppEvents; |
| | | |
| | | /*! Log Informational occurrences */ |
| | | FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorInformational; |
| | | |
| | | /*! Log cache errors. */ |
| | | FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorCacheErrors; |
| | | |
| | | /*! Log errors from SDK UI controls */ |
| | | FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorUIControlErrors; |
| | | |
| | | /*! Log debug warnings from API response, i.e. when friends fields requested, but user_friends permission isn't granted. */ |
| | | FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorGraphAPIDebugWarning; |
| | | |
| | | /*! Log warnings from API response, i.e. when requested feature will be deprecated in next version of API. |
| | | Info is the lowest level of severity, using it will result in logging all previously mentioned levels. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorGraphAPIDebugInfo; |
| | | |
| | | /*! Log errors from SDK network requests */ |
| | | FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorNetworkRequests; |
| | | |
| | | /*! Log errors likely to be preventable by the developer. This is in the default set of enabled logging behaviors. */ |
| | | FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorDeveloperErrors; |
| | | |
| | | @interface FBSDKSettings : NSObject |
| | | |
| | | /*! |
| | | @abstract Get the Facebook App ID used by the SDK. |
| | | @discussion If not explicitly set, the default will be read from the application's plist (FacebookAppID). |
| | | */ |
| | | + (NSString *)appID; |
| | | |
| | | /*! |
| | | @abstract Set the Facebook App ID to be used by the SDK. |
| | | @param appID The Facebook App ID to be used by the SDK. |
| | | */ |
| | | + (void)setAppID:(NSString *)appID; |
| | | |
| | | /*! |
| | | @abstract Get the default url scheme suffix used for sessions. |
| | | @discussion If not explicitly set, the default will be read from the application's plist (FacebookUrlSchemeSuffix). |
| | | */ |
| | | + (NSString *)appURLSchemeSuffix; |
| | | |
| | | /*! |
| | | @abstract Set the app url scheme suffix used by the SDK. |
| | | @param appURLSchemeSuffix The url scheme suffix to be used by the SDK. |
| | | */ |
| | | + (void)setAppURLSchemeSuffix:(NSString *)appURLSchemeSuffix; |
| | | |
| | | /*! |
| | | @abstract Retrieve the Client Token that has been set via [FBSDKSettings setClientToken]. |
| | | @discussion If not explicitly set, the default will be read from the application's plist (FacebookClientToken). |
| | | */ |
| | | + (NSString *)clientToken; |
| | | |
| | | /*! |
| | | @abstract Sets the Client Token for the Facebook App. |
| | | @discussion This is needed for certain API calls when made anonymously, without a user-based access token. |
| | | @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 <https://developers.facebook.com/apps/[your-app-id]> |
| | | */ |
| | | + (void)setClientToken:(NSString *)clientToken; |
| | | |
| | | /*! |
| | | @abstract A convenient way to toggle error recovery for all FBSDKGraphRequest instances created after this is set. |
| | | @param disableGraphErrorRecovery YES or NO. |
| | | */ |
| | | + (void)setGraphErrorRecoveryDisabled:(BOOL)disableGraphErrorRecovery; |
| | | |
| | | /*! |
| | | @abstract Get the Facebook Display Name used by the SDK. |
| | | @discussion If not explicitly set, the default will be read from the application's plist (FacebookDisplayName). |
| | | */ |
| | | + (NSString *)displayName; |
| | | |
| | | /*! |
| | | @abstract Set the default Facebook Display Name to be used by the SDK. |
| | | @discussion 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 Facebook Display Name to be used by the SDK. |
| | | */ |
| | | + (void)setDisplayName:(NSString *)displayName; |
| | | |
| | | /*! |
| | | @abstract Get the Facebook domain part. |
| | | @discussion If not explicitly set, the default will be read from the application's plist (FacebookDomainPart). |
| | | */ |
| | | + (NSString *)facebookDomainPart; |
| | | |
| | | /*! |
| | | @abstract Set the subpart of the Facebook domain. |
| | | @discussion This can be used to change 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; |
| | | |
| | | /*! |
| | | @abstract The quality of JPEG images sent to Facebook from the SDK. |
| | | @discussion If not explicitly set, the default is 0.9. |
| | | @see [UIImageJPEGRepresentation](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIKitFunctionReference/#//apple_ref/c/func/UIImageJPEGRepresentation) */ |
| | | + (CGFloat)JPEGCompressionQuality; |
| | | |
| | | /*! |
| | | @abstract Set the quality of JPEG images sent to Facebook from the SDK. |
| | | @param JPEGCompressionQuality The quality for JPEG images, expressed as a value from 0.0 to 1.0. |
| | | @see [UIImageJPEGRepresentation](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIKitFunctionReference/#//apple_ref/c/func/UIImageJPEGRepresentation) */ |
| | | + (void)setJPEGCompressionQuality:(CGFloat)JPEGCompressionQuality; |
| | | |
| | | /*! |
| | | @abstract |
| | | Gets whether data such as that generated through FBSDKAppEvents 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; |
| | | |
| | | /*! |
| | | @abstract |
| | | Sets whether data such as that generated through FBSDKAppEvents 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; |
| | | |
| | | /*! |
| | | @abstract Retrieve the current iOS SDK version. |
| | | */ |
| | | + (NSString *)sdkVersion; |
| | | |
| | | /*! |
| | | @abstract Retrieve the current Facebook SDK logging behavior. |
| | | */ |
| | | + (NSSet *)loggingBehavior; |
| | | |
| | | /*! |
| | | @abstract Set the current Facebook SDK logging behavior. This should consist of strings defined as |
| | | constants with FBSDKLoggingBehavior*. |
| | | |
| | | @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 to an empty set in order to disable all logging. |
| | | |
| | | @discussion You can also define this via an array in your app plist with key "FacebookLoggingBehavior" or add and remove individual values via enableLoggingBehavior: or disableLogginBehavior: |
| | | */ |
| | | + (void)setLoggingBehavior:(NSSet *)loggingBehavior; |
| | | |
| | | /*! |
| | | @abstract Enable a particular Facebook SDK logging behavior. |
| | | |
| | | @param loggingBehavior The LoggingBehavior to enable. This should be a string defined as a constant with FBSDKLoggingBehavior*. |
| | | */ |
| | | + (void)enableLoggingBehavior:(NSString *)loggingBehavior; |
| | | |
| | | /*! |
| | | @abstract Disable a particular Facebook SDK logging behavior. |
| | | |
| | | @param loggingBehavior The LoggingBehavior to disable. This should be a string defined as a constant with FBSDKLoggingBehavior*. |
| | | */ |
| | | + (void)disableLoggingBehavior:(NSString *)loggingBehavior; |
| | | |
| | | /*! |
| | | @abstract Set the user defaults key used by legacy token caches. |
| | | |
| | | @param tokenInformationKeyName the key used by legacy token caches. |
| | | |
| | | @discussion Use this only if you customized FBSessionTokenCachingStrategy in v3.x of |
| | | the Facebook SDK for iOS. |
| | | */ |
| | | + (void)setLegacyUserDefaultTokenInformationKeyName:(NSString *)tokenInformationKeyName; |
| | | |
| | | /*! |
| | | @abstract Get the user defaults key used by legacy token caches. |
| | | */ |
| | | + (NSString *)legacyUserDefaultTokenInformationKeyName; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | @class FBSDKAccessToken; |
| | | |
| | | /*! |
| | | @typedef |
| | | |
| | | @abstract Callback block for returning an array of FBSDKAccessToken instances (and possibly `NSNull` instances); or an error. |
| | | */ |
| | | typedef void (^FBSDKTestUsersManagerRetrieveTestAccountTokensHandler)(NSArray *tokens, NSError *error) ; |
| | | |
| | | /*! |
| | | @typedef |
| | | |
| | | @abstract Callback block for removing a test user. |
| | | */ |
| | | typedef void (^FBSDKTestUsersManagerRemoveTestAccountHandler)(NSError *error) ; |
| | | |
| | | |
| | | /*! |
| | | @class FBSDKTestUsersManager |
| | | @abstract Provides methods for managing test accounts for testing Facebook integration. |
| | | |
| | | @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 tests. It is not designed for use in |
| | | production application code. |
| | | |
| | | This class will make Graph API calls on behalf of your app to manage test accounts and requires |
| | | an app id and app secret. You will typically use this class to write unit or integration tests. |
| | | Make sure you NEVER include your app secret in your production app. |
| | | */ |
| | | @interface FBSDKTestUsersManager : NSObject |
| | | |
| | | /*! |
| | | @abstract construct or return the shared instance |
| | | @param appID the Facebook app id |
| | | @param appSecret the Facebook app secret |
| | | */ |
| | | + (instancetype)sharedInstanceForAppID:(NSString *)appID appSecret:(NSString *)appSecret; |
| | | |
| | | /*! |
| | | @abstract retrieve FBSDKAccessToken instances for test accounts with the specific permissions. |
| | | @param arraysOfPermissions an array of permissions sets, such as @[ [NSSet setWithObject:@"email"], [NSSet setWithObject:@"user_birthday"]] |
| | | if you needed two test accounts with email and birthday permissions, respectively. You can pass in empty nested sets |
| | | if you need two arbitrary test accounts. For convenience, passing nil is treated as @[ [NSSet set] ] |
| | | for fetching a single test user. |
| | | @param createIfNotFound if YES, new test accounts are created if no test accounts existed that fit the permissions |
| | | requirement |
| | | @param handler the callback to invoke which will return an array of `FBAccessTokenData` instances or an `NSError`. |
| | | If param `createIfNotFound` is NO, the array may contain `[NSNull null]` instances. |
| | | |
| | | @discussion If you are requesting test accounts with differing number of permissions, try to order |
| | | `arrayOfPermissionsArrays` so that the most number of permissions come first to minimize creation of new |
| | | test accounts. |
| | | */ |
| | | - (void)requestTestAccountTokensWithArraysOfPermissions:(NSArray *)arraysOfPermissions |
| | | createIfNotFound:(BOOL)createIfNotFound |
| | | completionHandler:(FBSDKTestUsersManagerRetrieveTestAccountTokensHandler)handler; |
| | | |
| | | /*! |
| | | @abstract add a test account with the specified permissions |
| | | @param permissions the set of permissions, e.g., [NSSet setWithObjects:@"email", @"user_friends"] |
| | | @param handler the callback handler |
| | | */ |
| | | - (void)addTestAccountWithPermissions:(NSSet *)permissions |
| | | completionHandler:(FBSDKTestUsersManagerRetrieveTestAccountTokensHandler)handler; |
| | | |
| | | /*! |
| | | @abstract remove a test account for the given user id |
| | | @param userId the user id |
| | | @param handler the callback handler |
| | | */ |
| | | - (void)removeTestAccount:(NSString *)userId completionHandler:(FBSDKTestUsersManagerRemoveTestAccountHandler)handler; |
| | | |
| | | /*! |
| | | @abstract Make two test users friends with each other. |
| | | @param first the token of the first user |
| | | @param second the token of the second user |
| | | @param callback the callback handler |
| | | */ |
| | | - (void)makeFriendsWithFirst:(FBSDKAccessToken *)first second:(FBSDKAccessToken *)second callback:(void (^)(NSError *))callback; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /*! |
| | | @abstract Class to contain common utility methods. |
| | | */ |
| | | @interface FBSDKUtility : NSObject |
| | | |
| | | /*! |
| | | @abstract Parses a query string into a dictionary. |
| | | @param queryString The query string value. |
| | | @return A dictionary with the key/value pairs. |
| | | */ |
| | | + (NSDictionary *)dictionaryWithQueryString:(NSString *)queryString; |
| | | |
| | | /*! |
| | | @abstract Constructs a query string from a dictionary. |
| | | @param dictionary The dictionary with key/value pairs for the query string. |
| | | @param errorRef If an error occurs, upon return contains an NSError object that describes the problem. |
| | | @result Query string representation of the parameters. |
| | | */ |
| | | + (NSString *)queryStringWithDictionary:(NSDictionary *)dictionary error:(NSError *__autoreleasing *)errorRef; |
| | | |
| | | /*! |
| | | @abstract Decodes a value from an URL. |
| | | @param value The value to decode. |
| | | @result The decoded value. |
| | | */ |
| | | + (NSString *)URLDecode:(NSString *)value; |
| | | |
| | | /*! |
| | | @abstract Encodes a value for an URL. |
| | | @param value The value to encode. |
| | | @result The encoded value. |
| | | */ |
| | | + (NSString *)URLEncode:(NSString *)value; |
| | | |
| | | @end |
New file |
| | |
| | | framework module FBSDKCoreKit { |
| | | umbrella header "FBSDKCoreKit.h" |
| | | |
| | | export * |
| | | module * { export * } |
| | | } |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKButton.h> |
| | | |
| | | #import <FBSDKLoginKit/FBSDKLoginManager.h> |
| | | |
| | | #import "FBSDKTooltipView.h" |
| | | |
| | | @protocol FBSDKLoginButtonDelegate; |
| | | |
| | | /*! |
| | | @typedef NS_ENUM(NSUInteger, FBSDKLoginButtonTooltipBehavior) |
| | | @abstract Indicates the desired login tooltip behavior. |
| | | */ |
| | | typedef NS_ENUM(NSUInteger, FBSDKLoginButtonTooltipBehavior) |
| | | { |
| | | /*! The default behavior. The tooltip will only be displayed if |
| | | the app is eligible (determined by possible server round trip) */ |
| | | FBSDKLoginButtonTooltipBehaviorAutomatic = 0, |
| | | /*! Force display of the tooltip (typically for UI testing) */ |
| | | FBSDKLoginButtonTooltipBehaviorForceDisplay = 1, |
| | | /*! Force disable. In this case you can still exert more refined |
| | | control by manually constructing a `FBSDKLoginTooltipView` instance. */ |
| | | FBSDKLoginButtonTooltipBehaviorDisable = 2 |
| | | }; |
| | | |
| | | /*! |
| | | @abstract A button that initiates a log in or log out flow upon tapping. |
| | | @discussion `FBSDKLoginButton` works with `[FBSDKAccessToken currentAccessToken]` to |
| | | determine what to display, and automatically starts authentication when tapped (i.e., |
| | | you do not need to manually subscribe action targets). |
| | | |
| | | Like `FBSDKLoginManager`, you should make sure your app delegate is connected to |
| | | `FBSDKApplicationDelegate` in order for the button's delegate to receive messages. |
| | | |
| | | `FBSDKLoginButton` has a fixed height of @c 30 pixels, but you may change the width. `initWithFrame:CGRectZero` |
| | | will size the button to its minimum frame. |
| | | */ |
| | | @interface FBSDKLoginButton : FBSDKButton |
| | | |
| | | /*! |
| | | @abstract The default audience to use, if publish permissions are requested at login time. |
| | | */ |
| | | @property (assign, nonatomic) FBSDKDefaultAudience defaultAudience; |
| | | /*! |
| | | @abstract Gets or sets the delegate. |
| | | */ |
| | | @property (weak, nonatomic) IBOutlet id<FBSDKLoginButtonDelegate> delegate; |
| | | /*! |
| | | @abstract Gets or sets the login behavior to use |
| | | */ |
| | | @property (assign, nonatomic) FBSDKLoginBehavior loginBehavior; |
| | | /*! |
| | | @abstract The publish permissions to request. |
| | | |
| | | @discussion Use `defaultAudience` to specify the default audience to publish to. |
| | | Note this is converted to NSSet and is only |
| | | an NSArray for the convenience of literal syntax. |
| | | */ |
| | | @property (copy, nonatomic) NSArray *publishPermissions; |
| | | /*! |
| | | @abstract The read permissions to request. |
| | | |
| | | @discussion Note, that if read permissions are specified, then publish permissions should not be specified. This is converted to NSSet and is only |
| | | an NSArray for the convenience of literal syntax. |
| | | */ |
| | | @property (copy, nonatomic) NSArray *readPermissions; |
| | | /*! |
| | | @abstract Gets or sets the desired tooltip behavior. |
| | | */ |
| | | @property (assign, nonatomic) FBSDKLoginButtonTooltipBehavior tooltipBehavior; |
| | | /*! |
| | | @abstract Gets or sets the desired tooltip color style. |
| | | */ |
| | | @property (assign, nonatomic) FBSDKTooltipColorStyle tooltipColorStyle; |
| | | |
| | | @end |
| | | |
| | | /*! |
| | | @protocol |
| | | @abstract A delegate for `FBSDKLoginButton` |
| | | */ |
| | | @protocol FBSDKLoginButtonDelegate <NSObject> |
| | | |
| | | @required |
| | | /*! |
| | | @abstract Sent to the delegate when the button was used to login. |
| | | @param loginButton the sender |
| | | @param result The results of the login |
| | | @param error The error (if any) from the login |
| | | */ |
| | | - (void) loginButton:(FBSDKLoginButton *)loginButton |
| | | didCompleteWithResult:(FBSDKLoginManagerLoginResult *)result |
| | | error:(NSError *)error; |
| | | |
| | | /*! |
| | | @abstract Sent to the delegate when the button was used to logout. |
| | | @param loginButton The button that was clicked. |
| | | */ |
| | | - (void)loginButtonDidLogOut:(FBSDKLoginButton *)loginButton; |
| | | |
| | | @optional |
| | | /*! |
| | | @abstract Sent to the delegate when the button is about to login. |
| | | @param loginButton the sender |
| | | @return YES if the login should be allowed to proceed, NO otherwise |
| | | */ |
| | | - (BOOL) loginButtonWillLogin:(FBSDKLoginButton *)loginButton; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKMacros.h> |
| | | |
| | | /*! |
| | | @abstract The error domain for all errors from FBSDKLoginKit |
| | | @discussion Error codes from the SDK in the range 300-399 are reserved for this domain. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKLoginErrorDomain; |
| | | |
| | | /*! |
| | | @typedef NS_ENUM(NSInteger, FBSDKLoginErrorCode) |
| | | @abstract Error codes for FBSDKLoginErrorDomain. |
| | | */ |
| | | typedef NS_ENUM(NSInteger, FBSDKLoginErrorCode) |
| | | { |
| | | /*! |
| | | @abstract Reserved. |
| | | */ |
| | | FBSDKLoginReservedErrorCode = 300, |
| | | /*! |
| | | @abstract The error code for unknown errors. |
| | | */ |
| | | FBSDKLoginUnknownErrorCode, |
| | | |
| | | /*! |
| | | @abstract The user's password has changed and must log in again |
| | | */ |
| | | FBSDKLoginPasswordChangedErrorCode, |
| | | /*! |
| | | @abstract The user must log in to their account on www.facebook.com to restore access |
| | | */ |
| | | FBSDKLoginUserCheckpointedErrorCode, |
| | | /*! |
| | | @abstract Indicates a failure to request new permissions because the user has changed. |
| | | */ |
| | | FBSDKLoginUserMismatchErrorCode, |
| | | /*! |
| | | @abstract The user must confirm their account with Facebook before logging in |
| | | */ |
| | | FBSDKLoginUnconfirmedUserErrorCode, |
| | | |
| | | /*! |
| | | @abstract The Accounts framework failed without returning an error, indicating the |
| | | app's slider in the iOS Facebook Settings (device Settings -> Facebook -> App Name) has |
| | | been disabled. |
| | | */ |
| | | FBSDKLoginSystemAccountAppDisabledErrorCode, |
| | | /*! |
| | | @abstract An error occurred related to Facebook system Account store |
| | | */ |
| | | FBSDKLoginSystemAccountUnavailableErrorCode, |
| | | /*! |
| | | @abstract The login response was missing a valid challenge string. |
| | | */ |
| | | FBSDKLoginBadChallengeString, |
| | | }; |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | #import <FBSDKLoginKit/FBSDKLoginButton.h> |
| | | #import <FBSDKLoginKit/FBSDKLoginConstants.h> |
| | | #import <FBSDKLoginKit/FBSDKLoginManager.h> |
| | | #import <FBSDKLoginKit/FBSDKLoginManagerLoginResult.h> |
| | | #import <FBSDKLoginKit/FBSDKLoginTooltipView.h> |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Accounts/Accounts.h> |
| | | #import <Foundation/Foundation.h> |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | @class FBSDKLoginManagerLoginResult; |
| | | |
| | | /*! |
| | | @abstract Describes the call back to the FBSDKLoginManager |
| | | @param result the result of the authorization |
| | | @param error the authorization error, if any. |
| | | */ |
| | | typedef void (^FBSDKLoginManagerRequestTokenHandler)(FBSDKLoginManagerLoginResult *result, NSError *error); |
| | | |
| | | |
| | | /*! |
| | | @typedef FBSDKDefaultAudience 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 NS_ENUM(NSUInteger, FBSDKDefaultAudience) |
| | | { |
| | | /*! Indicates that the user's friends are able to see posts made by the application */ |
| | | FBSDKDefaultAudienceFriends = 0, |
| | | /*! Indicates that only the user is able to see posts made by the application */ |
| | | FBSDKDefaultAudienceOnlyMe, |
| | | /*! Indicates that all Facebook users are able to see posts made by the application */ |
| | | FBSDKDefaultAudienceEveryone, |
| | | }; |
| | | |
| | | /*! |
| | | @typedef FBSDKLoginBehavior enum |
| | | |
| | | @abstract |
| | | Passed to the \c FBSDKLoginManager to indicate how Facebook Login should 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. |
| | | |
| | | The \c FBSDKLoginBehavior enum specifies which log-in methods may be used. The SDK |
| | | will determine the best behavior based on the current device (such as iOS version). |
| | | */ |
| | | typedef NS_ENUM(NSUInteger, FBSDKLoginBehavior) |
| | | { |
| | | /*! |
| | | @abstract This is the default behavior, and indicates logging in through the native |
| | | Facebook app may be used. The SDK may still use Safari instead. |
| | | */ |
| | | FBSDKLoginBehaviorNative = 0, |
| | | /*! |
| | | @abstract Attempts log in through the Safari or SFSafariViewController, if available. |
| | | */ |
| | | FBSDKLoginBehaviorBrowser, |
| | | /*! |
| | | @abstract Attempts log in through the Facebook account currently signed in through |
| | | the device Settings. |
| | | @note If the account is not available to the app (either not configured by user or |
| | | as determined by the SDK) this behavior falls back to \c FBSDKLoginBehaviorNative. |
| | | */ |
| | | FBSDKLoginBehaviorSystemAccount, |
| | | /*! |
| | | @abstract Attemps log in through a modal \c UIWebView pop up |
| | | |
| | | @note This behavior is only available to certain types of apps. Please check the Facebook |
| | | Platform Policy to verify your app meets the restrictions. |
| | | */ |
| | | FBSDKLoginBehaviorWeb, |
| | | }; |
| | | |
| | | /*! |
| | | @abstract `FBSDKLoginManager` provides methods for logging the user in and out. |
| | | @discussion `FBSDKLoginManager` works directly with `[FBSDKAccessToken currentAccessToken]` and |
| | | sets the "currentAccessToken" upon successful authorizations (or sets `nil` in case of `logOut`). |
| | | |
| | | You should check `[FBSDKAccessToken currentAccessToken]` before calling logIn* to see if there is |
| | | a cached token available (typically in your viewDidLoad). |
| | | |
| | | If you are managing your own token instances outside of "currentAccessToken", you will need to set |
| | | "currentAccessToken" before calling logIn* to authorize futher permissions on your tokens. |
| | | */ |
| | | @interface FBSDKLoginManager : NSObject |
| | | |
| | | /*! |
| | | @abstract the default audience. |
| | | @discussion you should set this if you intend to ask for publish permissions. |
| | | */ |
| | | @property (assign, nonatomic) FBSDKDefaultAudience defaultAudience; |
| | | |
| | | /*! |
| | | @abstract the login behavior |
| | | */ |
| | | @property (assign, nonatomic) FBSDKLoginBehavior loginBehavior; |
| | | |
| | | /*! |
| | | @deprecated use logInWithReadPermissions:fromViewController:handler: instead |
| | | */ |
| | | - (void)logInWithReadPermissions:(NSArray *)permissions handler:(FBSDKLoginManagerRequestTokenHandler)handler |
| | | __attribute__ ((deprecated("use logInWithReadPermissions:fromViewController:handler: instead"))); |
| | | |
| | | /*! |
| | | @deprecated use logInWithPublishPermissions:fromViewController:handler: instead |
| | | */ |
| | | - (void)logInWithPublishPermissions:(NSArray *)permissions handler:(FBSDKLoginManagerRequestTokenHandler)handler |
| | | __attribute__ ((deprecated("use logInWithPublishPermissions:fromViewController:handler: instead"))); |
| | | |
| | | /*! |
| | | @abstract Logs the user in or authorizes additional permissions. |
| | | @param permissions the optional array of permissions. Note this is converted to NSSet and is only |
| | | an NSArray for the convenience of literal syntax. |
| | | @param fromViewController the view controller to present from. If nil, the topmost view controller will be |
| | | automatically determined as best as possible. |
| | | @param handler the callback. |
| | | @discussion Use this method when asking for read permissions. You should only ask for permissions when they |
| | | are needed and explain the value to the user. You can inspect the result.declinedPermissions to also |
| | | provide more information to the user if they decline permissions. |
| | | |
| | | If `[FBSDKAccessToken currentAccessToken]` is not nil, it will be treated as a reauthorization for that user |
| | | and will pass the "rerequest" flag to the login dialog. |
| | | |
| | | This method will present UI the user. You typically should check if `[FBSDKAccessToken currentAccessToken]` |
| | | already contains the permissions you need before asking to reduce unnecessary app switching. For example, |
| | | you could make that check at viewDidLoad. |
| | | */ |
| | | - (void)logInWithReadPermissions:(NSArray *)permissions |
| | | fromViewController:(UIViewController *)fromViewController |
| | | handler:(FBSDKLoginManagerRequestTokenHandler)handler; |
| | | |
| | | /*! |
| | | @abstract Logs the user in or authorizes additional permissions. |
| | | @param permissions the optional array of permissions. Note this is converted to NSSet and is only |
| | | an NSArray for the convenience of literal syntax. |
| | | @param fromViewController the view controller to present from. If nil, the topmost view controller will be |
| | | automatically determined as best as possible. |
| | | @param handler the callback. |
| | | @discussion Use this method when asking for publish permissions. You should only ask for permissions when they |
| | | are needed and explain the value to the user. You can inspect the result.declinedPermissions to also |
| | | provide more information to the user if they decline permissions. |
| | | |
| | | If `[FBSDKAccessToken currentAccessToken]` is not nil, it will be treated as a reauthorization for that user |
| | | and will pass the "rerequest" flag to the login dialog. |
| | | |
| | | This method will present UI the user. You typically should check if `[FBSDKAccessToken currentAccessToken]` |
| | | already contains the permissions you need before asking to reduce unnecessary app switching. For example, |
| | | you could make that check at viewDidLoad. |
| | | */ |
| | | - (void)logInWithPublishPermissions:(NSArray *)permissions |
| | | fromViewController:(UIViewController *)fromViewController |
| | | handler:(FBSDKLoginManagerRequestTokenHandler)handler; |
| | | |
| | | /*! |
| | | @abstract Logs the user out |
| | | @discussion This calls [FBSDKAccessToken setCurrentAccessToken:nil] and [FBSDKProfile setCurrentProfile:nil]. |
| | | */ |
| | | - (void)logOut; |
| | | |
| | | /*! |
| | | @method |
| | | |
| | | @abstract Issues an asychronous renewCredentialsForAccount call to the device's Facebook account store. |
| | | |
| | | @param handler The completion handler to call when the renewal is completed. This can be invoked on an arbitrary thread. |
| | | |
| | | @discussion This can be used to explicitly renew account credentials 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). |
| | | |
| | | If the `[FBSDKAccessToken currentAccessToken]` was from the account store, a succesful renewal will also set |
| | | a new "currentAccessToken". |
| | | */ |
| | | + (void)renewSystemCredentials:(void (^)(ACAccountCredentialRenewResult result, NSError *error))handler; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | @class FBSDKAccessToken; |
| | | |
| | | /*! |
| | | @abstract Describes the result of a login attempt. |
| | | */ |
| | | @interface FBSDKLoginManagerLoginResult : NSObject |
| | | |
| | | /*! |
| | | @abstract the access token. |
| | | */ |
| | | @property (copy, nonatomic) FBSDKAccessToken *token; |
| | | |
| | | /*! |
| | | @abstract whether the login was cancelled by the user. |
| | | */ |
| | | @property (readonly, nonatomic) BOOL isCancelled; |
| | | |
| | | /*! |
| | | @abstract the set of permissions granted by the user in the associated request. |
| | | @discussion inspect the token's permissions set for a complete list. |
| | | */ |
| | | @property (copy, nonatomic) NSSet *grantedPermissions; |
| | | |
| | | /*! |
| | | @abstract the set of permissions declined by the user in the associated request. |
| | | @discussion inspect the token's permissions set for a complete list. |
| | | */ |
| | | @property (copy, nonatomic) NSSet *declinedPermissions; |
| | | |
| | | /*! |
| | | @abstract Initializes a new instance. |
| | | @param token the access token |
| | | @param isCancelled whether the login was cancelled by the user |
| | | @param grantedPermissions the set of granted permissions |
| | | @param declinedPermissions the set of declined permissions |
| | | */ |
| | | - (instancetype)initWithToken:(FBSDKAccessToken *)token |
| | | isCancelled:(BOOL)isCancelled |
| | | grantedPermissions:(NSSet *)grantedPermissions |
| | | declinedPermissions:(NSSet *)declinedPermissions |
| | | NS_DESIGNATED_INITIALIZER; |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | #import <FBSDKLoginKit/FBSDKTooltipView.h> |
| | | |
| | | @protocol FBSDKLoginTooltipViewDelegate; |
| | | |
| | | /*! |
| | | @class FBSDKLoginTooltipView |
| | | |
| | | @abstract Represents a tooltip to be displayed next to a Facebook login button |
| | | to highlight features for new users. |
| | | |
| | | @discussion The `FBSDKLoginButton` may display this view automatically. If you do |
| | | not use the `FBSDKLoginButton`, you can manually call one of the `present*` methods |
| | | as appropriate and customize behavior via `FBSDKLoginTooltipViewDelegate` delegate. |
| | | |
| | | By default, the `FBSDKLoginTooltipView` is not added to the superview until it is |
| | | determined the app has migrated to the new login experience. You can override this |
| | | (e.g., to test the UI layout) by implementing the delegate or setting `forceDisplay` to YES. |
| | | |
| | | */ |
| | | @interface FBSDKLoginTooltipView : FBSDKTooltipView |
| | | |
| | | /*! @abstract the delegate */ |
| | | @property (nonatomic, assign) id<FBSDKLoginTooltipViewDelegate> delegate; |
| | | |
| | | /*! @abstract if set to YES, the view will always be displayed and the delegate's |
| | | `loginTooltipView:shouldAppear:` will NOT be called. */ |
| | | @property (nonatomic, assign) BOOL forceDisplay; |
| | | |
| | | @end |
| | | |
| | | /*! |
| | | @protocol |
| | | |
| | | @abstract |
| | | The `FBSDKLoginTooltipViewDelegate` protocol defines the methods used to receive event |
| | | notifications from `FBSDKLoginTooltipView` objects. |
| | | */ |
| | | @protocol FBSDKLoginTooltipViewDelegate <NSObject> |
| | | |
| | | @optional |
| | | |
| | | /*! |
| | | @abstract |
| | | Asks the delegate if the tooltip view should appear |
| | | |
| | | @param view The tooltip view. |
| | | @param appIsEligible The value fetched from the server identifying if the app |
| | | is eligible for the new login experience. |
| | | |
| | | @discussion Use this method to customize display behavior. |
| | | */ |
| | | - (BOOL)loginTooltipView:(FBSDKLoginTooltipView *)view shouldAppear:(BOOL)appIsEligible; |
| | | |
| | | /*! |
| | | @abstract |
| | | Tells the delegate the tooltip view will appear, specifically after it's been |
| | | added to the super view but before the fade in animation. |
| | | |
| | | @param view The tooltip view. |
| | | */ |
| | | - (void)loginTooltipViewWillAppear:(FBSDKLoginTooltipView *)view; |
| | | |
| | | /*! |
| | | @abstract |
| | | Tells the delegate the tooltip view will not appear (i.e., was not |
| | | added to the super view). |
| | | |
| | | @param view The tooltip view. |
| | | */ |
| | | - (void)loginTooltipViewWillNotAppear:(FBSDKLoginTooltipView *)view; |
| | | |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | /*! |
| | | @typedef FBSDKTooltipViewArrowDirection enum |
| | | |
| | | @abstract |
| | | Passed on construction to determine arrow orientation. |
| | | */ |
| | | typedef NS_ENUM(NSUInteger, FBSDKTooltipViewArrowDirection) |
| | | { |
| | | /*! View is located above given point, arrow is pointing down. */ |
| | | FBSDKTooltipViewArrowDirectionDown = 0, |
| | | /*! View is located below given point, arrow is pointing up. */ |
| | | FBSDKTooltipViewArrowDirectionUp = 1, |
| | | }; |
| | | |
| | | /*! |
| | | @typedef FBSDKTooltipColorStyle enum |
| | | |
| | | @abstract |
| | | Passed on construction to determine color styling. |
| | | */ |
| | | typedef NS_ENUM(NSUInteger, FBSDKTooltipColorStyle) |
| | | { |
| | | /*! Light blue background, white text, faded blue close button. */ |
| | | FBSDKTooltipColorStyleFriendlyBlue = 0, |
| | | /*! Dark gray background, white text, light gray close button. */ |
| | | FBSDKTooltipColorStyleNeutralGray = 1, |
| | | }; |
| | | |
| | | /*! |
| | | @class FBSDKTooltipView |
| | | |
| | | @abstract |
| | | Tooltip bubble with text in it used to display tips for UI elements, |
| | | with a pointed arrow (to refer to the UI element). |
| | | |
| | | @discussion |
| | | The tooltip fades in and will automatically fade out. See `displayDuration`. |
| | | */ |
| | | @interface FBSDKTooltipView : UIView |
| | | |
| | | /*! |
| | | @abstract Gets or sets the amount of time in seconds the tooltip should be displayed. |
| | | |
| | | @discussion Set this to zero to make the display permanent until explicitly dismissed. |
| | | Defaults to six seconds. |
| | | */ |
| | | @property (nonatomic, assign) CFTimeInterval displayDuration; |
| | | |
| | | /*! |
| | | @abstract Gets or sets the color style after initialization. |
| | | |
| | | @discussion Defaults to value passed to -initWithTagline:message:colorStyle:. |
| | | */ |
| | | @property (nonatomic, assign) FBSDKTooltipColorStyle colorStyle; |
| | | |
| | | /*! |
| | | @abstract Gets or sets the message. |
| | | */ |
| | | @property (nonatomic, copy) NSString *message; |
| | | |
| | | /*! |
| | | @abstract Gets or sets the optional phrase that comprises the first part of the label (and is highlighted differently). |
| | | */ |
| | | @property (nonatomic, copy) NSString *tagline; |
| | | |
| | | /*! |
| | | @abstract |
| | | Designated initializer. |
| | | |
| | | @param tagline First part of the label, that will be highlighted with different color. Can be nil. |
| | | |
| | | @param message Main message to display. |
| | | |
| | | @param colorStyle Color style to use for tooltip. |
| | | |
| | | @discussion |
| | | If you need to show a tooltip for login, consider using the `FBSDKLoginTooltipView` view. |
| | | |
| | | @see FBSDKLoginTooltipView |
| | | */ |
| | | - (instancetype)initWithTagline:(NSString *)tagline message:(NSString *)message colorStyle:(FBSDKTooltipColorStyle)colorStyle; |
| | | |
| | | /*! |
| | | @abstract |
| | | Show tooltip at the top or at the bottom of given view. |
| | | Tooltip will be added to anchorView.window.rootViewController.view |
| | | |
| | | @param anchorView view to show at, must be already added to window view hierarchy, in order to decide |
| | | where tooltip will be shown. (If there's not enough space at the top of the anchorView in window bounds - |
| | | tooltip will be shown at the bottom of it) |
| | | |
| | | @discussion |
| | | Use this method to present the tooltip with automatic positioning or |
| | | use -presentInView:withArrowPosition:direction: for manual positioning |
| | | If anchorView is nil or has no window - this method does nothing. |
| | | */ |
| | | - (void)presentFromView:(UIView *)anchorView; |
| | | |
| | | /*! |
| | | @abstract |
| | | Adds tooltip to given view, with given position and arrow direction. |
| | | |
| | | @param view View to be used as superview. |
| | | |
| | | @param arrowPosition Point in view's cordinates, where arrow will be pointing |
| | | |
| | | @param arrowDirection whenever arrow should be pointing up (message bubble is below the arrow) or |
| | | down (message bubble is above the arrow). |
| | | */ |
| | | - (void)presentInView:(UIView *)view withArrowPosition:(CGPoint)arrowPosition direction:(FBSDKTooltipViewArrowDirection)arrowDirection; |
| | | |
| | | /*! |
| | | @abstract |
| | | Remove tooltip manually. |
| | | |
| | | @discussion |
| | | Calling this method isn't necessary - tooltip will dismiss itself automatically after the `displayDuration`. |
| | | */ |
| | | - (void)dismiss; |
| | | |
| | | @end |
New file |
| | |
| | | framework module FBSDKLoginKit { |
| | | umbrella header "FBSDKLoginKit.h" |
| | | |
| | | export * |
| | | module * { export * } |
| | | } |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKShareKit/FBSDKAppGroupContent.h> |
| | | |
| | | @protocol FBSDKAppGroupAddDialogDelegate; |
| | | |
| | | /*! |
| | | @abstract A dialog for creating app groups. |
| | | */ |
| | | @interface FBSDKAppGroupAddDialog : NSObject |
| | | |
| | | /*! |
| | | @abstract Convenience method to build up an app group dialog with content and a delegate. |
| | | @param content The content for the app group. |
| | | @param delegate The receiver's delegate. |
| | | */ |
| | | + (instancetype)showWithContent:(FBSDKAppGroupContent *)content |
| | | delegate:(id<FBSDKAppGroupAddDialogDelegate>)delegate; |
| | | |
| | | /*! |
| | | @abstract The receiver's delegate or nil if it doesn't have a delegate. |
| | | */ |
| | | @property (nonatomic, weak) id<FBSDKAppGroupAddDialogDelegate> delegate; |
| | | |
| | | /*! |
| | | @abstract The content for app group. |
| | | */ |
| | | @property (nonatomic, copy) FBSDKAppGroupContent *content; |
| | | |
| | | /*! |
| | | @abstract A Boolean value that indicates whether the receiver can initiate an app group dialog. |
| | | @discussion May return NO if the appropriate Facebook app is not installed and is required or an access token is |
| | | required but not available. This method does not validate the content on the receiver, so this can be checked before |
| | | building up the content. |
| | | @see validateWithError: |
| | | @result YES if the receiver can share, otherwise NO. |
| | | */ |
| | | - (BOOL)canShow; |
| | | |
| | | /*! |
| | | @abstract Begins the app group dialog from the receiver. |
| | | @result YES if the receiver was able to show the dialog, otherwise NO. |
| | | */ |
| | | - (BOOL)show; |
| | | |
| | | /*! |
| | | @abstract Validates the content on the receiver. |
| | | @param errorRef If an error occurs, upon return contains an NSError object that describes the problem. |
| | | @return YES if the content is valid, otherwise NO. |
| | | */ |
| | | - (BOOL)validateWithError:(NSError *__autoreleasing *)errorRef; |
| | | |
| | | @end |
| | | |
| | | /*! |
| | | @abstract A delegate for FBSDKAppGroupAddDialog. |
| | | @discussion The delegate is notified with the results of the app group request as long as the application has |
| | | permissions to receive the information. For example, if the person is not signed into the containing app, the shower |
| | | may not be able to distinguish between completion of an app group request and cancellation. |
| | | */ |
| | | @protocol FBSDKAppGroupAddDialogDelegate <NSObject> |
| | | |
| | | /*! |
| | | @abstract Sent to the delegate when the app group request completes without error. |
| | | @param appGroupAddDialog The FBSDKAppGroupAddDialog that completed. |
| | | @param results The results from the dialog. This may be nil or empty. |
| | | */ |
| | | - (void)appGroupAddDialog:(FBSDKAppGroupAddDialog *)appGroupAddDialog didCompleteWithResults:(NSDictionary *)results; |
| | | |
| | | /*! |
| | | @abstract Sent to the delegate when the app group request encounters an error. |
| | | @param appGroupAddDialog The FBSDKAppGroupAddDialog that completed. |
| | | @param error The error. |
| | | */ |
| | | - (void)appGroupAddDialog:(FBSDKAppGroupAddDialog *)appGroupAddDialog didFailWithError:(NSError *)error; |
| | | |
| | | /*! |
| | | @abstract Sent to the delegate when the app group dialog is cancelled. |
| | | @param appGroupAddDialog The FBSDKAppGroupAddDialog that completed. |
| | | */ |
| | | - (void)appGroupAddDialogDidCancel:(FBSDKAppGroupAddDialog *)appGroupAddDialog; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKCopying.h> |
| | | #import <FBSDKCoreKit/FBSDKMacros.h> |
| | | |
| | | /*! |
| | | @typedef NS_ENUM(NSUInteger, FBSDKAppGroupPrivacy) |
| | | @abstract Specifies the privacy of a group. |
| | | */ |
| | | typedef NS_ENUM(NSUInteger, FBSDKAppGroupPrivacy) |
| | | { |
| | | /*! Anyone can see the group, who's in it and what members post. */ |
| | | FBSDKAppGroupPrivacyOpen = 0, |
| | | /*! Anyone can see the group and who's in it, but only members can see posts. */ |
| | | FBSDKAppGroupPrivacyClosed, |
| | | }; |
| | | |
| | | /*! |
| | | @abstract Converts an FBSDKAppGroupPrivacy to an NSString. |
| | | */ |
| | | FBSDK_EXTERN NSString *NSStringFromFBSDKAppGroupPrivacy(FBSDKAppGroupPrivacy privacy); |
| | | |
| | | /*! |
| | | @abstract A model for creating an app group. |
| | | */ |
| | | @interface FBSDKAppGroupContent : NSObject <FBSDKCopying, NSSecureCoding> |
| | | |
| | | /*! |
| | | @abstract The description of the group. |
| | | */ |
| | | @property (nonatomic, copy) NSString *groupDescription; |
| | | |
| | | /*! |
| | | @abstract The name of the group. |
| | | */ |
| | | @property (nonatomic, copy) NSString *name; |
| | | |
| | | /*! |
| | | @abstract The privacy for the group. |
| | | */ |
| | | @property (nonatomic, assign) FBSDKAppGroupPrivacy privacy; |
| | | |
| | | /*! |
| | | @abstract Compares the receiver to another app group content. |
| | | @param content The other content |
| | | @return YES if the receiver's values are equal to the other content's values; otherwise NO |
| | | */ |
| | | - (BOOL)isEqualToAppGroupContent:(FBSDKAppGroupContent *)content; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | @protocol FBSDKAppGroupJoinDialogDelegate; |
| | | |
| | | /*! |
| | | @abstract A dialog for joining app groups. |
| | | */ |
| | | @interface FBSDKAppGroupJoinDialog : NSObject |
| | | |
| | | /*! |
| | | @abstract Convenience method to build up an app group dialog with content and a delegate. |
| | | @param groupID The ID for the group. |
| | | @param delegate The receiver's delegate. |
| | | */ |
| | | + (instancetype)showWithGroupID:(NSString *)groupID |
| | | delegate:(id<FBSDKAppGroupJoinDialogDelegate>)delegate; |
| | | |
| | | /*! |
| | | @abstract The receiver's delegate or nil if it doesn't have a delegate. |
| | | */ |
| | | @property (nonatomic, weak) id<FBSDKAppGroupJoinDialogDelegate> delegate; |
| | | |
| | | /*! |
| | | @abstract The ID for group. |
| | | */ |
| | | @property (nonatomic, copy) NSString *groupID; |
| | | |
| | | /*! |
| | | @abstract A Boolean value that indicates whether the receiver can initiate an app group dialog. |
| | | @discussion May return NO if the appropriate Facebook app is not installed and is required or an access token is |
| | | required but not available. This method does not validate the content on the receiver, so this can be checked before |
| | | building up the content. |
| | | @see validateWithError: |
| | | @result YES if the receiver can share, otherwise NO. |
| | | */ |
| | | - (BOOL)canShow; |
| | | |
| | | /*! |
| | | @abstract Begins the app group dialog from the receiver. |
| | | @result YES if the receiver was able to show the dialog, otherwise NO. |
| | | */ |
| | | - (BOOL)show; |
| | | |
| | | /*! |
| | | @abstract Validates the content on the receiver. |
| | | @param errorRef If an error occurs, upon return contains an NSError object that describes the problem. |
| | | @return YES if the content is valid, otherwise NO. |
| | | */ |
| | | - (BOOL)validateWithError:(NSError *__autoreleasing *)errorRef; |
| | | |
| | | @end |
| | | |
| | | /*! |
| | | @abstract A delegate for FBSDKAppGroupJoinDialog. |
| | | @discussion The delegate is notified with the results of the app group request as long as the application has |
| | | permissions to receive the information. For example, if the person is not signed into the containing app, the shower |
| | | may not be able to distinguish between completion of an app group request and cancellation. |
| | | */ |
| | | @protocol FBSDKAppGroupJoinDialogDelegate <NSObject> |
| | | |
| | | /*! |
| | | @abstract Sent to the delegate when the app group request completes without error. |
| | | @param appGroupJoinDialog The FBSDKAppGroupJoinDialog that completed. |
| | | @param results The results from the dialog. This may be nil or empty. |
| | | */ |
| | | - (void)appGroupJoinDialog:(FBSDKAppGroupJoinDialog *)appGroupJoinDialog didCompleteWithResults:(NSDictionary *)results; |
| | | |
| | | /*! |
| | | @abstract Sent to the delegate when the app group request encounters an error. |
| | | @param appGroupJoinDialog The FBSDKAppGroupJoinDialog that completed. |
| | | @param error The error. |
| | | */ |
| | | - (void)appGroupJoinDialog:(FBSDKAppGroupJoinDialog *)appGroupJoinDialog didFailWithError:(NSError *)error; |
| | | |
| | | /*! |
| | | @abstract Sent to the delegate when the app group dialog is cancelled. |
| | | @param appGroupJoinDialog The FBSDKAppGroupJoinDialog that completed. |
| | | */ |
| | | - (void)appGroupJoinDialogDidCancel:(FBSDKAppGroupJoinDialog *)appGroupJoinDialog; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKCopying.h> |
| | | |
| | | /*! |
| | | @abstract A model for app invite. |
| | | */ |
| | | @interface FBSDKAppInviteContent : NSObject <FBSDKCopying, NSSecureCoding> |
| | | |
| | | /*! |
| | | @abstract A URL to a preview image that will be displayed with the app invite |
| | | |
| | | @discussion This is optional. If you don't include it a fallback image will be used. |
| | | */ |
| | | @property (nonatomic, copy) NSURL *appInvitePreviewImageURL; |
| | | |
| | | /*! |
| | | @abstract An app link target that will be used as a target when the user accept the invite. |
| | | |
| | | @discussion This is a requirement. |
| | | */ |
| | | @property (nonatomic, copy) NSURL *appLinkURL; |
| | | |
| | | /*! |
| | | @deprecated Use `appInvitePreviewImageURL` instead. |
| | | */ |
| | | @property (nonatomic, copy) NSURL *previewImageURL __attribute__ ((deprecated("use appInvitePreviewImageURL instead"))); |
| | | |
| | | /*! |
| | | @abstract Promotional code to be displayed while sending and receiving the invite. |
| | | |
| | | @discussion This is optional. This can be between 0 and 10 characters long and can contain |
| | | alphanumeric characters only. To set a promo code, you need to set promo text. |
| | | */ |
| | | @property (nonatomic, copy) NSString *promotionCode; |
| | | |
| | | /*! |
| | | @abstract Promotional text to be displayed while sending and receiving the invite. |
| | | |
| | | @discussion This is optional. This can be between 0 and 80 characters long and can contain |
| | | alphanumeric and spaces only. |
| | | */ |
| | | @property (nonatomic, copy) NSString *promotionText; |
| | | |
| | | /*! |
| | | @abstract Compares the receiver to another app invite content. |
| | | @param content The other content |
| | | @return YES if the receiver's values are equal to the other content's values; otherwise NO |
| | | */ |
| | | - (BOOL)isEqualToAppInviteContent:(FBSDKAppInviteContent *)content; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | #import <FBSDKShareKit/FBSDKAppInviteContent.h> |
| | | |
| | | @protocol FBSDKAppInviteDialogDelegate; |
| | | |
| | | /*! |
| | | @abstract A dialog for sending App Invites. |
| | | */ |
| | | @interface FBSDKAppInviteDialog : NSObject |
| | | |
| | | /*! |
| | | @abstract Convenience method to show a FBSDKAppInviteDialog |
| | | @param viewController A UIViewController to present the dialog from. |
| | | @param content The content for the app invite. |
| | | @param delegate The receiver's delegate. |
| | | */ |
| | | + (instancetype)showFromViewController:(UIViewController *)viewController |
| | | withContent:(FBSDKAppInviteContent *)content |
| | | delegate:(id<FBSDKAppInviteDialogDelegate>)delegate; |
| | | |
| | | |
| | | /*! |
| | | @deprecated use showFromViewController:withContent:delegate: instead |
| | | */ |
| | | + (instancetype)showWithContent:(FBSDKAppInviteContent *)content delegate:(id<FBSDKAppInviteDialogDelegate>)delegate |
| | | __attribute__ ((deprecated("use showFromViewController:withContent:delegate: instead"))); |
| | | |
| | | /*! |
| | | @abstract A UIViewController to present the dialog from. |
| | | @discussion If not specified, the top most view controller will be automatically determined as best as possible. |
| | | */ |
| | | @property (nonatomic, weak) UIViewController *fromViewController; |
| | | |
| | | /*! |
| | | @abstract The receiver's delegate or nil if it doesn't have a delegate. |
| | | */ |
| | | @property (nonatomic, weak) id<FBSDKAppInviteDialogDelegate> delegate; |
| | | |
| | | /*! |
| | | @abstract The content for app invite. |
| | | */ |
| | | @property (nonatomic, copy) FBSDKAppInviteContent *content; |
| | | |
| | | /*! |
| | | @abstract A Boolean value that indicates whether the receiver can initiate an app invite. |
| | | @discussion May return NO if the appropriate Facebook app is not installed and is required or an access token is |
| | | required but not available. This method does not validate the content on the receiver, so this can be checked before |
| | | building up the content. |
| | | @see validateWithError: |
| | | @result YES if the receiver can show the dialog, otherwise NO. |
| | | */ |
| | | - (BOOL)canShow; |
| | | |
| | | /*! |
| | | @abstract Begins the app invite from the receiver. |
| | | @result YES if the receiver was able to show the dialog, otherwise NO. |
| | | */ |
| | | - (BOOL)show; |
| | | |
| | | /*! |
| | | @abstract Validates the content on the receiver. |
| | | @param errorRef If an error occurs, upon return contains an NSError object that describes the problem. |
| | | @return YES if the content is valid, otherwise NO. |
| | | */ |
| | | - (BOOL)validateWithError:(NSError *__autoreleasing *)errorRef; |
| | | |
| | | @end |
| | | |
| | | /*! |
| | | @abstract A delegate for FBSDKAppInviteDialog. |
| | | @discussion The delegate is notified with the results of the app invite as long as the application has permissions to |
| | | receive the information. For example, if the person is not signed into the containing app, the shower may not be able |
| | | to distinguish between completion of an app invite and cancellation. |
| | | */ |
| | | @protocol FBSDKAppInviteDialogDelegate <NSObject> |
| | | |
| | | /*! |
| | | @abstract Sent to the delegate when the app invite completes without error. |
| | | @param appInviteDialog The FBSDKAppInviteDialog that completed. |
| | | @param results The results from the dialog. This may be nil or empty. |
| | | */ |
| | | - (void)appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog didCompleteWithResults:(NSDictionary *)results; |
| | | |
| | | /*! |
| | | @abstract Sent to the delegate when the app invite encounters an error. |
| | | @param appInviteDialog The FBSDKAppInviteDialog that completed. |
| | | @param error The error. |
| | | */ |
| | | - (void)appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog didFailWithError:(NSError *)error; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKCopying.h> |
| | | |
| | | /*! |
| | | @typedef NS_ENUM(NSUInteger, FBSDKGameRequestActionType) |
| | | @abstract Additional context about the nature of the request. |
| | | */ |
| | | typedef NS_ENUM(NSUInteger, FBSDKGameRequestActionType) |
| | | { |
| | | /*! No action type */ |
| | | FBSDKGameRequestActionTypeNone = 0, |
| | | /*! Send action type: The user is sending an object to the friends. */ |
| | | FBSDKGameRequestActionTypeSend, |
| | | /*! Ask For action type: The user is asking for an object from friends. */ |
| | | FBSDKGameRequestActionTypeAskFor, |
| | | /*! Turn action type: It is the turn of the friends to play against the user in a match. (no object) */ |
| | | FBSDKGameRequestActionTypeTurn, |
| | | }; |
| | | |
| | | /*! |
| | | @typedef NS_ENUM(NSUInteger, FBSDKGameRequestFilters) |
| | | @abstract Filter for who can be displayed in the multi-friend selector. |
| | | */ |
| | | typedef NS_ENUM(NSUInteger, FBSDKGameRequestFilter) |
| | | { |
| | | /*! No filter, all friends can be displayed. */ |
| | | FBSDKGameRequestFilterNone = 0, |
| | | /*! Friends using the app can be displayed. */ |
| | | FBSDKGameRequestFilterAppUsers, |
| | | /*! Friends not using the app can be displayed. */ |
| | | FBSDKGameRequestFilterAppNonUsers, |
| | | }; |
| | | |
| | | /*! |
| | | @abstract A model for a game request. |
| | | */ |
| | | @interface FBSDKGameRequestContent : NSObject <FBSDKCopying, NSSecureCoding> |
| | | |
| | | /*! |
| | | @abstract Used when defining additional context about the nature of the request. |
| | | @discussion The parameter 'objectID' is required if the action type is either |
| | | 'FBSDKGameRequestSendActionType' or 'FBSDKGameRequestAskForActionType'. |
| | | @seealso objectID |
| | | */ |
| | | @property (nonatomic, assign) FBSDKGameRequestActionType actionType; |
| | | |
| | | /*! |
| | | @abstract Compares the receiver to another game request content. |
| | | @param content The other content |
| | | @return YES if the receiver's values are equal to the other content's values; otherwise NO |
| | | */ |
| | | - (BOOL)isEqualToGameRequestContent:(FBSDKGameRequestContent *)content; |
| | | |
| | | /*! |
| | | @abstract Additional freeform data you may pass for tracking. This will be stored as part of |
| | | the request objects created. The maximum length is 255 characters. |
| | | */ |
| | | @property (nonatomic, copy) NSString *data; |
| | | |
| | | /*! |
| | | @abstract This controls the set of friends someone sees if a multi-friend selector is shown. |
| | | It is FBSDKGameRequestNoFilter by default, meaning that all friends can be shown. |
| | | If specify as FBSDKGameRequestAppUsersFilter, only friends who use the app will be shown. |
| | | On the other hands, use FBSDKGameRequestAppNonUsersFilter to filter only friends who do not use the app. |
| | | @discussion The parameter name is preserved to be consistent with the counter part on desktop. |
| | | */ |
| | | @property (nonatomic, assign) FBSDKGameRequestFilter filters; |
| | | |
| | | /*! |
| | | @abstract A plain-text message to be sent as part of the request. This text will surface in the App Center view |
| | | of the request, but not on the notification jewel. Required parameter. |
| | | */ |
| | | @property (nonatomic, copy) NSString *message; |
| | | |
| | | /*! |
| | | @abstract The Open Graph object ID of the object being sent. |
| | | @seealso actionType |
| | | */ |
| | | @property (nonatomic, copy) NSString *objectID; |
| | | |
| | | /*! |
| | | @abstract An array of user IDs, usernames or invite tokens (NSString) of people to send request. |
| | | @discussion These may or may not be a friend of the sender. If this is specified by the app, |
| | | the sender will not have a choice of recipients. If not, the sender will see a multi-friend selector |
| | | |
| | | This is equivalent to the "to" parameter when using the web game request dialog. |
| | | */ |
| | | @property (nonatomic, copy) NSArray *recipients; |
| | | |
| | | /*! |
| | | @abstract An array of user IDs that will be included in the dialog as the first suggested friends. |
| | | Cannot be used together with filters. |
| | | @discussion This is equivalent to the "suggestions" parameter when using the web game request dialog. |
| | | */ |
| | | @property (nonatomic, copy) NSArray *recipientSuggestions; |
| | | |
| | | /*! |
| | | @deprecated Use `recipientSuggestions` instead. |
| | | */ |
| | | @property (nonatomic, copy) NSArray *suggestions __attribute__ ((deprecated("use recipientSuggestions instead"))); |
| | | |
| | | /*! |
| | | @abstract The title for the dialog. |
| | | */ |
| | | @property (nonatomic, copy) NSString *title; |
| | | |
| | | /*! |
| | | @deprecated Use `recipients` instead. |
| | | */ |
| | | @property (nonatomic, copy) NSArray *to __attribute__ ((deprecated("use recipients instead"))); |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKShareKit/FBSDKGameRequestContent.h> |
| | | |
| | | @protocol FBSDKGameRequestDialogDelegate; |
| | | |
| | | /*! |
| | | @abstract A dialog for sending game requests. |
| | | */ |
| | | @interface FBSDKGameRequestDialog : NSObject |
| | | |
| | | /*! |
| | | @abstract Convenience method to build up a game request with content and a delegate. |
| | | @param content The content for the game request. |
| | | @param delegate The receiver's delegate. |
| | | */ |
| | | + (instancetype)showWithContent:(FBSDKGameRequestContent *)content delegate:(id<FBSDKGameRequestDialogDelegate>)delegate; |
| | | |
| | | /*! |
| | | @abstract The receiver's delegate or nil if it doesn't have a delegate. |
| | | */ |
| | | @property (nonatomic, weak) id<FBSDKGameRequestDialogDelegate> delegate; |
| | | |
| | | /*! |
| | | @abstract The content for game request. |
| | | */ |
| | | @property (nonatomic, copy) FBSDKGameRequestContent *content; |
| | | |
| | | /*! |
| | | @abstract Specifies whether frictionless requests are enabled. |
| | | */ |
| | | @property (nonatomic, assign) BOOL frictionlessRequestsEnabled; |
| | | |
| | | /*! |
| | | @abstract A Boolean value that indicates whether the receiver can initiate a game request. |
| | | @discussion May return NO if the appropriate Facebook app is not installed and is required or an access token is |
| | | required but not available. This method does not validate the content on the receiver, so this can be checked before |
| | | building up the content. |
| | | @see validateWithError: |
| | | @result YES if the receiver can share, otherwise NO. |
| | | */ |
| | | - (BOOL)canShow; |
| | | |
| | | /*! |
| | | @abstract Begins the game request from the receiver. |
| | | @result YES if the receiver was able to show the dialog, otherwise NO. |
| | | */ |
| | | - (BOOL)show; |
| | | |
| | | /*! |
| | | @abstract Validates the content on the receiver. |
| | | @param errorRef If an error occurs, upon return contains an NSError object that describes the problem. |
| | | @return YES if the content is valid, otherwise NO. |
| | | */ |
| | | - (BOOL)validateWithError:(NSError *__autoreleasing *)errorRef; |
| | | |
| | | @end |
| | | |
| | | /*! |
| | | @abstract A delegate for FBSDKGameRequestDialog. |
| | | @discussion The delegate is notified with the results of the game request as long as the application has permissions to |
| | | receive the information. For example, if the person is not signed into the containing app, the shower may not be able |
| | | to distinguish between completion of a game request and cancellation. |
| | | */ |
| | | @protocol FBSDKGameRequestDialogDelegate <NSObject> |
| | | |
| | | /*! |
| | | @abstract Sent to the delegate when the game request completes without error. |
| | | @param gameRequestDialog The FBSDKGameRequestDialog that completed. |
| | | @param results The results from the dialog. This may be nil or empty. |
| | | */ |
| | | - (void)gameRequestDialog:(FBSDKGameRequestDialog *)gameRequestDialog didCompleteWithResults:(NSDictionary *)results; |
| | | |
| | | /*! |
| | | @abstract Sent to the delegate when the game request encounters an error. |
| | | @param gameRequestDialog The FBSDKGameRequestDialog that completed. |
| | | @param error The error. |
| | | */ |
| | | - (void)gameRequestDialog:(FBSDKGameRequestDialog *)gameRequestDialog didFailWithError:(NSError *)error; |
| | | |
| | | /*! |
| | | @abstract Sent to the delegate when the game request dialog is cancelled. |
| | | @param gameRequestDialog The FBSDKGameRequestDialog that completed. |
| | | */ |
| | | - (void)gameRequestDialogDidCancel:(FBSDKGameRequestDialog *)gameRequestDialog; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKCopying.h> |
| | | |
| | | /*! |
| | | @abstract Represents a single hashtag that can be used with the share dialog. |
| | | */ |
| | | @interface FBSDKHashtag : NSObject <FBSDKCopying, NSSecureCoding> |
| | | |
| | | /*! |
| | | @abstract Convenience method to build a new hashtag with a string identifier. Equivalent to setting the |
| | | `stringRepresentation` property. |
| | | @param hashtagString The hashtag string. |
| | | */ |
| | | + (instancetype)hashtagWithString:(NSString *)hashtagString; |
| | | |
| | | /*! |
| | | @abstract The hashtag string. |
| | | @discussion You are responsible for making sure that `stringRepresentation` is a valid hashtag (a single '#' followed |
| | | by one or more word characters). Invalid hashtags are ignored when sharing content. You can check validity with the |
| | | `valid` property. |
| | | @return The hashtag string. |
| | | */ |
| | | @property (nonatomic, readwrite, copy) NSString *stringRepresentation; |
| | | |
| | | /*! |
| | | @abstract Tests if a hashtag is valid. |
| | | @discussion A valid hashtag matches the regular expression "#\w+": A single '#' followed by one or more |
| | | word characters. |
| | | @return YES if the hashtag is valid, NO otherwise. |
| | | */ |
| | | @property (nonatomic, readonly, assign, getter=isValid) BOOL valid; |
| | | |
| | | /*! |
| | | @abstract Compares the receiver to another hashtag. |
| | | @param hashtag The other hashtag |
| | | @return YES if the receiver is equal to the other hashtag; otherwise NO |
| | | */ |
| | | - (BOOL)isEqualToHashtag:(FBSDKHashtag *)hashtag; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKButton.h> |
| | | |
| | | #import <FBSDKShareKit/FBSDKLikeObjectType.h> |
| | | #import <FBSDKShareKit/FBSDKLiking.h> |
| | | |
| | | /*! |
| | | @abstract A button to like an object. |
| | | @discussion Tapping the receiver will invoke an API call to the Facebook app through a fast-app-switch that allows |
| | | the object to be liked. Upon return to the calling app, the view will update with the new state. If the |
| | | currentAccessToken has "publish_actions" permission and the object is an Open Graph object, then the like can happen |
| | | seamlessly without the fast-app-switch. |
| | | */ |
| | | @interface FBSDKLikeButton : FBSDKButton <FBSDKLiking> |
| | | |
| | | /*! |
| | | @abstract If YES, a sound is played when the receiver is toggled. |
| | | |
| | | @default YES |
| | | */ |
| | | @property (nonatomic, assign, getter = isSoundEnabled) BOOL soundEnabled; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKMacros.h> |
| | | |
| | | #import <FBSDKShareKit/FBSDKLikeObjectType.h> |
| | | #import <FBSDKShareKit/FBSDKLiking.h> |
| | | |
| | | /*! |
| | | @typedef NS_ENUM (NSUInteger, FBSDKLikeControlAuxiliaryPosition) |
| | | |
| | | @abstract Specifies the position of the auxiliary view relative to the like button. |
| | | */ |
| | | typedef NS_ENUM(NSUInteger, FBSDKLikeControlAuxiliaryPosition) |
| | | { |
| | | /*! The auxiliary view is inline with the like button. */ |
| | | FBSDKLikeControlAuxiliaryPositionInline, |
| | | /*! The auxiliary view is above the like button. */ |
| | | FBSDKLikeControlAuxiliaryPositionTop, |
| | | /*! The auxiliary view is below the like button. */ |
| | | FBSDKLikeControlAuxiliaryPositionBottom, |
| | | }; |
| | | |
| | | /*! |
| | | @abstract Converts an FBSDKLikeControlAuxiliaryPosition to an NSString. |
| | | */ |
| | | FBSDK_EXTERN NSString *NSStringFromFBSDKLikeControlAuxiliaryPosition(FBSDKLikeControlAuxiliaryPosition auxiliaryPosition); |
| | | |
| | | /*! |
| | | @typedef NS_ENUM(NSUInteger, FBSDKLikeControlHorizontalAlignment) |
| | | |
| | | @abstract Specifies the horizontal alignment for FBSDKLikeControlStyleStandard with |
| | | FBSDKLikeControlAuxiliaryPositionTop or FBSDKLikeControlAuxiliaryPositionBottom. |
| | | */ |
| | | typedef NS_ENUM(NSUInteger, FBSDKLikeControlHorizontalAlignment) |
| | | { |
| | | /*! The subviews are left aligned. */ |
| | | FBSDKLikeControlHorizontalAlignmentLeft, |
| | | /*! The subviews are center aligned. */ |
| | | FBSDKLikeControlHorizontalAlignmentCenter, |
| | | /*! The subviews are right aligned. */ |
| | | FBSDKLikeControlHorizontalAlignmentRight, |
| | | }; |
| | | |
| | | /*! |
| | | @abstract Converts an FBSDKLikeControlHorizontalAlignment to an NSString. |
| | | */ |
| | | FBSDK_EXTERN NSString *NSStringFromFBSDKLikeControlHorizontalAlignment(FBSDKLikeControlHorizontalAlignment horizontalAlignment); |
| | | |
| | | /*! |
| | | @typedef NS_ENUM (NSUInteger, FBSDKLikeControlStyle) |
| | | |
| | | @abstract Specifies the style of a like control. |
| | | */ |
| | | typedef NS_ENUM(NSUInteger, FBSDKLikeControlStyle) |
| | | { |
| | | /*! Displays the button and the social sentence. */ |
| | | FBSDKLikeControlStyleStandard = 0, |
| | | /*! Displays the button and a box that contains the like count. */ |
| | | FBSDKLikeControlStyleBoxCount, |
| | | }; |
| | | |
| | | /*! |
| | | @abstract Converts an FBSDKLikeControlStyle to an NSString. |
| | | */ |
| | | FBSDK_EXTERN NSString *NSStringFromFBSDKLikeControlStyle(FBSDKLikeControlStyle style); |
| | | |
| | | /*! |
| | | @class FBSDKLikeControl |
| | | |
| | | @abstract UI control to like an object in the Facebook graph. |
| | | |
| | | @discussion Taps on the like button within this control will invoke an API call to the Facebook app through a |
| | | fast-app-switch that allows the user to like the object. Upon return to the calling app, the view will update |
| | | with the new state and send actions for the UIControlEventValueChanged event. |
| | | */ |
| | | @interface FBSDKLikeControl : UIControl <FBSDKLiking> |
| | | |
| | | /*! |
| | | @abstract The foreground color to use for the content of the receiver. |
| | | */ |
| | | @property (nonatomic, strong) UIColor *foregroundColor; |
| | | |
| | | /*! |
| | | @abstract The position for the auxiliary view for the receiver. |
| | | |
| | | @see FBSDKLikeControlAuxiliaryPosition |
| | | */ |
| | | @property (nonatomic, assign) FBSDKLikeControlAuxiliaryPosition likeControlAuxiliaryPosition; |
| | | |
| | | /*! |
| | | @abstract The text alignment of the social sentence. |
| | | |
| | | @discussion This value is only valid for FBSDKLikeControlStyleStandard with |
| | | FBSDKLikeControlAuxiliaryPositionTop|Bottom. |
| | | */ |
| | | @property (nonatomic, assign) FBSDKLikeControlHorizontalAlignment likeControlHorizontalAlignment; |
| | | |
| | | /*! |
| | | @abstract The style to use for the receiver. |
| | | |
| | | @see FBSDKLikeControlStyle |
| | | */ |
| | | @property (nonatomic, assign) FBSDKLikeControlStyle likeControlStyle; |
| | | |
| | | /*! |
| | | @abstract The preferred maximum width (in points) for autolayout. |
| | | |
| | | @discussion This property affects the size of the receiver when layout constraints are applied to it. During layout, |
| | | if the text extends beyond the width specified by this property, the additional text is flowed to one or more new |
| | | lines, thereby increasing the height of the receiver. |
| | | */ |
| | | @property (nonatomic, assign) CGFloat preferredMaxLayoutWidth; |
| | | |
| | | /*! |
| | | @abstract If YES, a sound is played when the receiver is toggled. |
| | | |
| | | @default YES |
| | | */ |
| | | @property (nonatomic, assign, getter = isSoundEnabled) BOOL soundEnabled; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKMacros.h> |
| | | |
| | | /*! |
| | | @typedef NS_ENUM (NSUInteger, FBSDKLikeObjectType) |
| | | @abstract Specifies the type of object referenced by the objectID for likes. |
| | | */ |
| | | typedef NS_ENUM(NSUInteger, FBSDKLikeObjectType) |
| | | { |
| | | /*! The objectID refers to an unknown object type. */ |
| | | FBSDKLikeObjectTypeUnknown = 0, |
| | | /*! The objectID refers to an Open Graph object. */ |
| | | FBSDKLikeObjectTypeOpenGraph, |
| | | /*! The objectID refers to an Page object. */ |
| | | FBSDKLikeObjectTypePage, |
| | | }; |
| | | |
| | | /*! |
| | | @abstract Converts an FBLikeControlObjectType to an NSString. |
| | | */ |
| | | FBSDK_EXTERN NSString *NSStringFromFBSDKLikeObjectType(FBSDKLikeObjectType objectType); |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /*! |
| | | @abstract The common interface for components that initiate liking. |
| | | @see FBSDKLikeButton |
| | | @see FBSDKLikeControl |
| | | */ |
| | | @protocol FBSDKLiking <NSObject> |
| | | |
| | | /*! |
| | | @abstract The objectID for the object to like. |
| | | |
| | | @discussion This value may be an Open Graph object ID or a string representation of an URL that describes an |
| | | Open Graph object. The objects may be public objects, like pages, or objects that are defined by your application. |
| | | */ |
| | | @property (nonatomic, copy) NSString *objectID; |
| | | |
| | | /*! |
| | | @abstract The type of object referenced by the objectID. |
| | | |
| | | @discussion If the objectType is unknown, the control will determine the objectType by querying the server with the |
| | | objectID. Specifying a value for the objectType is an optimization that should be used if the type is known by the |
| | | consumer. Consider setting the objectType if it is known when setting the objectID. |
| | | */ |
| | | @property (nonatomic, assign) FBSDKLikeObjectType objectType; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKShareKit/FBSDKSharing.h> |
| | | |
| | | /*! |
| | | @abstract A dialog for sharing content through Messenger. |
| | | */ |
| | | @interface FBSDKMessageDialog : NSObject <FBSDKSharingDialog> |
| | | |
| | | /*! |
| | | @abstract Convenience method to show a Message Share Dialog with content and a delegate. |
| | | @param content The content to be shared. |
| | | @param delegate The receiver's delegate. |
| | | */ |
| | | + (instancetype)showWithContent:(id<FBSDKSharingContent>)content delegate:(id<FBSDKSharingDelegate>)delegate; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKButton.h> |
| | | |
| | | #import <FBSDKShareKit/FBSDKSharingButton.h> |
| | | |
| | | /*! |
| | | @abstract A button to send content through Messenger. |
| | | @discussion Tapping the receiver will invoke the FBSDKShareDialog with the attached shareContent. If the dialog cannot |
| | | be shown, the button will be disable. |
| | | */ |
| | | @interface FBSDKSendButton : FBSDKButton <FBSDKSharingButton> |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKShareKit/FBSDKShareOpenGraphObject.h> |
| | | #import <FBSDKShareKit/FBSDKSharing.h> |
| | | |
| | | /*! |
| | | @abstract A utility class for sharing through the graph API. Using this class requires an access token in |
| | | [FBSDKAccessToken currentAccessToken] that has been granted the "publish_actions" permission. |
| | | @discussion FBSDKShareAPI network requests are scheduled on the current run loop in the default run loop mode |
| | | (like NSURLConnection). If you want to use FBSDKShareAPI in a background thread, you must manage the run loop |
| | | yourself. |
| | | */ |
| | | @interface FBSDKShareAPI : NSObject <FBSDKSharing> |
| | | |
| | | /*! |
| | | @abstract Convenience method to build up a share API with content and a delegate. |
| | | @param content The content to be shared. |
| | | @param delegate The receiver's delegate. |
| | | */ |
| | | + (instancetype)shareWithContent:(id<FBSDKSharingContent>)content delegate:(id<FBSDKSharingDelegate>)delegate; |
| | | |
| | | /*! |
| | | @abstract The message the person has provided through the custom dialog that will accompany the share content. |
| | | */ |
| | | @property (nonatomic, copy) NSString *message; |
| | | |
| | | /*! |
| | | @abstract The graph node to which content should be shared. |
| | | */ |
| | | @property (nonatomic, copy) NSString *graphNode; |
| | | |
| | | /*! |
| | | @abstract A Boolean value that indicates whether the receiver can send the share. |
| | | @discussion May return NO if the appropriate Facebook app is not installed and is required or an access token is |
| | | required but not available. This method does not validate the content on the receiver, so this can be checked before |
| | | building up the content. |
| | | @see [FBSDKSharing validateWithError:] |
| | | @result YES if the receiver can send, otherwise NO. |
| | | */ |
| | | - (BOOL)canShare; |
| | | |
| | | /*! |
| | | @abstract Creates an User Owned Open Graph object without an action. |
| | | @param openGraphObject The open graph object to create. |
| | | @discussion Use this method to create an object alone, when an action is not going to be posted with the object. If |
| | | the object will be used within an action, just put the object in the action and share that as the shareContent and the |
| | | object will be created in the process. The delegate will be messaged with the results. |
| | | |
| | | Also see https://developers.facebook.com/docs/sharing/opengraph/object-api#objectapi-creatinguser |
| | | |
| | | @result YES if the receiver was able to send the request to create the object, otherwise NO. |
| | | */ |
| | | - (BOOL)createOpenGraphObject:(FBSDKShareOpenGraphObject *)openGraphObject; |
| | | |
| | | /*! |
| | | @abstract Begins the send from the receiver. |
| | | @result YES if the receiver was able to send the share, otherwise NO. |
| | | */ |
| | | - (BOOL)share; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKButton.h> |
| | | |
| | | #import <FBSDKShareKit/FBSDKSharingButton.h> |
| | | |
| | | /*! |
| | | @abstract A button to share content. |
| | | @discussion Tapping the receiver will invoke the FBSDKShareDialog with the attached shareContent. If the dialog cannot |
| | | be shown, the button will be disabled. |
| | | */ |
| | | @interface FBSDKShareButton : FBSDKButton <FBSDKSharingButton> |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKMacros.h> |
| | | |
| | | /*! |
| | | @abstract The error domain for all errors from FBSDKShareKit. |
| | | @discussion Error codes from the SDK in the range 200-299 are reserved for this domain. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKShareErrorDomain; |
| | | |
| | | /*! |
| | | @typedef NS_ENUM(NSInteger, FBSDKShareErrorCode) |
| | | @abstract Error codes for FBSDKShareErrorDomain. |
| | | */ |
| | | typedef NS_ENUM(NSInteger, FBSDKShareErrorCode) |
| | | { |
| | | /*! |
| | | @abstract Reserved. |
| | | */ |
| | | FBSDKShareReservedErrorCode = 200, |
| | | |
| | | /*! |
| | | @abstract The error code for errors from uploading open graph objects. |
| | | */ |
| | | FBSDKShareOpenGraphErrorCode, |
| | | |
| | | /*! |
| | | @abstract The error code for when a sharing dialog is not available. |
| | | @discussion Use the canShare methods to check for this case before calling show. |
| | | */ |
| | | FBSDKShareDialogNotAvailableErrorCode, |
| | | |
| | | /*! |
| | | @The error code for unknown errors. |
| | | */ |
| | | FBSDKShareUnknownErrorCode, |
| | | }; |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | #import <FBSDKShareKit/FBSDKShareDialogMode.h> |
| | | #import <FBSDKShareKit/FBSDKSharing.h> |
| | | #import <FBSDKShareKit/FBSDKSharingContent.h> |
| | | |
| | | /*! |
| | | @abstract A dialog for sharing content on Facebook. |
| | | */ |
| | | @interface FBSDKShareDialog : NSObject <FBSDKSharingDialog> |
| | | |
| | | /*! |
| | | @abstract Convenience method to show an FBSDKShareDialog with a fromViewController, content and a delegate. |
| | | @param viewController A UIViewController to present the dialog from, if appropriate. |
| | | @param content The content to be shared. |
| | | @param delegate The receiver's delegate. |
| | | */ |
| | | + (instancetype)showFromViewController:(UIViewController *)viewController |
| | | withContent:(id<FBSDKSharingContent>)content |
| | | delegate:(id<FBSDKSharingDelegate>)delegate; |
| | | |
| | | /*! |
| | | @abstract A UIViewController to present the dialog from. |
| | | @discussion If not specified, the top most view controller will be automatically determined as best as possible. |
| | | */ |
| | | @property (nonatomic, weak) UIViewController *fromViewController; |
| | | |
| | | /*! |
| | | @abstract The mode with which to display the dialog. |
| | | @discussion Defaults to FBSDKShareDialogModeAutomatic, which will automatically choose the best available mode. |
| | | */ |
| | | @property (nonatomic, assign) FBSDKShareDialogMode mode; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKMacros.h> |
| | | |
| | | /*! |
| | | @typedef NS_ENUM(NSUInteger, FBSDKShareDialogMode) |
| | | @abstract Modes for the FBSDKShareDialog. |
| | | @discussion The automatic mode will progressively check the availability of different modes and open the most |
| | | appropriate mode for the dialog that is available. |
| | | */ |
| | | typedef NS_ENUM(NSUInteger, FBSDKShareDialogMode) |
| | | { |
| | | /*! |
| | | @abstract Acts with the most appropriate mode that is available. |
| | | */ |
| | | FBSDKShareDialogModeAutomatic = 0, |
| | | /*! |
| | | @Displays the dialog in the main native Facebook app. |
| | | */ |
| | | FBSDKShareDialogModeNative, |
| | | /*! |
| | | @Displays the dialog in the iOS integrated share sheet. |
| | | */ |
| | | FBSDKShareDialogModeShareSheet, |
| | | /*! |
| | | @Displays the dialog in Safari. |
| | | */ |
| | | FBSDKShareDialogModeBrowser, |
| | | /*! |
| | | @Displays the dialog in a UIWebView within the app. |
| | | */ |
| | | FBSDKShareDialogModeWeb, |
| | | /*! |
| | | @Displays the feed dialog in Safari. |
| | | */ |
| | | FBSDKShareDialogModeFeedBrowser, |
| | | /*! |
| | | @Displays the feed dialog in a UIWebView within the app. |
| | | */ |
| | | FBSDKShareDialogModeFeedWeb, |
| | | }; |
| | | |
| | | /*! |
| | | @abstract Converts an FBLikeControlObjectType to an NSString. |
| | | */ |
| | | FBSDK_EXTERN NSString *NSStringFromFBSDKShareDialogMode(FBSDKShareDialogMode dialogMode); |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | #import <FBSDKShareKit/FBSDKHashtag.h> |
| | | #import <FBSDKShareKit/FBSDKShareAPI.h> |
| | | #import <FBSDKShareKit/FBSDKShareConstants.h> |
| | | #import <FBSDKShareKit/FBSDKShareLinkContent.h> |
| | | #import <FBSDKShareKit/FBSDKShareOpenGraphAction.h> |
| | | #import <FBSDKShareKit/FBSDKShareOpenGraphContent.h> |
| | | #import <FBSDKShareKit/FBSDKShareOpenGraphObject.h> |
| | | #import <FBSDKShareKit/FBSDKSharePhoto.h> |
| | | #import <FBSDKShareKit/FBSDKSharePhotoContent.h> |
| | | #import <FBSDKShareKit/FBSDKShareVideo.h> |
| | | #import <FBSDKShareKit/FBSDKShareVideoContent.h> |
| | | #import <FBSDKShareKit/FBSDKSharing.h> |
| | | #import <FBSDKShareKit/FBSDKSharingContent.h> |
| | | |
| | | #if !TARGET_OS_TV |
| | | #import <FBSDKShareKit/FBSDKAppGroupAddDialog.h> |
| | | #import <FBSDKShareKit/FBSDKAppGroupContent.h> |
| | | #import <FBSDKShareKit/FBSDKAppGroupJoinDialog.h> |
| | | #import <FBSDKShareKit/FBSDKAppInviteContent.h> |
| | | #import <FBSDKShareKit/FBSDKAppInviteDialog.h> |
| | | #import <FBSDKShareKit/FBSDKGameRequestContent.h> |
| | | #import <FBSDKShareKit/FBSDKGameRequestDialog.h> |
| | | #import <FBSDKShareKit/FBSDKLikeButton.h> |
| | | #import <FBSDKShareKit/FBSDKLikeControl.h> |
| | | #import <FBSDKShareKit/FBSDKLikeObjectType.h> |
| | | #import <FBSDKShareKit/FBSDKMessageDialog.h> |
| | | #import <FBSDKShareKit/FBSDKShareButton.h> |
| | | #import <FBSDKShareKit/FBSDKShareDialog.h> |
| | | #import <FBSDKShareKit/FBSDKShareDialogMode.h> |
| | | #import <FBSDKShareKit/FBSDKShareMediaContent.h> |
| | | #import <FBSDKShareKit/FBSDKSendButton.h> |
| | | #else |
| | | #import <FBSDKShareKit/FBSDKDeviceShareViewController.h> |
| | | #import <FBSDKShareKit/FBSDKDeviceShareButton.h> |
| | | #endif |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKShareKit/FBSDKSharingContent.h> |
| | | |
| | | /*! |
| | | @abstract A model for status and link content to be shared. |
| | | */ |
| | | @interface FBSDKShareLinkContent : NSObject <FBSDKSharingContent> |
| | | |
| | | /*! |
| | | @abstract The description of the link. |
| | | @discussion If not specified, this field is automatically populated by information scraped from the contentURL, |
| | | typically the title of the page. This value may be discarded for specially handled links (ex: iTunes URLs). |
| | | @return The description of the link |
| | | */ |
| | | @property (nonatomic, copy) NSString *contentDescription; |
| | | |
| | | /*! |
| | | @abstract The title to display for this link. |
| | | @discussion This value may be discarded for specially handled links (ex: iTunes URLs). |
| | | @return The link title |
| | | */ |
| | | @property (nonatomic, copy) NSString *contentTitle; |
| | | |
| | | /*! |
| | | @abstract The URL of a picture to attach to this content. |
| | | @return The network URL of an image |
| | | */ |
| | | @property (nonatomic, copy) NSURL *imageURL; |
| | | |
| | | /*! |
| | | @abstract Some quote text of the link. |
| | | @discussion If specified, the quote text will render with custom styling on top of the link. |
| | | @return The quote text of a link |
| | | */ |
| | | @property (nonatomic, copy) NSString *quote; |
| | | |
| | | /*! |
| | | @abstract Compares the receiver to another link content. |
| | | @param content The other content |
| | | @return YES if the receiver's values are equal to the other content's values; otherwise NO |
| | | */ |
| | | - (BOOL)isEqualToShareLinkContent:(FBSDKShareLinkContent *)content; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKShareKit/FBSDKSharingContent.h> |
| | | |
| | | /*! |
| | | @abstract A model for media content (photo or video) to be shared. |
| | | */ |
| | | @interface FBSDKShareMediaContent : NSObject <FBSDKSharingContent> |
| | | |
| | | /*! |
| | | @abstract Media to be shared. |
| | | @return Array of the media (FBSDKSharePhoto or FBSDKShareVideo) |
| | | */ |
| | | @property (nonatomic, copy) NSArray *media; |
| | | |
| | | /*! |
| | | @abstract Compares the receiver to another media content. |
| | | @param content The other content |
| | | @return YES if the receiver's values are equal to the other content's values; otherwise NO |
| | | */ |
| | | - (BOOL)isEqualToShareMediaContent:(FBSDKShareMediaContent *)content; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKCopying.h> |
| | | |
| | | #import <FBSDKShareKit/FBSDKShareOpenGraphObject.h> |
| | | #import <FBSDKShareKit/FBSDKShareOpenGraphValueContainer.h> |
| | | |
| | | /*! |
| | | @abstract An Open Graph Action for sharing. |
| | | @discussion The property keys MUST have namespaces specified on them, such as `og:image`. |
| | | */ |
| | | @interface FBSDKShareOpenGraphAction : FBSDKShareOpenGraphValueContainer <FBSDKCopying, NSSecureCoding> |
| | | |
| | | /*! |
| | | @abstract Convenience method to build a new action and set the object for the specified key. |
| | | @param actionType The action type of the receiver |
| | | @param object The Open Graph object represented by this action |
| | | @param key The key for the object |
| | | */ |
| | | + (instancetype)actionWithType:(NSString *)actionType object:(FBSDKShareOpenGraphObject *)object key:(NSString *)key; |
| | | |
| | | /*! |
| | | @abstract Convenience method to build a new action and set the object for the specified key. |
| | | @param actionType The action type of the receiver |
| | | @param objectID The ID of an existing Open Graph object |
| | | @param key The key for the object |
| | | */ |
| | | + (instancetype)actionWithType:(NSString *)actionType objectID:(NSString *)objectID key:(NSString *)key; |
| | | |
| | | /*! |
| | | @abstract Convenience method to build a new action and set the object for the specified key. |
| | | @param actionType The action type of the receiver |
| | | @param objectURL The URL to a page that defines the Open Graph object with meta tags |
| | | @param key The key for the object |
| | | */ |
| | | + (instancetype)actionWithType:(NSString *)actionType objectURL:(NSURL *)objectURL key:(NSString *)key; |
| | | |
| | | /*! |
| | | @abstract Gets the action type. |
| | | @return The action type |
| | | */ |
| | | @property (nonatomic, copy) NSString *actionType; |
| | | |
| | | /*! |
| | | @abstract Compares the receiver to another Open Graph Action. |
| | | @param action The other action |
| | | @return YES if the receiver's values are equal to the other action's values; otherwise NO |
| | | */ |
| | | - (BOOL)isEqualToShareOpenGraphAction:(FBSDKShareOpenGraphAction *)action; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKShareKit/FBSDKShareOpenGraphAction.h> |
| | | #import <FBSDKShareKit/FBSDKSharingContent.h> |
| | | |
| | | /*! |
| | | @abstract A model for Open Graph content to be shared. |
| | | */ |
| | | @interface FBSDKShareOpenGraphContent : NSObject <FBSDKSharingContent> |
| | | |
| | | /*! |
| | | @abstract Open Graph Action to be shared. |
| | | @return The action |
| | | */ |
| | | @property (nonatomic, copy) FBSDKShareOpenGraphAction *action; |
| | | |
| | | /*! |
| | | @abstract Property name that points to the primary Open Graph Object in the action. |
| | | @discussion The value that this action points to will be use for rendering the preview for the share. |
| | | @return The property name for the Open Graph Object in the action |
| | | */ |
| | | @property (nonatomic, copy) NSString *previewPropertyName; |
| | | |
| | | /*! |
| | | @abstract Compares the receiver to another Open Graph content. |
| | | @param content The other content |
| | | @return YES if the receiver's values are equal to the other content's values; otherwise NO |
| | | */ |
| | | - (BOOL)isEqualToShareOpenGraphContent:(FBSDKShareOpenGraphContent *)content; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKCopying.h> |
| | | |
| | | #import <FBSDKShareKit/FBSDKShareOpenGraphValueContainer.h> |
| | | |
| | | /*! |
| | | @abstract An Open Graph Object for sharing. |
| | | @discussion The property keys MUST have namespaces specified on them, such as `og:image`, |
| | | and `og:type` is required. |
| | | |
| | | See https://developers.facebook.com/docs/sharing/opengraph/object-properties for other properties. |
| | | |
| | | You can specify nested namespaces inline to define complex properties. For example, the following |
| | | code will generate a fitness.course object with a location: |
| | | |
| | | FBSDKShareOpenGraphObject *course = [FBSDKShareOpenGraphObject objectWithProperties: |
| | | @{ |
| | | @"og:type": @"fitness.course", |
| | | @"og:title": @"Sample course", |
| | | @"fitness:metrics:location:latitude": @"41.40338", |
| | | @"fitness:metrics:location:longitude": @"2.17403", |
| | | }]; |
| | | */ |
| | | @interface FBSDKShareOpenGraphObject : FBSDKShareOpenGraphValueContainer <FBSDKCopying, NSSecureCoding> |
| | | |
| | | /*! |
| | | @abstract Convenience method to build a new action and set the object for the specified key. |
| | | @param properties Properties for the Open Graph object, which will be parsed into the proper models |
| | | */ |
| | | + (instancetype)objectWithProperties:(NSDictionary *)properties; |
| | | |
| | | /*! |
| | | @abstract Compares the receiver to another Open Graph Object. |
| | | @param object The other object |
| | | @return YES if the receiver's values are equal to the other object's values; otherwise NO |
| | | */ |
| | | - (BOOL)isEqualToShareOpenGraphObject:(FBSDKShareOpenGraphObject *)object; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | @class FBSDKShareOpenGraphObject; |
| | | @class FBSDKSharePhoto; |
| | | |
| | | /*! |
| | | @abstract Protocol defining operations on open graph actions and objects. |
| | | @discussion The property keys MUST have namespaces specified on them, such as `og:image`. |
| | | */ |
| | | @protocol FBSDKShareOpenGraphValueContaining <NSObject, NSSecureCoding> |
| | | |
| | | /*! |
| | | @abstract Gets an NSArray out of the receiver. |
| | | @param key The key for the value |
| | | @return The NSArray value or nil |
| | | */ |
| | | - (NSArray *)arrayForKey:(NSString *)key; |
| | | |
| | | /*! |
| | | @abstract Applies a given block object to the entries of the receiver. |
| | | @param block A block object to operate on entries in the receiver |
| | | */ |
| | | - (void)enumerateKeysAndObjectsUsingBlock:(void (^)(NSString *key, id object, BOOL *stop))block; |
| | | |
| | | /*! |
| | | @abstract Returns an enumerator object that lets you access each key in the receiver. |
| | | @return An enumerator object that lets you access each key in the receiver |
| | | */ |
| | | - (NSEnumerator *)keyEnumerator; |
| | | |
| | | /*! |
| | | @abstract Gets an NSNumber out of the receiver. |
| | | @param key The key for the value |
| | | @return The NSNumber value or nil |
| | | */ |
| | | - (NSNumber *)numberForKey:(NSString *)key; |
| | | |
| | | /*! |
| | | @abstract Returns an enumerator object that lets you access each value in the receiver. |
| | | @return An enumerator object that lets you access each value in the receiver |
| | | */ |
| | | - (NSEnumerator *)objectEnumerator; |
| | | |
| | | /*! |
| | | @abstract Gets an FBSDKShareOpenGraphObject out of the receiver. |
| | | @param key The key for the value |
| | | @return The FBSDKShareOpenGraphObject value or nil |
| | | */ |
| | | - (FBSDKShareOpenGraphObject *)objectForKey:(NSString *)key; |
| | | |
| | | /*! |
| | | @abstract Enables subscript access to the values in the receiver. |
| | | @param key The key for the value |
| | | @return The value |
| | | */ |
| | | - (id)objectForKeyedSubscript:(NSString *)key; |
| | | |
| | | /*! |
| | | @abstract Parses properties out of a dictionary into the receiver. |
| | | @param properties The properties to parse. |
| | | */ |
| | | - (void)parseProperties:(NSDictionary *)properties; |
| | | |
| | | /*! |
| | | @abstract Gets an FBSDKSharePhoto out of the receiver. |
| | | @param key The key for the value |
| | | @return The FBSDKSharePhoto value or nil |
| | | */ |
| | | - (FBSDKSharePhoto *)photoForKey:(NSString *)key; |
| | | |
| | | /*! |
| | | @abstract Removes a value from the receiver for the specified key. |
| | | @param key The key for the value |
| | | */ |
| | | - (void)removeObjectForKey:(NSString *)key; |
| | | |
| | | /*! |
| | | @abstract Sets an NSArray on the receiver. |
| | | @discussion This method will throw if the array contains any values that is not an NSNumber, NSString, NSURL, |
| | | FBSDKSharePhoto or FBSDKShareOpenGraphObject. |
| | | @param array The NSArray value |
| | | @param key The key for the value |
| | | */ |
| | | - (void)setArray:(NSArray *)array forKey:(NSString *)key; |
| | | |
| | | /*! |
| | | @abstract Sets an NSNumber on the receiver. |
| | | @param number The NSNumber value |
| | | @param key The key for the value |
| | | */ |
| | | - (void)setNumber:(NSNumber *)number forKey:(NSString *)key; |
| | | |
| | | /*! |
| | | @abstract Sets an FBSDKShareOpenGraphObject on the receiver. |
| | | @param object The FBSDKShareOpenGraphObject value |
| | | @param key The key for the value |
| | | */ |
| | | - (void)setObject:(FBSDKShareOpenGraphObject *)object forKey:(NSString *)key; |
| | | |
| | | /*! |
| | | @abstract Sets an FBSDKSharePhoto on the receiver. |
| | | @param photo The FBSDKSharePhoto value |
| | | @param key The key for the value |
| | | */ |
| | | - (void)setPhoto:(FBSDKSharePhoto *)photo forKey:(NSString *)key; |
| | | |
| | | /*! |
| | | @abstract Sets an NSString on the receiver. |
| | | @param string The NSString value |
| | | @param key The key for the value |
| | | */ |
| | | - (void)setString:(NSString *)string forKey:(NSString *)key; |
| | | |
| | | /*! |
| | | @abstract Sets an NSURL on the receiver. |
| | | @param URL The NSURL value |
| | | @param key The key for the value |
| | | */ |
| | | - (void)setURL:(NSURL *)URL forKey:(NSString *)key; |
| | | |
| | | /*! |
| | | @abstract Gets an NSString out of the receiver. |
| | | @param key The key for the value |
| | | @return The NSString value or nil |
| | | */ |
| | | - (NSString *)stringForKey:(NSString *)key; |
| | | |
| | | /*! |
| | | @abstract Gets an NSURL out of the receiver. |
| | | @param key The key for the value |
| | | @return The NSURL value or nil |
| | | */ |
| | | - (NSURL *)URLForKey:(NSString *)key; |
| | | |
| | | @end |
| | | |
| | | /*! |
| | | @abstract A base class to container Open Graph values. |
| | | */ |
| | | @interface FBSDKShareOpenGraphValueContainer : NSObject <FBSDKShareOpenGraphValueContaining> |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKCopying.h> |
| | | |
| | | /*! |
| | | @abstract A photo for sharing. |
| | | */ |
| | | @interface FBSDKSharePhoto : NSObject <FBSDKCopying, NSSecureCoding> |
| | | |
| | | /*! |
| | | @abstract Convenience method to build a new photo object with an image. |
| | | @param image If the photo is resident in memory, this method supplies the data |
| | | @param userGenerated Specifies whether the photo represented by the receiver was generated by the user or by the |
| | | application |
| | | */ |
| | | + (instancetype)photoWithImage:(UIImage *)image userGenerated:(BOOL)userGenerated; |
| | | |
| | | /*! |
| | | @abstract Convenience method to build a new photo object with an imageURL. |
| | | @param imageURL The URL to the photo |
| | | @param userGenerated Specifies whether the photo represented by the receiver was generated by the user or by the |
| | | application |
| | | @discussion This method should only be used when adding photo content to open graph stories. |
| | | For example, if you're trying to share a photo from the web by itself, download the image and use |
| | | `photoWithImage:userGenerated:` instead. |
| | | */ |
| | | + (instancetype)photoWithImageURL:(NSURL *)imageURL userGenerated:(BOOL)userGenerated; |
| | | |
| | | /*! |
| | | @abstract If the photo is resident in memory, this method supplies the data. |
| | | @return UIImage representation of the photo |
| | | */ |
| | | @property (nonatomic, strong) UIImage *image; |
| | | |
| | | /*! |
| | | @abstract The URL to the photo. |
| | | @return URL that points to a network location or the location of the photo on disk |
| | | */ |
| | | @property (nonatomic, copy) NSURL *imageURL; |
| | | |
| | | /*! |
| | | @abstract Specifies whether the photo represented by the receiver was generated by the user or by the application. |
| | | @return YES if the photo is user-generated, otherwise NO |
| | | */ |
| | | @property (nonatomic, assign, getter=isUserGenerated) BOOL userGenerated; |
| | | |
| | | /*! |
| | | @abstract Compares the receiver to another photo. |
| | | @param photo The other photo |
| | | @return YES if the receiver's values are equal to the other photo's values; otherwise NO |
| | | */ |
| | | - (BOOL)isEqualToSharePhoto:(FBSDKSharePhoto *)photo; |
| | | |
| | | /*! |
| | | @abstract The user generated caption for the photo. Note that the 'caption' must come from |
| | | * the user, as pre-filled content is forbidden by the Platform Policies (2.3). |
| | | @return the Photo's caption if exists else returns null. |
| | | */ |
| | | @property (nonatomic, copy) NSString *caption; |
| | | |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKShareKit/FBSDKSharingContent.h> |
| | | |
| | | /*! |
| | | @abstract A model for photo content to be shared. |
| | | */ |
| | | @interface FBSDKSharePhotoContent : NSObject <FBSDKSharingContent> |
| | | |
| | | /*! |
| | | @abstract Photos to be shared. |
| | | @return Array of the photos (FBSDKSharePhoto) |
| | | */ |
| | | @property (nonatomic, copy) NSArray *photos; |
| | | |
| | | /*! |
| | | @abstract Compares the receiver to another photo content. |
| | | @param content The other content |
| | | @return YES if the receiver's values are equal to the other content's values; otherwise NO |
| | | */ |
| | | - (BOOL)isEqualToSharePhotoContent:(FBSDKSharePhotoContent *)content; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKCopying.h> |
| | | |
| | | @class FBSDKSharePhoto; |
| | | |
| | | /*! |
| | | @abstract A video for sharing. |
| | | */ |
| | | @interface FBSDKShareVideo : NSObject <FBSDKCopying, NSSecureCoding> |
| | | |
| | | /*! |
| | | @abstract Convenience method to build a new video object with a videoURL. |
| | | @param videoURL The URL to the video |
| | | */ |
| | | + (instancetype)videoWithVideoURL:(NSURL *)videoURL; |
| | | |
| | | /*! |
| | | @abstract Convenience method to build a new video object with a videoURL and a previewPhoto |
| | | @param videoURL The URL to the video |
| | | @param previewPhoto The photo that represents the video |
| | | */ |
| | | + (instancetype)videoWithVideoURL:(NSURL *)videoURL previewPhoto:(FBSDKSharePhoto *)previewPhoto; |
| | | |
| | | /*! |
| | | @abstract The file URL to the video. |
| | | @return URL that points to the location of the video on disk |
| | | */ |
| | | @property (nonatomic, copy) NSURL *videoURL; |
| | | |
| | | /*! |
| | | @abstract The photo that represents the video. |
| | | @return The photo |
| | | */ |
| | | @property (nonatomic, copy) FBSDKSharePhoto *previewPhoto; |
| | | |
| | | /*! |
| | | @abstract Compares the receiver to another video. |
| | | @param video The other video |
| | | @return YES if the receiver's values are equal to the other video's values; otherwise NO |
| | | */ |
| | | - (BOOL)isEqualToShareVideo:(FBSDKShareVideo *)video; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKShareKit/FBSDKSharePhoto.h> |
| | | #import <FBSDKShareKit/FBSDKShareVideo.h> |
| | | #import <FBSDKShareKit/FBSDKSharingContent.h> |
| | | |
| | | /*! |
| | | @abstract A model for video content to be shared. |
| | | */ |
| | | @interface FBSDKShareVideoContent : NSObject <FBSDKSharingContent> |
| | | |
| | | /*! |
| | | @abstract The photo that represents the video. |
| | | @return The photo |
| | | */ |
| | | @property (nonatomic, copy) FBSDKSharePhoto *previewPhoto; |
| | | |
| | | /*! |
| | | @abstract The video to be shared. |
| | | @return The video |
| | | */ |
| | | @property (nonatomic, copy) FBSDKShareVideo *video; |
| | | |
| | | /*! |
| | | @abstract Compares the receiver to another video content. |
| | | @param content The other content |
| | | @return YES if the receiver's values are equal to the other content's values; otherwise NO |
| | | */ |
| | | - (BOOL)isEqualToShareVideoContent:(FBSDKShareVideoContent *)content; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKShareKit/FBSDKSharingContent.h> |
| | | |
| | | @protocol FBSDKSharingDelegate; |
| | | |
| | | /*! |
| | | @abstract The common interface for components that initiate sharing. |
| | | @see FBSDKShareDialog |
| | | @see FBSDKMessageDialog |
| | | @see FBSDKShareAPI |
| | | */ |
| | | @protocol FBSDKSharing <NSObject> |
| | | |
| | | /*! |
| | | @abstract The receiver's delegate or nil if it doesn't have a delegate. |
| | | */ |
| | | @property (nonatomic, weak) id<FBSDKSharingDelegate> delegate; |
| | | |
| | | /*! |
| | | @abstract The content to be shared. |
| | | */ |
| | | @property (nonatomic, copy) id<FBSDKSharingContent> shareContent; |
| | | |
| | | /*! |
| | | @abstract A Boolean value that indicates whether the receiver should fail if it finds an error with the share content. |
| | | @discussion If NO, the sharer will still be displayed without the data that was mis-configured. For example, an |
| | | invalid placeID specified on the shareContent would produce a data error. |
| | | */ |
| | | @property (nonatomic, assign) BOOL shouldFailOnDataError; |
| | | |
| | | /*! |
| | | @abstract Validates the content on the receiver. |
| | | @param errorRef If an error occurs, upon return contains an NSError object that describes the problem. |
| | | @return YES if the content is valid, otherwise NO. |
| | | */ |
| | | - (BOOL)validateWithError:(NSError **)errorRef; |
| | | |
| | | @end |
| | | |
| | | /*! |
| | | @abstract The common interface for dialogs that initiate sharing. |
| | | */ |
| | | @protocol FBSDKSharingDialog <FBSDKSharing> |
| | | |
| | | /*! |
| | | @abstract A Boolean value that indicates whether the receiver can initiate a share. |
| | | @discussion May return NO if the appropriate Facebook app is not installed and is required or an access token is |
| | | required but not available. This method does not validate the content on the receiver, so this can be checked before |
| | | building up the content. |
| | | @see [FBSDKSharing validateWithError:] |
| | | @result YES if the receiver can share, otherwise NO. |
| | | */ |
| | | - (BOOL)canShow; |
| | | |
| | | /*! |
| | | @abstract Shows the dialog. |
| | | @result YES if the receiver was able to begin sharing, otherwise NO. |
| | | */ |
| | | - (BOOL)show; |
| | | |
| | | @end |
| | | |
| | | /*! |
| | | @abstract A delegate for FBSDKSharing. |
| | | @discussion The delegate is notified with the results of the sharer as long as the application has permissions to |
| | | receive the information. For example, if the person is not signed into the containing app, the sharer may not be able |
| | | to distinguish between completion of a share and cancellation. |
| | | */ |
| | | @protocol FBSDKSharingDelegate <NSObject> |
| | | |
| | | /*! |
| | | @abstract Sent to the delegate when the share completes without error or cancellation. |
| | | @param sharer The FBSDKSharing that completed. |
| | | @param results The results from the sharer. This may be nil or empty. |
| | | */ |
| | | - (void)sharer:(id<FBSDKSharing>)sharer didCompleteWithResults:(NSDictionary *)results; |
| | | |
| | | /*! |
| | | @abstract Sent to the delegate when the sharer encounters an error. |
| | | @param sharer The FBSDKSharing that completed. |
| | | @param error The error. |
| | | */ |
| | | - (void)sharer:(id<FBSDKSharing>)sharer didFailWithError:(NSError *)error; |
| | | |
| | | /*! |
| | | @abstract Sent to the delegate when the sharer is cancelled. |
| | | @param sharer The FBSDKSharing that completed. |
| | | */ |
| | | - (void)sharerDidCancel:(id<FBSDKSharing>)sharer; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKShareKit/FBSDKSharingContent.h> |
| | | |
| | | /*! |
| | | @abstract The common interface for sharing buttons. |
| | | @see FBSDKSendButton |
| | | @see FBSDKShareButton |
| | | */ |
| | | @protocol FBSDKSharingButton <NSObject> |
| | | |
| | | /*! |
| | | @abstract The content to be shared. |
| | | */ |
| | | @property (nonatomic, copy) id<FBSDKSharingContent> shareContent; |
| | | |
| | | @end |
New file |
| | |
| | | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
| | | // |
| | | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
| | | // copy, modify, and distribute this software in source code or binary form for use |
| | | // in connection with the web services and APIs provided by Facebook. |
| | | // |
| | | // As with any software that integrates with the Facebook platform, your use of |
| | | // this software is subject to the Facebook Developer Principles and Policies |
| | | // [http://developers.facebook.com/policy/]. This copyright notice shall be |
| | | // included in all copies or substantial portions of the software. |
| | | // |
| | | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKCopying.h> |
| | | |
| | | @class FBSDKHashtag; |
| | | |
| | | /*! |
| | | @abstract A base interface for content to be shared. |
| | | */ |
| | | @protocol FBSDKSharingContent <FBSDKCopying, NSSecureCoding> |
| | | |
| | | /*! |
| | | @abstract URL for the content being shared. |
| | | @discussion This URL will be checked for all link meta tags for linking in platform specific ways. See documentation |
| | | for App Links (https://developers.facebook.com/docs/applinks/) |
| | | @return URL representation of the content link |
| | | */ |
| | | @property (nonatomic, copy) NSURL *contentURL; |
| | | |
| | | /*! |
| | | @abstract Hashtag for the content being shared. |
| | | @return The hashtag for the content being shared. |
| | | */ |
| | | @property (nonatomic, copy) FBSDKHashtag *hashtag; |
| | | |
| | | /*! |
| | | @abstract List of IDs for taggable people to tag with this content. |
| | | @description See documentation for Taggable Friends |
| | | (https://developers.facebook.com/docs/graph-api/reference/user/taggable_friends) |
| | | @return Array of IDs for people to tag (NSString) |
| | | */ |
| | | @property (nonatomic, copy) NSArray *peopleIDs; |
| | | |
| | | /*! |
| | | @abstract The ID for a place to tag with this content. |
| | | @return The ID for the place to tag |
| | | */ |
| | | @property (nonatomic, copy) NSString *placeID; |
| | | |
| | | /*! |
| | | @abstract A value to be added to the referrer URL when a person follows a link from this shared content on feed. |
| | | @return The ref for the content. |
| | | */ |
| | | @property (nonatomic, copy) NSString *ref; |
| | | |
| | | @end |
New file |
| | |
| | | framework module FBSDKShareKit { |
| | | umbrella header "FBSDKShareKit.h" |
| | | |
| | | export * |
| | | module * { export * } |
| | | } |
New file |
| | |
| | | // |
| | | // WAFbImpl.h |
| | | // WAFbImpl |
| | | // |
| | | // Created by GHW-T-01 on 16/3/1. |
| | | // Copyright © 2016年 GHW-T-01. All rights reserved. |
| | | // |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | //! Project version number for WAFbImpl. |
| | | FOUNDATION_EXPORT double WAFbImplVersionNumber; |
| | | |
| | | //! Project version string for WAFbImpl. |
| | | FOUNDATION_EXPORT const unsigned char WAFbImplVersionString[]; |
| | | |
| | | // In this header, you should import all the public headers of your framework using statements like #import <WAFbImpl/PublicHeader.h> |
| | | |
| | | //time:2016/11/29 15:41 |
New file |
| | |
| | | framework module WAFbImpl { |
| | | umbrella header "WAFbImpl.h" |
| | | |
| | | export * |
| | | module * { export * } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
| | | <plist version="1.0"> |
| | | <dict> |
| | | <key>files</key> |
| | | <dict> |
| | | <key>Headers/WAFbImpl.h</key> |
| | | <data> |
| | | m/LeZtlEuX5lNPKwxg1W/Pg6e7c= |
| | | </data> |
| | | <key>Info.plist</key> |
| | | <data> |
| | | 2UKAls9uDNRDELR1XmqvHww+gpM= |
| | | </data> |
| | | <key>Modules/module.modulemap</key> |
| | | <data> |
| | | aluEAfoepN7iG0XAQ2K460rYr48= |
| | | </data> |
| | | </dict> |
| | | <key>files2</key> |
| | | <dict> |
| | | <key>Headers/WAFbImpl.h</key> |
| | | <data> |
| | | m/LeZtlEuX5lNPKwxg1W/Pg6e7c= |
| | | </data> |
| | | <key>Modules/module.modulemap</key> |
| | | <data> |
| | | aluEAfoepN7iG0XAQ2K460rYr48= |
| | | </data> |
| | | </dict> |
| | | <key>rules</key> |
| | | <dict> |
| | | <key>^</key> |
| | | <true/> |
| | | <key>^.*\.lproj/</key> |
| | | <dict> |
| | | <key>optional</key> |
| | | <true/> |
| | | <key>weight</key> |
| | | <real>1000</real> |
| | | </dict> |
| | | <key>^.*\.lproj/locversion.plist$</key> |
| | | <dict> |
| | | <key>omit</key> |
| | | <true/> |
| | | <key>weight</key> |
| | | <real>1100</real> |
| | | </dict> |
| | | <key>^version.plist$</key> |
| | | <true/> |
| | | </dict> |
| | | <key>rules2</key> |
| | | <dict> |
| | | <key>.*\.dSYM($|/)</key> |
| | | <dict> |
| | | <key>weight</key> |
| | | <real>11</real> |
| | | </dict> |
| | | <key>^</key> |
| | | <dict> |
| | | <key>weight</key> |
| | | <real>20</real> |
| | | </dict> |
| | | <key>^(.*/)?\.DS_Store$</key> |
| | | <dict> |
| | | <key>omit</key> |
| | | <true/> |
| | | <key>weight</key> |
| | | <real>2000</real> |
| | | </dict> |
| | | <key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key> |
| | | <dict> |
| | | <key>nested</key> |
| | | <true/> |
| | | <key>weight</key> |
| | | <real>10</real> |
| | | </dict> |
| | | <key>^.*</key> |
| | | <true/> |
| | | <key>^.*\.lproj/</key> |
| | | <dict> |
| | | <key>optional</key> |
| | | <true/> |
| | | <key>weight</key> |
| | | <real>1000</real> |
| | | </dict> |
| | | <key>^.*\.lproj/locversion.plist$</key> |
| | | <dict> |
| | | <key>omit</key> |
| | | <true/> |
| | | <key>weight</key> |
| | | <real>1100</real> |
| | | </dict> |
| | | <key>^Info\.plist$</key> |
| | | <dict> |
| | | <key>omit</key> |
| | | <true/> |
| | | <key>weight</key> |
| | | <real>20</real> |
| | | </dict> |
| | | <key>^PkgInfo$</key> |
| | | <dict> |
| | | <key>omit</key> |
| | | <true/> |
| | | <key>weight</key> |
| | | <real>20</real> |
| | | </dict> |
| | | <key>^[^/]+$</key> |
| | | <dict> |
| | | <key>nested</key> |
| | | <true/> |
| | | <key>weight</key> |
| | | <real>10</real> |
| | | </dict> |
| | | <key>^embedded\.provisionprofile$</key> |
| | | <dict> |
| | | <key>weight</key> |
| | | <real>20</real> |
| | | </dict> |
| | | <key>^version\.plist$</key> |
| | | <dict> |
| | | <key>weight</key> |
| | | <real>20</real> |
| | | </dict> |
| | | </dict> |
| | | </dict> |
| | | </plist> |