Skip to content

Commit

Permalink
Facebook iOS SDK 4.18
Browse files Browse the repository at this point in the history
  • Loading branch information
overlordnyaldee committed Dec 1, 2016
2 parents d001870 + e439a7e commit f7531a8
Show file tree
Hide file tree
Showing 132 changed files with 2,988 additions and 2,378 deletions.
91 changes: 91 additions & 0 deletions .buckconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
[client]
# Do not delete this section. Used by arc focus for logging.

[project]
# Note that `buck project --ide intellij` can be run from the root.
# to override this default.
ide = xcode
# Forbid symlinks for source files so Buck doesn't have to dump its
# cache every time it encounters one.
allow_symlinks = forbid

# Use watchman when available to speed up glob() calls
glob_handler = watchman

# Directories that do not contain input files. Any build output directories
# (but NOT .hg, .git, or anything tracked in source control) should be in
# .watchmanconfig.
ignore = \
.buckd, \
.git, \
.hg, \
tmp, \
Tools/clang/analyzer/build, \
Tools/clang/clang-ocaml-DEPRECATED/build, \
Tools/clang/libtooling/build, \
Tools/clang/xcode, \
Tools/xctool/build, \
VendorLib/Breakpad/src/tools/mac/dump_syms/build, \
**/.DS_Store, \
**/**.orig, \
Libraries/FBReactKit/js/react-native-github/ReactAndroid, \
Libraries/FBReactKit/js/react-native-github/Examples/**/android/**, \
Libraries/FBReactKit/js/react-native-github/local-cli/generator*/**, \
Libraries/FBReactKit/js/RKJSModules/Libraries/Relay/relay/__github__/**, \
**/.*.swp, \
**/.*.swx, \
**/.*.swpx, \
**/.*.swo, \
**/.#*, \
**/*~

parallel_parsing = true
parsing_threads = 4

# Enable build file sandboxing
enable_build_file_sandboxing = true


[buildfile]
includes = //internal/buck/build_defs.py

[apple]
device_helper_target = //Tools/SDMMobileDevice:iOSConsole#macosx-x86_64
iphonesimulator_target_sdk_version = 8.0
iphoneos_target_sdk_version = 8.0
macosx_target_sdk_version = 10.9
watchos_target_sdk_version = 2.0
watchsimulator_target_sdk_version = 2.0
xctool_zip_target = //EndToEndTests/FBSimulatorControl:FBXCTest-zip
xctool_default_destination_specifier = "name=iPhone 5s"
force_dsym_mode_in_build_with_buck = false

default_debug_info_format_for_binaries = DWARF
default_debug_info_format_for_libraries = DWARF
default_debug_info_format_for_tests = DWARF


[cxx]
# Disabling deprecated APIs and truncating casts were unfortunately in use
# before fbobjc was Buck-ified.
cflags = -std=gnu11 -Wno-deprecated -Wno-conversion -Wundeclared-selector -Wno-objc-designated-initializers -Wimplicit-retain-self -Werror -g
cxxflags = -std=c++14 -stdlib=libc++ -Wno-deprecated -Wno-conversion -Wundeclared-selector -Wno-objc-designated-initializers -Wimplicit-retain-self -Werror -g
# workaround for osmeta's ranlib, which does not set -s as default.
ranlibflags = -s
default_platform = iphonesimulator-x86_64
# We enabled combined preprocessing+compiling for two reasons:
# 1. Doing these two steps separately is slower, and until we support
# generalized ABI rule keys, there isn't any reason not to do this
# as a single combined step.
# 2. Clang has a bug where #pragmas for ARC aren't written to preprocessed
# sources, and so get ommited in the actual compilation.
combined_preprocess_and_compile = true
# We explicitly set the host platform so that the rule keys will match between
# different OS X versions as long as the Xcode Toolchain and SDK versions match.
# Note this will break the builds if the machine doesn't have the SDK installed
# or if it cannot run binaries built with it.
host_platform = macosx-x86_64

# Link rules take up 2 equivalent CPUs. This limiting reduces concurrent
# links to improve io/memory contention.
link_weight = 2
3 changes: 3 additions & 0 deletions .buckjavaargs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-Xmx3g
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=buck-out/log
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ TestAppIdAndSecret.xcconfig
Carthage

# vim temp files
*.swp
*.sw?
*.un~

# buck
buck-out/
.buckd/
.buckd/

infer-out
23 changes: 23 additions & 0 deletions .inferconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"infer_blacklist": [
"FBAudienceNetwork/FBAudienceNetwork/util/fnf/",
"../../vendor/",
"../../vendor/OCMock/",
"vendor/",
"vendor/OCMock/"
],
"cxx": false,
"flavors": true,
"enable_checks": [
"GLOBAL_VARIABLE_INITIALIZED_WITH_FUNCTION_OR_METHOD_CALL"
],
"infer_blacklist_files_containing": [
"@generated"
],
"skip_translation_headers": [
"VendorLib",
"xplat",
"buck-out/gen/VendorLib",
"buck-out/gen/xplat"
]
}
1 change: 1 addition & 0 deletions .inferversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
332b7d5f3a7a8d43c04d6727cda8d8e3d09c773d
2 changes: 1 addition & 1 deletion Configurations/Platform/iOS.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

SDKROOT = iphoneos
IPHONEOS_DEPLOYMENT_TARGET = 7.0
IPHONEOS_DEPLOYMENT_TARGET = 8.0

// Supported device families (1 is iPhone, 2 is iPad, 3 is Apple TV)
TARGETED_DEVICE_FAMILY = 1,2
Expand Down
2 changes: 1 addition & 1 deletion Configurations/Version.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

// The versions for FBSDK and Messenger SDK.
FBSDK_PROJECT_VERSION=4.17.0
FBSDK_PROJECT_VERSION=4.18.0
MNSDK_PROJECT_VERSION=TODO_SUPPORT_MNSDK

4 changes: 2 additions & 2 deletions FBSDKCoreKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Pod::Spec.new do |s|

s.name = "FBSDKCoreKit"
s.version = "4.17.0"
s.version = "4.18.0"
s.summary = "Official Facebook SDK for iOS to access Facebook Platform's core features"

s.description = <<-DESC
Expand All @@ -22,7 +22,7 @@ Pod::Spec.new do |s|
s.tvos.deployment_target = '9.0'

s.source = { :git => "https://github.com/facebook/facebook-ios-sdk.git",
:tag => "sdk-version-4.17.0"
:tag => "sdk-version-4.18.0"
}

s.ios.weak_frameworks = 'Accounts', 'CoreLocation', 'Social', 'Security', 'QuartzCore', 'CoreGraphics', 'UIKit', 'Foundation', 'AudioToolbox'
Expand Down
117 changes: 62 additions & 55 deletions FBSDKCoreKit/FBSDKCoreKit/FBSDKAccessToken.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,20 @@
#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
/**
Notification indicating that the `currentAccessToken` has changed.
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
/**
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
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.
Expand All @@ -45,74 +47,76 @@ FBSDK_EXTERN NSString *const FBSDKAccessTokenDidChangeNotification;
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.
key in notification's userInfo object for getting the old token.
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.
key in notification's userInfo object for getting the new token.
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.
/**
Represents an immutable access token for using Facebook services.
*/
@interface FBSDKAccessToken : NSObject<FBSDKCopying, NSSecureCoding>

/*!
@abstract Returns the app ID.
/**
Returns the app ID.
*/
@property (readonly, copy, nonatomic) NSString *appID;

/*!
@abstract Returns the known declined permissions.
/**
Returns the known declined permissions.
*/
@property (readonly, copy, nonatomic) NSSet *declinedPermissions;

/*!
@abstract Returns the expiration date.
/**
Returns the expiration date.
*/
@property (readonly, copy, nonatomic) NSDate *expirationDate;

/*!
@abstract Returns the known granted permissions.
/**
Returns the known granted permissions.
*/
@property (readonly, copy, nonatomic) NSSet *permissions;

/*!
@abstract Returns the date the token was last refreshed.
/**
Returns the date the token was last refreshed.
*/
@property (readonly, copy, nonatomic) NSDate *refreshDate;

/*!
@abstract Returns the opaque token string.
/**
Returns the opaque token string.
*/
@property (readonly, copy, nonatomic) NSString *tokenString;

/*!
@abstract Returns the user ID.
/**
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
/**
Initializes a new instance.
- Parameter tokenString: the opaque token string.
- Parameter 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
- Parameter 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
- Parameter appID: the app ID.
- Parameter userID: the user ID.
- Parameter expirationDate: the optional expiration date (defaults to distantFuture).
- Parameter 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`.
*/
Expand All @@ -125,38 +129,41 @@ FBSDK_EXTERN NSString *const FBSDKAccessTokenChangeNewKey;
refreshDate:(NSDate *)refreshDate
NS_DESIGNATED_INITIALIZER;

/*!
@abstract Convenience getter to determine if a permission has been granted
@param permission The permission to check.
/**
Convenience getter to determine if a permission has been granted
- Parameter 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
/**
Compares the receiver to another FBSDKAccessToken
- Parameter token: The other token
- Returns: 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
/**
Returns the "global" access token that represents the currently logged in user.
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.
/**
Sets the "global" access token that represents the currently logged in user.
- Parameter token: The access token to set.
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,
/**
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
- Parameter completionHandler: an optional callback handler that can surface any errors related to permission refreshing.
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.
Expand Down
Loading

0 comments on commit f7531a8

Please sign in to comment.