Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions FBSDKCoreKit/FBSDKCoreKit/AppEvents/FBSDKAppEvents.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@

#endif

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

@protocol FBSDKCAPIReporter;

// Event parameter values internal to this file
Expand Down Expand Up @@ -1690,6 +1693,8 @@ - (void)validateConfiguration
return request;
}

#pragma clang diagnostic pop

#pragma mark - Testability

#if DEBUG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
#import "FBSDKViewHierarchy.h"
#import "FBSDKViewHierarchyMacros.h"

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

@interface FBSDKCodelessIndexer ()

@property (class, nullable, nonatomic) id<FBSDKGraphRequestFactory> graphRequestFactory;
Expand Down Expand Up @@ -517,6 +520,8 @@ + (nullable UIImage *)screenshot
};
}

#pragma clang diagnostic pop

#if DEBUG

+ (void)reset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
#define ReactNativeClassRCTTouchEvent "RCTTouchEvent"
#define ReactNativeClassRCTTouchHandler "RCTTouchHandler"

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

@interface FBSDKEventBindingManager ()

@property (nonnull, nonatomic) id<FBSDKEventLogging> eventLogger;
Expand Down Expand Up @@ -466,6 +469,8 @@ - (void)handleDidSelectItemWithBindings:(NSArray<FBSDKEventBinding *> *)bindings
return _validClasses;
}

#pragma clang diagnostic pop

#if DEBUG

- (void)setReactBindings:(NSMutableDictionary<NSNumber *, id> *)bindings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

#define FB_ARRAY_COUNT(x) sizeof(x) / sizeof(x[0])

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

static const u_int FB_GROUP1_RECHECK_DURATION = 30 * 60; // seconds

@interface FBSDKAppEventsDeviceInfo ()
Expand Down Expand Up @@ -196,8 +199,6 @@ + (uint)_readCoreCount
return value;
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ (NSString *)_getCarrier
{
#if TARGET_OS_SIMULATOR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
#import "FBSDKEventLogging.h"
#import "FBSDKProductsRequestProtocols.h"

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

static NSString *const FBSDKPaymentObserverOriginalTransactionKey = @"com.facebook.appevents.PaymentObserver.originalTransaction";
static NSString *const FBSDKPaymentObserverDelimiter = @",";

Expand Down Expand Up @@ -411,4 +414,6 @@ - (NSData *)fetchDeviceReceipt
return receipt;
}

#pragma clang diagnostic pop

@end
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@

#import "SKProductsRequest+FBSDKProductsRequest.h"

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

@implementation FBSDKProductRequestFactory

- (nonnull id<FBSDKProductsRequest>)createWithProductIdentifiers:(nonnull NSSet<NSString *> *)identifiers
{
return [[SKProductsRequest alloc] initWithProductIdentifiers:identifiers];
}

#pragma clang diagnostic pop

@end
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#import "FBSDKViewHierarchy.h"
#import "FBSDKViewHierarchyMacros.h"

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

NSString *const OptInEvents = @"production_events";
NSString *const UnconfirmedEvents = @"eligible_for_prediction_events";

Expand Down Expand Up @@ -314,6 +317,8 @@ - (void)logSuggestedEvent:(FBSDKAppEventName)event
return;
}

#pragma clang diagnostic pop

#pragma mark - Testability

#if DEBUG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import StoreKit

Class to encapsulate implicit logging of purchase events
*/

@available(iOS, deprecated: 18.0)
@objc(FBSDKPaymentObserver)
public final class _PaymentObserver: NSObject, _PaymentObserving {
var isObservingTransactions = false
Expand Down Expand Up @@ -51,6 +53,7 @@ public final class _PaymentObserver: NSObject, _PaymentObserving {
}
}

@available(iOS, deprecated: 18.0)
extension _PaymentObserver: SKPaymentTransactionObserver {

public func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import Foundation

@warning INTERNAL - DO NOT USE
*/

@available(iOS, deprecated: 18.0)
@objc(FBSDKPaymentProductRequestorFactory)
public final class _PaymentProductRequestorFactory: NSObject, _PaymentProductRequestorCreating {

Expand All @@ -35,6 +37,7 @@ public final class _PaymentProductRequestorFactory: NSObject, _PaymentProductReq
}
}

@available(iOS, deprecated: 18.0)
extension _PaymentProductRequestorFactory: DependentAsType {
struct TypeDependencies {
var settings: SettingsProtocol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
#import "FBSDKErrorReporter.h"
#import "FBSDKWebViewAppLinkResolverWebViewDelegate.h"

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

/**
Describes the callback for appLinkFromURLInBackground.
@param result the results from following redirects
Expand Down Expand Up @@ -299,4 +302,6 @@ - (FBSDKAppLink *)appLinkFromALData:(NSDictionary<NSString *, id> *)appLinkDict

@end

#pragma clang diagnostic pop

#endif
45 changes: 5 additions & 40 deletions FBSDKCoreKit/FBSDKCoreKit/FBSDKButton.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
#define HEIGHT_TO_PADDING 0.23
#define HEIGHT_TO_TEXT_PADDING_CORRECTION 0.08

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

@interface FBSDKButton ()

@property (nonatomic) BOOL skipIntrinsicContentSizing;
Expand Down Expand Up @@ -114,17 +117,6 @@ - (void)setEnabled:(BOOL)enabled

#pragma mark - Layout

- (CGRect)imageRectForContentRect:(CGRect)contentRect
{
if (self.hidden || CGRectIsEmpty(self.bounds)) {
return CGRectZero;
}
CGRect imageRect = UIEdgeInsetsInsetRect(contentRect, self.imageEdgeInsets);
CGFloat margin = [self _marginForHeight:[self _heightForContentRect:contentRect]];
imageRect = CGRectInset(imageRect, margin, margin);
imageRect.size.width = CGRectGetHeight(imageRect);
return imageRect;
}

- (CGSize)intrinsicContentSize
{
Expand Down Expand Up @@ -154,35 +146,6 @@ - (void)sizeToFit
self.bounds = bounds;
}

- (CGRect)titleRectForContentRect:(CGRect)contentRect
{
if (self.hidden || CGRectIsEmpty(self.bounds)) {
return CGRectZero;
}
CGRect imageRect = [self imageRectForContentRect:contentRect];
CGFloat height = [self _heightForContentRect:contentRect];
CGFloat padding = [self _paddingForHeight:height];
CGFloat titleX = CGRectGetMaxX(imageRect) + padding;
CGRect titleRect = CGRectMake(titleX, 0.0, CGRectGetWidth(contentRect) - titleX, CGRectGetHeight(contentRect));

UIEdgeInsets titleEdgeInsets = UIEdgeInsetsZero;
if (!self.layer.needsLayout) {
UILabel *titleLabel = self.titleLabel;
if (titleLabel.textAlignment == NSTextAlignmentCenter) {
// if the text is centered, we need to adjust the frame for the titleLabel based on the size of the text in order
// to keep the text centered in the button without adding extra blank space to the right when unnecessary
// 1. the text fits centered within the button without colliding with the image (imagePaddingWidth)
// 2. the text would run into the image, so adjust the insets to effectively left align it (textPaddingWidth)
CGSize titleSize = [self textSizeForText:titleLabel.text font:titleLabel.font constrainedSize:titleRect.size lineBreakMode:titleLabel.lineBreakMode];
CGFloat titlePaddingWidth = (CGRectGetWidth(titleRect) - titleSize.width) / 2;
CGFloat imagePaddingWidth = titleX / 2;
CGFloat inset = MIN(titlePaddingWidth, imagePaddingWidth);
titleEdgeInsets.left -= inset;
titleEdgeInsets.right += inset;
}
}
return UIEdgeInsetsInsetRect(titleRect, titleEdgeInsets);
}

#pragma mark - Subclass Methods

Expand Down Expand Up @@ -486,4 +449,6 @@ - (CGFloat)_textPaddingCorrectionForHeight:(CGFloat)height
return floorf(height * HEIGHT_TO_TEXT_PADDING_CORRECTION);
}

#pragma clang diagnostic pop

@end
5 changes: 5 additions & 0 deletions FBSDKCoreKit/FBSDKCoreKit/FBSDKInternalUtility.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
#import <mach-o/dyld.h>
#import <sys/time.h>

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

typedef NS_ENUM(NSUInteger, FBSDKInternalUtilityVersionMask) {
FBSDKInternalUtilityMajorVersionMask = 0xFFFF0000,
// FBSDKInternalUtilityMinorVersionMask = 0x0000FF00, // unused
Expand Down Expand Up @@ -710,6 +713,8 @@ - (BOOL)isUnity
return NO;
}

#pragma clang diagnostic pop

- (void)validateConfiguration
{
#if DEBUG
Expand Down
5 changes: 5 additions & 0 deletions FBSDKCoreKit/FBSDKCoreKit/FBSDKWebDialogView.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@

#define FBSDK_WEB_DIALOG_VIEW_BORDER_WIDTH 10.0

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

@interface FBSDKWebDialogView () <WKNavigationDelegate>

@property (nonatomic, strong) UIButton *closeButton;
Expand Down Expand Up @@ -254,6 +257,8 @@ - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigat
[self.delegate webDialogViewDidFinishLoad:self];
}

#pragma clang diagnostic pop

#if DEBUG

+ (void)resetClassDependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

#import <StoreKit/StoreKit.h>

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

@protocol FBSDKSettings;
@protocol FBSDKEventLogging;
@protocol FBSDKGateKeeperManaging;
Expand Down Expand Up @@ -40,5 +43,6 @@ NS_SWIFT_NAME(PaymentProductRequestor)
- (void)resolveProducts;

@end

NS_ASSUME_NONNULL_END

#pragma clang diagnostic pop
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

#import <Foundation/Foundation.h>

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

@class FBSDKPaymentProductRequestor;
@class SKPaymentTransaction;

Expand All @@ -30,3 +33,5 @@ NS_SWIFT_NAME(createRequestor(transaction:));
@end

NS_ASSUME_NONNULL_END

#pragma clang diagnostic pop
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

@protocol SKProductsRequestDelegate;

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

NS_ASSUME_NONNULL_BEGIN

/**
Expand Down Expand Up @@ -44,3 +47,5 @@ NS_SWIFT_NAME(_ProductsRequestCreating)
@end

NS_ASSUME_NONNULL_END

#pragma clang diagnostic pop
10 changes: 10 additions & 0 deletions FBSDKShareKit/FBSDKShareKit/Content/ShareLinkContent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public final class ShareLinkContent: NSObject {
*/
public var contentURL: URL?

/**
URI for the resource available at the URL which will be used to identify resources
**/
public var entityURI: String?

/// Hashtag for the content being shared.
public var hashtag: Hashtag?

Expand Down Expand Up @@ -73,6 +78,11 @@ extension ShareLinkContent: SharingContent {
// We will only use the new share flow we developed if messenger_link is present, not link.
updatedParameters["messenger_link"] = url
}

if let uri = entityURI {
updatedParameters["entity_uri"] = uri
}

if let quote = quote {
updatedParameters["quote"] = quote
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ final class ShareLinkContentTests: XCTestCase {
func testProperties() {
let content = ShareModelTestUtility.linkContent
XCTAssertEqual(content.contentURL, ShareModelTestUtility.contentURL)
XCTAssertEqual(content.entityURI, ShareModelTestUtility.entityURI)
XCTAssertEqual(content.hashtag, ShareModelTestUtility.hashtag)
XCTAssertEqual(content.peopleIDs, ShareModelTestUtility.peopleIDs)
XCTAssertEqual(content.placeID, ShareModelTestUtility.placeID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ enum ShareModelTestUtility {
// swiftlint:disable force_unwrapping
static let cameraEffectID = "1234567"
static let contentURL = URL(string: "https://developers.facebook.com/")!
static let entityURI = "https://developers.facebook.com/"
static let fileURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).last!
static let hashtag = Hashtag("#ashtag")
static let isPhotoUserGenerated = true
Expand All @@ -40,6 +41,7 @@ enum ShareModelTestUtility {
static var linkContent: ShareLinkContent {
let linkContent = linkContentWithoutQuote
linkContent.quote = quote
linkContent.entityURI = entityURI
return linkContent
}

Expand Down