|
4 | 4 |
|
5 | 5 | NS_ASSUME_NONNULL_BEGIN
|
6 | 6 |
|
7 |
| -/** |
8 |
| - * Provides App Delegate handlers to be used in your App Delegate. |
9 |
| - * |
10 |
| - * To save time integrating Firebase Analytics in an application, Firebase Analytics does not |
11 |
| - * require delegation implementation from the AppDelegate. Instead this is automatically done by |
12 |
| - * Firebase Analytics. Should you choose instead to delegate manually, you can turn off the App |
13 |
| - * Delegate Proxy by adding FirebaseAppDelegateProxyEnabled into your app's Info.plist and setting |
14 |
| - * it to NO, and adding the methods in this category to corresponding delegation handlers. |
15 |
| - * |
16 |
| - * To handle Universal Links, you must return `true` in |
17 |
| - * UIApplicationDelegate.application(_:didFinishLaunchingWithOptions:). |
18 |
| - */ |
| 7 | +/// Provides App Delegate handlers to be used in your App Delegate. |
| 8 | +/// |
| 9 | +/// To save time integrating Firebase Analytics in an application, Firebase Analytics does not |
| 10 | +/// require delegation implementation from the AppDelegate if neither SwiftUI nor UIScene lifecycle |
| 11 | +/// is adopted. Instead this is automatically done by Firebase Analytics. Should you choose instead |
| 12 | +/// to delegate manually, you can turn off the App Delegate Proxy by adding |
| 13 | +/// FirebaseAppDelegateProxyEnabled into your app's Info.plist and setting it to boolean `NO`, and |
| 14 | +/// adding the methods in this category to corresponding delegation handlers. |
| 15 | +/// |
| 16 | +/// To handle Universal Links, you must return `true` in |
| 17 | +/// `UIApplicationDelegate.application(_:didFinishLaunchingWithOptions:)`. |
19 | 18 | @interface FIRAnalytics (AppDelegate)
|
20 | 19 |
|
21 |
| -/** |
22 |
| - * Handles events related to a URL session that are waiting to be processed. |
23 |
| - * |
24 |
| - * For optimal use of Firebase Analytics, call this method from the |
25 |
| - * UIApplicationDelegate.application(_:handleEventsForBackgroundURLSession:completionHandler:) |
26 |
| - * method of the app delegate in your app. |
27 |
| - * |
28 |
| - * @param identifier The identifier of the URL session requiring attention. |
29 |
| - * @param completionHandler The completion handler to call when you finish processing the events. |
30 |
| - * Calling this completion handler lets the system know that your app's user interface is |
31 |
| - * updated and a new snapshot can be taken. |
32 |
| - */ |
| 20 | +/// Handles events related to a URL session that are waiting to be processed. |
| 21 | +/// |
| 22 | +/// 1. If SwiftUI lifecycle is adopted, call this method from |
| 23 | +/// `UIApplicationDelegate.application(_:handleEventsForBackgroundURLSession:completionHandler:)` |
| 24 | +/// in your app delegate. |
| 25 | +/// |
| 26 | +/// 2. If SwiftUI lifecycle is not adopted, Firebase Analytics does not require delegation |
| 27 | +/// implementation from the AppDelegate. If you choose instead to delegate manually, you can set |
| 28 | +/// FirebaseAppDelegateProxyEnabled to boolean `NO` in your app's Info.plist and call this method |
| 29 | +/// from |
| 30 | +/// `UIApplicationDelegate.application(_:handleEventsForBackgroundURLSession:completionHandler:)` |
| 31 | +/// in your app delegate. |
| 32 | +/// |
| 33 | +/// @param identifier The identifier of the URL session requiring attention. |
| 34 | +/// @param completionHandler The completion handler to call when you finish processing the events. |
| 35 | +/// Calling this completion handler lets the system know that your app's user interface is |
| 36 | +/// updated and a new snapshot can be taken. |
33 | 37 | + (void)handleEventsForBackgroundURLSession:(NSString *)identifier
|
34 | 38 | completionHandler:(nullable void (^)(void))completionHandler;
|
35 | 39 |
|
36 |
| -/** |
37 |
| - * Handles the event when the app is launched by a URL. |
38 |
| - * |
39 |
| - * Call this method from UIApplicationDelegate.application(_:open:options:) in your app. |
40 |
| - * |
41 |
| - * @param url The URL resource to open. This resource can be a network resource or a file. |
42 |
| - */ |
| 40 | +/// Handles the event when the app is launched by a URL (custom URL scheme or universal link). |
| 41 | +/// |
| 42 | +/// 1. If SwiftUI lifecycle is adopted, use `onOpenURL(perform:)` to register a handler and call |
| 43 | +/// this method in the handler. |
| 44 | +/// |
| 45 | +/// 2. If UIScene lifecycle is adopted, call this method from |
| 46 | +/// `UISceneDelegate.scene(_:willConnectTo:options:)` and |
| 47 | +/// `UISceneDelegate.scene(_:openURLContexts:)` when the URL contexts are available. |
| 48 | +/// |
| 49 | +/// 3. If neither SwiftUI nor UIScene lifecycle is adopted, Firebase Analytics does not require |
| 50 | +/// delegation implementation from the AppDelegate. If you choose instead to delegate manually, you |
| 51 | +/// can set FirebaseAppDelegateProxyEnabled to boolean `NO` in your app's Info.plist and call this |
| 52 | +/// method from `UIApplicationDelegate.application(_:open:options:)` in your app delegate. |
| 53 | +/// |
| 54 | +/// @param url The URL resource to open. This resource can be a network resource or a file. |
43 | 55 | + (void)handleOpenURL:(NSURL *)url;
|
44 | 56 |
|
45 |
| -/** |
46 |
| - * Handles the event when the app receives data associated with user activity that includes a |
47 |
| - * Universal Link. |
48 |
| - * |
49 |
| - * Call this method from UIApplication.application(_:continue:restorationHandler:) in your app |
50 |
| - * delegate. |
51 |
| - * |
52 |
| - * @param userActivity The activity object containing the data associated with the task the user |
53 |
| - * was performing. |
54 |
| - */ |
| 57 | +/// Handles the event when the app receives data associated with user activity that includes a |
| 58 | +/// Universal Link. |
| 59 | +/// |
| 60 | +/// 1. If SwiftUI lifecycle is adopted, use `onOpenURL(perform:)` to register a handler and call |
| 61 | +/// `Analytics.handleOpen(_:)` instead in the handler. |
| 62 | +/// |
| 63 | +/// 2. If UIScene lifecycle is adopted, call this method from |
| 64 | +/// `UISceneDelegate.scene(_:willConnectTo:options:)` and `UISceneDelegate.scene(_:continue:)` when |
| 65 | +/// NSUserActivity is available. See the [Apple |
| 66 | +/// doc](https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app) for |
| 67 | +/// more details. |
| 68 | +/// |
| 69 | +/// 3. If neither SwiftUI nor UIScene lifecycle is adopted, Firebase Analytics does not require |
| 70 | +/// delegation implementation from the AppDelegate. If you choose instead to delegate manually, you |
| 71 | +/// can set FirebaseAppDelegateProxyEnabled to boolean `NO` in your app's Info.plist and call this |
| 72 | +/// method from `UIApplication.application(_:continue:restorationHandler:)` in your app delegate. |
| 73 | +/// |
| 74 | +/// @param userActivity The activity object containing the data associated with the task the user |
| 75 | +/// was performing. |
55 | 76 | + (void)handleUserActivity:(id)userActivity;
|
56 | 77 |
|
57 | 78 | @end
|
58 | 79 |
|
59 | 80 | NS_ASSUME_NONNULL_END
|
60 |
| - |
|
0 commit comments