Skip to content

Commit

Permalink
Facebook iOS SDK 4.19
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhuowen committed Jan 26, 2017
1 parent e439a7e commit bdee7fe
Show file tree
Hide file tree
Showing 78 changed files with 360 additions and 337 deletions.
91 changes: 0 additions & 91 deletions .buckconfig

This file was deleted.

3 changes: 0 additions & 3 deletions .buckjavaargs

This file was deleted.

1 change: 0 additions & 1 deletion .buckversion

This file was deleted.

13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
ads/samples/AdUnitsSample/AdUnitsSample.xcodeproj/*
ads/samples/AdUnitsSample/AdUnitsSample.xcworkspace/*
ads/samples/InstreamAdSample/InstreamAdSample.xcodeproj/*
ads/samples/InstreamAdSample/InstreamAdSample.xcworkspace/*
ads/samples/NativeAdSample/NativeAdSample.xcodeproj/*
ads/samples/NativeAdSample/NativeAdSample.xcworkspace/*
ads/src/FBAudienceNetwork.xcworkspace/*
ads/src/FBAudienceNetwork/FBAudienceNetwork.xcodeproj/*
samples/Hackbook/build/
samples/Hackbook/Hackbook.xcodeproj/*.pbxuser
samples/Hackbook/Hackbook.xcodeproj/*.mode*
Expand All @@ -10,6 +18,7 @@ src/facebook-ios-sdk.xcodeproj/*.mode*
src/build/
build/
lib/
docs/
test/UnitTest/UnitTest.xcodeproj/*.pbxuser
test/UnitTest/UnitTest.xcodeproj/*.mode*
test/UnitTest/build/
Expand All @@ -30,3 +39,7 @@ buck-out/
.buckd/

infer-out

#generated doc files
docs/

23 changes: 0 additions & 23 deletions .inferconfig

This file was deleted.

1 change: 0 additions & 1 deletion .inferversion

This file was deleted.

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.18.0
FBSDK_PROJECT_VERSION=4.19.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.18.0"
s.version = "4.19.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.18.0"
:tag => "sdk-version-4.19.0"
}

s.ios.weak_frameworks = 'Accounts', 'CoreLocation', 'Social', 'Security', 'QuartzCore', 'CoreGraphics', 'UIKit', 'Foundation', 'AudioToolbox'
Expand Down
5 changes: 4 additions & 1 deletion FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,10 @@ FBSDK_EXTERN NSString *const FBSDKAppEventParameterValueNo;

/**
Notifies the events system that the app has launched and, when appropriate, logs an "activated app" event. Should typically be placed in the
Notifies the events system that the app has launched and, when appropriate, logs an "activated app" event.
This function is called automatically from FBSDKApplicationDelegate applicationDidBecomeActive, unless
one overrides 'FacebookAutoLogAppEventsEnabled' key to false in the project info plist file.
In case 'FacebookAutoLogAppEventsEnabled' is set to false, then it 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
Expand Down
2 changes: 2 additions & 0 deletions FBSDKCoreKit/FBSDKCoreKit/FBSDKApplicationDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
/**
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.
As part of SDK initialization basic auto logging of app events will occur, this can be
controlled via 'FacebookAutoLogAppEventsEnabled' key in the project info plist file.
- Parameter application: The application as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:].
Expand Down
4 changes: 4 additions & 0 deletions FBSDKCoreKit/FBSDKCoreKit/FBSDKApplicationDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ - (void)applicationDidEnterBackground:(NSNotification *)notification

- (void)applicationDidBecomeActive:(NSNotification *)notification
{
// Auto log basic events in case autoLogAppEventsEnabled is set
if ([[FBSDKSettings autoLogAppEventsEnabled] boolValue]) {
[FBSDKAppEvents activateApp];
}
// _expectingBackground can be YES if the caller started doing work (like login)
// within the app delegate's lifecycle like openURL, in which case there
// might have been a "didBecomeActive" event pending that we want to ignore.
Expand Down
2 changes: 1 addition & 1 deletion FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@
#import <FBSDKCoreKit/FBSDKDeviceViewControllerBase.h>
#endif

#define FBSDK_VERSION_STRING @"4.18.0"
#define FBSDK_VERSION_STRING @"4.19.0"
#define FBSDK_TARGET_PLATFORM_VERSION @"v2.8"
12 changes: 12 additions & 0 deletions FBSDKCoreKit/FBSDKCoreKit/FBSDKSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,18 @@ FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorDeveloperErrors;
- See:[UIImageJPEGRepresentation](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIKitFunctionReference/#//apple_ref/c/func/UIImageJPEGRepresentation) */
+ (void)setJPEGCompressionQuality:(CGFloat)JPEGCompressionQuality;

/**
Flag which controls the auto logging of basic app events, such as activateApp and deactivateApp.
If not explicitly set, the default is 1 - true
*/
+ (NSNumber *)autoLogAppEventsEnabled;

/**
Set the flag which controls the auto logging of basic app events, such as activateApp and deactivateApp.
- Parameter AutoLogAppEventsEnabled: Flag value, expressed as a value from 0 - false or 1 - true.
*/
+ (void)setAutoLogAppEventsEnabled:(NSNumber *)AutoLogAppEventsEnabled;

/**
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.
*/
Expand Down
4 changes: 3 additions & 1 deletion FBSDKCoreKit/FBSDKCoreKit/FBSDKSettings.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ + (void)initialize
FBSDKSETTINGS_PLIST_CONFIGURATION_SETTING_IMPL(NSString, FacebookClientToken, clientToken, setClientToken, nil);
FBSDKSETTINGS_PLIST_CONFIGURATION_SETTING_IMPL(NSString, FacebookDisplayName, displayName, setDisplayName, nil);
FBSDKSETTINGS_PLIST_CONFIGURATION_SETTING_IMPL(NSString, FacebookDomainPart, facebookDomainPart, setFacebookDomainPart, nil);
FBSDKSETTINGS_PLIST_CONFIGURATION_SETTING_IMPL(NSNumber, FacebookJpegCompressionQuality, _JPEGCompressionQualityNumber, _setJPEGCompressionQualityNumber, @(0.9));
FBSDKSETTINGS_PLIST_CONFIGURATION_SETTING_IMPL(NSNumber, FacebookJpegCompressionQuality, _JPEGCompressionQualityNumber, _setJPEGCompressionQualityNumber, @0.9);
FBSDKSETTINGS_PLIST_CONFIGURATION_SETTING_IMPL(NSNumber, FacebookAutoLogAppEventsEnabled, autoLogAppEventsEnabled,
setAutoLogAppEventsEnabled, @1);

+ (void)setGraphErrorRecoveryDisabled:(BOOL)disableGraphErrorRecovery {
g_disableErrorRecovery = disableGraphErrorRecovery;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#import "FBSDKKeychainStore.h"

static NSString *const kFBSDKAccessTokenUserDefaultsKey = @"com.facebook.sdk.v4.FBSDKAccessTokenInformationKey";
static NSString *const kFBSDKAccessTokenKeychainKey = @"com.facebook.sdk.v4.FBSDKAccessTokenInformationKeychainKey";
static NSString *const kFBSDKAccessTokenUUIDKey = @"tokenUUID";
static NSString *const kFBSDKAccessTokenEncodedKey = @"tokenEncoded";

Expand All @@ -45,20 +46,21 @@ - (FBSDKAccessToken *)fetchAccessToken
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *uuid = [defaults objectForKey:kFBSDKAccessTokenUserDefaultsKey];

NSDictionary *dict = [_keychainStore dictionaryForKey:kFBSDKAccessTokenUserDefaultsKey];
if (![dict[kFBSDKAccessTokenUUIDKey] isEqualToString:uuid]) {
// if the uuid doesn't match (including if there is no uuid in defaults which means uninstalled case)
// clear the keychain and return nil.
[self clearCache];
return nil;
}

id tokenData = dict[kFBSDKAccessTokenEncodedKey];
if ([tokenData isKindOfClass:[NSData class]]) {
return [NSKeyedUnarchiver unarchiveObjectWithData:tokenData];
} else {
return nil;
NSDictionary *dict = [_keychainStore dictionaryForKey:kFBSDKAccessTokenKeychainKey];
if ([dict[kFBSDKAccessTokenUUIDKey] isKindOfClass:[NSString class]]) {
// there is a bug while running on simulator that the uuid stored in dict can be NSData,
// do a type check to make sure it is NSString
if ([dict[kFBSDKAccessTokenUUIDKey] isEqualToString:uuid]) {
id tokenData = dict[kFBSDKAccessTokenEncodedKey];
if ([tokenData isKindOfClass:[NSData class]]) {
return [NSKeyedUnarchiver unarchiveObjectWithData:tokenData];
}
}
}
// if the uuid doesn't match (including if there is no uuid in defaults which means uninstalled case)
// clear the keychain and return nil.
[self clearCache];
return nil;
}

- (void)cacheAccessToken:(FBSDKAccessToken *)token
Expand All @@ -81,14 +83,14 @@ - (void)cacheAccessToken:(FBSDKAccessToken *)token
};

[_keychainStore setDictionary:dict
forKey:kFBSDKAccessTokenUserDefaultsKey
forKey:kFBSDKAccessTokenKeychainKey
accessibility:[FBSDKDynamicFrameworkLoader loadkSecAttrAccessibleAfterFirstUnlockThisDeviceOnly]];
}

- (void)clearCache
{
[_keychainStore setDictionary:nil
forKey:kFBSDKAccessTokenUserDefaultsKey
forKey:kFBSDKAccessTokenKeychainKey
accessibility:NULL];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults removeObjectForKey:kFBSDKAccessTokenUserDefaultsKey];
Expand Down
4 changes: 2 additions & 2 deletions FBSDKLoginKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Pod::Spec.new do |s|

s.name = "FBSDKLoginKit"
s.version = "4.18.0"
s.version = "4.19.0"
s.summary = "Official Facebook SDK for iOS to access Facebook Platform with features like Login, Share and Message Dialog, App Links, and Graph API"

s.description = <<-DESC
Expand All @@ -21,7 +21,7 @@ Pod::Spec.new do |s|
s.ios.deployment_target = "7.0"

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

s.weak_frameworks = "Accounts", "CoreLocation", "Social", "Security", "QuartzCore", "CoreGraphics", "UIKit", "Foundation", "AudioToolbox"
Expand Down
Loading

0 comments on commit bdee7fe

Please sign in to comment.