commit | author | age
|
a6c014
|
1 |
#import <Foundation/Foundation.h> |
L |
2 |
|
|
3 |
#import "FIRAnalytics.h" |
|
4 |
|
|
5 |
NS_ASSUME_NONNULL_BEGIN |
|
6 |
|
aca600
|
7 |
/// Provides App Delegate handlers to be used in your App Delegate. |
L |
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:)`. |
a6c014
|
18 |
@interface FIRAnalytics (AppDelegate) |
L |
19 |
|
aca600
|
20 |
/// Handles events related to a URL session that are waiting to be processed. |
L |
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. |
a6c014
|
37 |
+ (void)handleEventsForBackgroundURLSession:(NSString *)identifier |
L |
38 |
completionHandler:(nullable void (^)(void))completionHandler; |
|
39 |
|
aca600
|
40 |
/// Handles the event when the app is launched by a URL (custom URL scheme or universal link). |
L |
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. |
a6c014
|
55 |
+ (void)handleOpenURL:(NSURL *)url; |
L |
56 |
|
aca600
|
57 |
/// Handles the event when the app receives data associated with user activity that includes a |
L |
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. |
a6c014
|
76 |
+ (void)handleUserActivity:(id)userActivity; |
L |
77 |
|
|
78 |
@end |
|
79 |
|
|
80 |
NS_ASSUME_NONNULL_END |