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 <UIKit/UIKit.h> |
|
10 |
|
|
11 |
#import <FBSDKCoreKit/FBSDKApplicationObserving.h> |
|
12 |
|
|
13 |
NS_ASSUME_NONNULL_BEGIN |
|
14 |
|
|
15 |
/** |
|
16 |
|
|
17 |
The FBSDKApplicationDelegate is designed to post process the results from Facebook Login |
|
18 |
or Facebook Dialogs (or any action that requires switching over to the native Facebook |
|
19 |
app or Safari). |
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
The methods in this class are designed to mirror those in UIApplicationDelegate, and you |
|
24 |
should call them in the respective methods in your AppDelegate implementation. |
|
25 |
*/ |
|
26 |
NS_SWIFT_NAME(ApplicationDelegate) |
|
27 |
@interface FBSDKApplicationDelegate : NSObject |
|
28 |
|
|
29 |
#if !FBTEST |
|
30 |
- (instancetype)init NS_UNAVAILABLE; |
|
31 |
+ (instancetype)new NS_UNAVAILABLE; |
|
32 |
#endif |
|
33 |
|
|
34 |
/** |
|
35 |
Gets the singleton instance. |
|
36 |
*/ |
|
37 |
@property (class, nonatomic, readonly, strong) FBSDKApplicationDelegate *sharedInstance |
|
38 |
NS_SWIFT_NAME(shared); |
|
39 |
|
|
40 |
/** |
|
41 |
Call this method from the [UIApplicationDelegate application:openURL:sourceApplication:annotation:] method |
|
42 |
of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction |
|
43 |
with the native Facebook app or Safari as part of SSO authorization flow or Facebook dialogs. |
|
44 |
|
|
45 |
@param application The application as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. |
|
46 |
|
|
47 |
@param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. |
|
48 |
|
|
49 |
@param sourceApplication The sourceApplication as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. |
|
50 |
|
|
51 |
@param annotation The annotation as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. |
|
52 |
|
|
53 |
@return YES if the url was intended for the Facebook SDK, NO if not. |
|
54 |
*/ |
|
55 |
- (BOOL)application:(UIApplication *)application |
|
56 |
openURL:(NSURL *)url |
|
57 |
sourceApplication:(nullable NSString *)sourceApplication |
|
58 |
annotation:(nullable id)annotation; |
|
59 |
|
|
60 |
/** |
|
61 |
Call this method from the [UIApplicationDelegate application:openURL:options:] method |
|
62 |
of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction |
|
63 |
with the native Facebook app or Safari as part of SSO authorization flow or Facebook dialogs. |
|
64 |
|
|
65 |
@param application The application as passed to [UIApplicationDelegate application:openURL:options:]. |
|
66 |
|
|
67 |
@param url The URL as passed to [UIApplicationDelegate application:openURL:options:]. |
|
68 |
|
|
69 |
@param options The options dictionary as passed to [UIApplicationDelegate application:openURL:options:]. |
|
70 |
|
|
71 |
@return YES if the url was intended for the Facebook SDK, NO if not. |
|
72 |
*/ |
|
73 |
- (BOOL)application:(UIApplication *)application |
|
74 |
openURL:(NSURL *)url |
|
75 |
options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options; |
|
76 |
|
|
77 |
/** |
|
78 |
Call this method from the [UIApplicationDelegate application:didFinishLaunchingWithOptions:] method |
|
79 |
of the AppDelegate for your app. It should be invoked for the proper use of the Facebook SDK. |
|
80 |
As part of SDK initialization basic auto logging of app events will occur, this can be |
|
81 |
controlled via 'FacebookAutoLogAppEventsEnabled' key in the project info plist file. |
|
82 |
|
|
83 |
@param application The application as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:]. |
|
84 |
|
|
85 |
@param launchOptions The launchOptions as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:]. |
|
86 |
|
|
87 |
@return True if there are any added application observers that themselves return true from calling `application:didFinishLaunchingWithOptions:`. |
|
88 |
Otherwise will return false. Note: If this method is called after calling `initializeSDK` then the return type will always be false. |
|
89 |
*/ |
|
90 |
- (BOOL) application:(UIApplication *)application |
|
91 |
didFinishLaunchingWithOptions:(nullable NSDictionary<UIApplicationLaunchOptionsKey, id> *)launchOptions; |
|
92 |
|
|
93 |
/** |
|
94 |
Initializes the SDK. |
|
95 |
|
|
96 |
If you are using the SDK within the context of the UIApplication lifecycle, do not use this method. |
|
97 |
Instead use `application: didFinishLaunchingWithOptions:`. |
|
98 |
|
|
99 |
As part of SDK initialization basic auto logging of app events will occur, this can be |
|
100 |
controlled via 'FacebookAutoLogAppEventsEnabled' key in the project info plist file. |
|
101 |
*/ |
|
102 |
- (void)initializeSDK; |
|
103 |
|
|
104 |
/** |
|
105 |
Adds an observer that will be informed about application lifecycle events. |
|
106 |
|
|
107 |
@note Observers are weakly held |
|
108 |
*/ |
|
109 |
- (void)addObserver:(id<FBSDKApplicationObserving>)observer; |
|
110 |
|
|
111 |
/** |
|
112 |
Removes an observer so that it will no longer be informed about application lifecycle events. |
|
113 |
|
|
114 |
@note Observers are weakly held |
|
115 |
*/ |
|
116 |
- (void)removeObserver:(id<FBSDKApplicationObserving>)observer; |
|
117 |
|
|
118 |
@end |
|
119 |
|
|
120 |
NS_ASSUME_NONNULL_END |