Skip to content
This repository has been archived by the owner on Oct 24, 2022. It is now read-only.

Commit

Permalink
lib(#713): update Facebook SDK for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpeterparker committed Oct 10, 2018
1 parent b76b207 commit cb1cebf
Show file tree
Hide file tree
Showing 25 changed files with 790 additions and 17 deletions.
Binary file modified src/ios/Bolts.framework/Bolts
Binary file not shown.
Binary file modified src/ios/Bolts.framework/Info.plist
Binary file not shown.
Binary file modified src/ios/FBSDKCoreKit.framework/FBSDKCoreKit
Binary file not shown.
37 changes: 37 additions & 0 deletions src/ios/FBSDKCoreKit.framework/Headers/FBSDKAccessToken.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ FBSDK_EXTERN NSString *const FBSDKAccessTokenDidExpire;
*/
@property (readonly, copy, nonatomic) NSString *appID;

/**
Returns the expiration date for data access
*/
@property (readonly, copy, nonatomic) NSDate *dataAccessExpirationDate;

/**
Returns the known declined permissions.
*/
Expand Down Expand Up @@ -112,9 +117,38 @@ FBSDK_EXTERN NSString *const FBSDKAccessTokenDidExpire;
*/
@property (readonly, assign, nonatomic, getter = isExpired) BOOL expired;

/**
Returns whether user data access is still active for the given access token
*/
@property (readonly, assign, nonatomic, getter = isDataAccessExpired) BOOL dataAccessExpired;

- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;

/**
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).
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;

/**
Initializes a new instance.
@param tokenString the opaque token string.
Expand All @@ -126,6 +160,8 @@ FBSDK_EXTERN NSString *const FBSDKAccessTokenDidExpire;
@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).
@param dataAccessExpirationDate the date which data access will expire for the given user
(defaults to distantFuture).
This initializer should only be used for advanced apps that
manage tokens explicitly. Typical login flows only need to use `FBSDKLoginManager`
Expand All @@ -138,6 +174,7 @@ FBSDK_EXTERN NSString *const FBSDKAccessTokenDidExpire;
userID:(NSString *)userID
expirationDate:(NSDate *)expirationDate
refreshDate:(NSDate *)refreshDate
dataAccessExpirationDate:(NSDate *)dataAccessExpirationDate
NS_DESIGNATED_INITIALIZER;

/**
Expand Down
34 changes: 31 additions & 3 deletions src/ios/FBSDKCoreKit.framework/Headers/FBSDKAppEvents.h
Original file line number Diff line number Diff line change
Expand Up @@ -657,17 +657,45 @@ FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameOrderID;
Zip: zp
Country: country
*/
+ (void) setUserData:(NSDictionary*)userData;
+ (void)setUserData:(NSDictionary *)userData
DEPRECATED_MSG_ATTRIBUTE("Renamed `setUserEmail:firstName: ...`");

/*
Sets custom user data to associate with all app events. All user data are hashed
and used to match Facebook user from this instance of an application.
The user data will be persisted between application instances.
@param email user's email
@param firstName user's first name
@param lastName user's last name
@param phone user's phone
@param dateOfBirth user's date of birth
@param gender user's gender
@param city user's city
@param state user's state
@param zip user's zip
@param country user's country
*/
+ (void)setUserEmail:(nullable NSString *)email
firstName:(nullable NSString *)firstName
lastName:(nullable NSString *)lastName
phone:(nullable NSString *)phone
dateOfBirth:(nullable NSString *)dateOfBirth
gender:(nullable NSString *)gender
city:(nullable NSString *)city
state:(nullable NSString *)state
zip:(nullable NSString *)zip
country:(nullable NSString *)country;
/*
Returns the set user data else nil
*/
+ (NSString*) getUserData;
+ (NSString *)getUserData;

/*
Clears the current user data
*/
+ (void) clearUserData;
+ (void)clearUserData;

/*
Sends a request to update the properties for the current user, set by `setUserID:`
Expand Down
63 changes: 63 additions & 0 deletions src/ios/FBSDKCoreKit.framework/Headers/FBSDKAppLink.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// 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 "FBSDKAppLinkTarget.h"

NS_ASSUME_NONNULL_BEGIN

/*! The version of the App Link protocol that this library supports */
FOUNDATION_EXPORT NSString *const FBSDKAppLinkVersion;

/*!
Contains App Link metadata relevant for navigation on this device
derived from the HTML at a given URL.
*/
@interface FBSDKAppLink : NSObject

/*!
Creates a FBSDKAppLink with the given list of FBSDKAppLinkTargets and target URL.
Generally, this will only be used by implementers of the FBSDKAppLinkResolving 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 FBSDKAppLinkTargets 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<FBSDKAppLinkTarget *> *)targets
webURL:(nullable NSURL *)webURL;

/*! The URL from which this FBSDKAppLink 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<FBSDKAppLinkTarget *> *targets;

/*! The fallback web URL to use if no targets are installed on this device. */
@property (nonatomic, strong, readonly, nullable) NSURL *webURL;

@end

NS_ASSUME_NONNULL_END
137 changes: 137 additions & 0 deletions src/ios/FBSDKCoreKit.framework/Headers/FBSDKAppLinkNavigation.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
// 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 "FBSDKAppLink.h"
#import "FBSDKAppLinkResolving.h"

NS_ASSUME_NONNULL_BEGIN

/*!
The result of calling navigate on a FBSDKAppLinkNavigation
*/
typedef NS_ENUM(NSInteger, FBSDKAppLinkNavigationType) {
/*! Indicates that the navigation failed and no app was opened */
FBSDKAppLinkNavigationTypeFailure,
/*! Indicates that the navigation succeeded by opening the URL in the browser */
FBSDKAppLinkNavigationTypeBrowser,
/*! Indicates that the navigation succeeded by opening the URL in an app on the device */
FBSDKAppLinkNavigationTypeApp
};

/**
Describes the callback for appLinkFromURLInBackground.
@param navType the FBSDKAppLink representing the deferred App Link
@param error the error during the request, if any
*/
typedef void (^FBSDKAppLinkNavigationHandler)(FBSDKAppLinkNavigationType navType, NSError * _Nullable error);

/*!
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 FBSDKAppLinkNavigations themselves.
*/
NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extension")
@interface FBSDKAppLinkNavigation : 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<NSString *, id> *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<NSString *, id> *appLinkData;

/*! The AppLink to navigate to */
@property (nonatomic, strong, readonly) FBSDKAppLink *appLink;

/*! Creates an AppLinkNavigation with the given link, extras, and App Link data */
+ (instancetype)navigationWithAppLink:(FBSDKAppLink *)appLink
extras:(NSDictionary<NSString *, id> *)extras
appLinkData:(NSDictionary<NSString *, id> *)appLinkData;

/*!
Creates an NSDictionary with the correct format for iOS callback URLs,
to be used as 'appLinkData' argument in the call to navigationWithAppLink:extras:appLinkData:
*/
+ (NSDictionary<NSString *, NSDictionary<NSString *, NSString *> *> *)callbackAppLinkDataForAppWithName:(NSString *)appName
url:(NSString *)url;

/*! Performs the navigation */
- (FBSDKAppLinkNavigationType)navigate:(NSError *__autoreleasing *)error;

/*! Returns a FBSDKAppLink for the given URL */
+ (void)resolveAppLink:(NSURL *)destination handler:(FBSDKAppLinkFromURLHandler)handler;

/*! Returns a FBSDKAppLink for the given URL using the given App Link resolution strategy */
+ (void)resolveAppLink:(NSURL *)destination
resolver:(id<FBSDKAppLinkResolving>)resolver
handler:(FBSDKAppLinkFromURLHandler)handler;

/*! Navigates to a FBSDKAppLink and returns whether it opened in-app or in-browser */
+ (FBSDKAppLinkNavigationType)navigateToAppLink:(FBSDKAppLink *)link error:(NSError *__autoreleasing *)error;

/*!
Returns a FBSDKAppLinkNavigationType based on a FBSDKAppLink.
It's essentially a no-side-effect version of navigateToAppLink:error:,
allowing apps to determine flow based on the link type (e.g. open an
internal web view instead of going straight to the browser for regular links.)
*/
+ (FBSDKAppLinkNavigationType)navigationTypeForLink:(FBSDKAppLink *)link;

/*!
Return navigation type for current instance.
No-side-effect version of navigate:
*/
- (FBSDKAppLinkNavigationType)navigationType;

/*! Navigates to a URL (an asynchronous action) and returns a FBSDKNavigationType */
+ (void)navigateToURL:(NSURL *)destination handler:(FBSDKAppLinkNavigationHandler)handler;

/*!
Navigates to a URL (an asynchronous action) using the given App Link resolution
strategy and returns a FBSDKNavigationType
*/
+ (void)navigateToURL:(NSURL *)destination
resolver:(id<FBSDKAppLinkResolving>)resolver
handler:(FBSDKAppLinkNavigationHandler)handler;

/*!
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<FBSDKAppLinkResolving>)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 FBSDK.
*/
+ (void)setDefaultResolver:(id<FBSDKAppLinkResolving>)resolver;

@end

NS_ASSUME_NONNULL_END
35 changes: 30 additions & 5 deletions src/ios/FBSDKCoreKit.framework/Headers/FBSDKAppLinkResolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@

#import <Foundation/Foundation.h>

#import "FBSDKAppLinkResolving.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>
#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,
Expand All @@ -34,6 +37,7 @@
App Links that may include pre-fetching, caching, or querying for App Link
data from an index provided by a service provider.
*/
DEPRECATED_MSG_ATTRIBUTE("Use `FBSDKAppLinkResolving`")
@protocol BFAppLinkResolving <NSObject>

/**
Expand All @@ -42,7 +46,8 @@
@param url The URL to resolve into an App Link.
@return A BFTask that will return a BFAppLink for the given URL.
*/
- (BFTask *)appLinkFromURLInBackground:(NSURL *)url;
- (BFTask *)appLinkFromURLInBackground:(NSURL *)url
DEPRECATED_MSG_ATTRIBUTE("Use `appLinkFromURL:handler:`");

@end

Expand All @@ -59,7 +64,10 @@
Usage of this type requires a client token. See `[FBSDKSettings setClientToken:]` and linking
Bolts.framework
*/
@interface FBSDKAppLinkResolver : NSObject<BFAppLinkResolving>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@interface FBSDKAppLinkResolver : NSObject<FBSDKAppLinkResolving, BFAppLinkResolving>
#pragma clang diagnostic pop

/**
Asynchronously resolves App Link data for multiple URLs.
Expand All @@ -68,11 +76,28 @@
@return A BFTask that will return dictionary mapping input NSURLs to their
corresponding BFAppLink.
You should set the client token before making this call. See `[FBSDKSettings setClientToken:]`
*/
- (BFTask *)appLinksFromURLsInBackground:(NSArray<NSURL *> *)urls
DEPRECATED_MSG_ATTRIBUTE("Use `appLinkFromURLs:handler:`");

/**
Asynchronously resolves App Link data for a given URL.
You should set the client token before making this call. See `[FBSDKSettings setClientToken:]`
@param url The URL to resolve into an App Link.
@return A BFTask that will return a BFAppLink for the given URL.
*/
- (BFTask *)appLinkFromURLInBackground:(NSURL *)url
DEPRECATED_MSG_ATTRIBUTE("Use `appLinkFromURL:handler:`");

/**
Asynchronously resolves App Link data for a given array of URLs.
@param urls The URLs to resolve into an App Link.
@param handler The completion block that will return an App Link for the given URL.
*/
- (BFTask *)appLinksFromURLsInBackground:(NSArray *)urls;
- (void)appLinksFromURLs:(NSArray<NSURL *> *)urls handler:(FBSDKAppLinksFromURLArrayHandler)handler
NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extension");

/**
Allocates and initializes a new instance of FBSDKAppLinkResolver.
Expand Down
Loading

0 comments on commit cb1cebf

Please sign in to comment.