lpw
2024-04-15 97fc0a41111c5a929ee8be9d6511775697ffa760
commit | author | age
2e29a3 1 /*
L 2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  * All rights reserved.
4  *
5  * This source code is licensed under the license found in the
6  * LICENSE file in the root directory of this source tree.
7  */
8
9 #import <Foundation/Foundation.h>
10 #import <UIKit/UIKit.h>
11
12 #import <FBSDKCoreKit/FBSDKAppAvailabilityChecker.h>
13 #import <FBSDKCoreKit/FBSDKAppURLSchemeProviding.h>
14 #import <FBSDKCoreKit/FBSDKInternalUtilityProtocol.h>
e0ec42 15 #import <FBSDKCoreKit/_FBSDKWindowFinding.h>
2e29a3 16
L 17 #if !TARGET_OS_TV
18  #import <FBSDKCoreKit/FBSDKURLHosting.h>
19 #endif
20
e0ec42 21 @protocol FBSDKErrorCreating;
L 22 @protocol FBSDKInfoDictionaryProviding;
23 @protocol FBSDKSettings;
24 @protocol __FBSDKLoggerCreating;
2e29a3 25
e0ec42 26 NS_ASSUME_NONNULL_BEGIN
2e29a3 27
L 28 NS_SWIFT_NAME(InternalUtility)
29 @interface FBSDKInternalUtility : NSObject
30 #if !TARGET_OS_TV
e0ec42 31   <FBSDKAppAvailabilityChecker, FBSDKAppURLSchemeProviding, FBSDKInternalUtility, FBSDKURLHosting, _FBSDKWindowFinding>
2e29a3 32 #else
L 33   <FBSDKAppAvailabilityChecker, FBSDKAppURLSchemeProviding, FBSDKInternalUtility>
34 #endif
35
e0ec42 36 #if !DEBUG
2e29a3 37 - (instancetype)init NS_UNAVAILABLE;
L 38 + (instancetype)new NS_UNAVAILABLE;
39 #endif
40
41 @property (class, nonnull, readonly) FBSDKInternalUtility *sharedUtility;
42
43 /**
44  Returns bundle for returning localized strings
45
46  We assume a convention of a bundle named FBSDKStrings.bundle, otherwise we
47  return the main bundle.
48  */
49 @property (nonatomic, readonly, strong) NSBundle *bundleForStrings;
50
51 /**
e0ec42 52  Tests whether the supplied URL is a valid URL for opening in the browser.
2e29a3 53  @param URL The URL to test.
L 54  @return YES if the URL refers to an http or https resource, otherwise NO.
55  */
56 - (BOOL)isBrowserURL:(NSURL *)URL;
57
58 /**
e0ec42 59  Checks equality between 2 objects.
2e29a3 60
L 61  Checks for pointer equality, nils, isEqual:.
62  @param object The first object to compare.
63  @param other The second object to compare.
64  @return YES if the objects are equal, otherwise NO.
65  */
66 - (BOOL)object:(id)object isEqualToObject:(id)other;
67
e0ec42 68 /// Attempts to find the first UIViewController in the view's responder chain. Returns nil if not found.
2e29a3 69 - (nullable UIViewController *)viewControllerForView:(UIView *)view;
L 70
e0ec42 71 /// returns true if the url scheme is registered in the CFBundleURLTypes
2e29a3 72 - (BOOL)isRegisteredURLScheme:(NSString *)urlScheme;
L 73
e0ec42 74 /// returns currently displayed top view controller.
2e29a3 75 - (nullable UIViewController *)topMostViewController;
L 76
e0ec42 77 /// returns the current key window
2e29a3 78 - (nullable UIWindow *)findWindow;
L 79
80 #pragma mark - FB Apps Installed
81
82 @property (nonatomic, readonly, assign) BOOL isMessengerAppInstalled;
83
84 - (BOOL)isRegisteredCanOpenURLScheme:(NSString *)urlScheme;
85
e0ec42 86 /**
L 87  Internal method exposed to facilitate transition to Swift.
88  API Subject to change or removal without warning. Do not use.
89
90  @warning INTERNAL - DO NOT USE
91  */
92 - (void)configureWithInfoDictionaryProvider:(id<FBSDKInfoDictionaryProviding>)infoDictionaryProvider
93                               loggerFactory:(id<__FBSDKLoggerCreating>)loggerFactory
94                                    settings:(id<FBSDKSettings>)settings
95                                errorFactory:(id<FBSDKErrorCreating>)errorFactory
96 NS_SWIFT_NAME(configure(infoDictionaryProvider:loggerFactory:settings:errorFactory:));
97
2e29a3 98 @end
L 99
100 NS_ASSUME_NONNULL_END