commit | author | age
|
a6c014
|
1 |
/* |
L |
2 |
* Copyright 2017 Google |
|
3 |
* |
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
* you may not use this file except in compliance with the License. |
|
6 |
* You may obtain a copy of the License at |
|
7 |
* |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
* See the License for the specific language governing permissions and |
|
14 |
* limitations under the License. |
|
15 |
*/ |
|
16 |
|
|
17 |
#import <Foundation/Foundation.h> |
|
18 |
|
|
19 |
NS_ASSUME_NONNULL_BEGIN |
|
20 |
|
|
21 |
/** |
|
22 |
* This class provides constant fields of Google APIs. |
|
23 |
*/ |
|
24 |
NS_SWIFT_NAME(FirebaseOptions) |
|
25 |
@interface FIROptions : NSObject <NSCopying> |
|
26 |
|
|
27 |
/** |
|
28 |
* Returns the default options. The first time this is called it synchronously reads |
|
29 |
* GoogleService-Info.plist from disk. |
|
30 |
*/ |
|
31 |
+ (nullable FIROptions *)defaultOptions NS_SWIFT_NAME(defaultOptions()); |
|
32 |
|
|
33 |
/** |
aca600
|
34 |
* An API key used for authenticating requests from your Apple app, e.g. |
L |
35 |
* The key must begin with "A" and contain exactly 39 alphanumeric characters, used to identify your |
|
36 |
* app to Google servers. |
a6c014
|
37 |
*/ |
L |
38 |
@property(nonatomic, copy, nullable) NSString *APIKey NS_SWIFT_NAME(apiKey); |
|
39 |
|
|
40 |
/** |
aca600
|
41 |
* The bundle ID for the application. Defaults to `Bundle.main.bundleIdentifier` when not set |
a6c014
|
42 |
* manually or in a plist. |
L |
43 |
*/ |
|
44 |
@property(nonatomic, copy) NSString *bundleID; |
|
45 |
|
|
46 |
/** |
aca600
|
47 |
* The OAuth2 client ID for Apple applications used to authenticate Google users, for example |
a6c014
|
48 |
* @"12345.apps.googleusercontent.com", used for signing in with Google. |
L |
49 |
*/ |
|
50 |
@property(nonatomic, copy, nullable) NSString *clientID; |
|
51 |
|
|
52 |
/** |
aca600
|
53 |
* Unused. |
a6c014
|
54 |
*/ |
aca600
|
55 |
@property(nonatomic, copy, nullable) NSString *trackingID DEPRECATED_ATTRIBUTE; |
a6c014
|
56 |
|
L |
57 |
/** |
|
58 |
* The Project Number from the Google Developer's console, for example @"012345678901", used to |
aca600
|
59 |
* configure Firebase Cloud Messaging. |
a6c014
|
60 |
*/ |
L |
61 |
@property(nonatomic, copy) NSString *GCMSenderID NS_SWIFT_NAME(gcmSenderID); |
|
62 |
|
|
63 |
/** |
|
64 |
* The Project ID from the Firebase console, for example @"abc-xyz-123". |
|
65 |
*/ |
|
66 |
@property(nonatomic, copy, nullable) NSString *projectID; |
|
67 |
|
|
68 |
/** |
aca600
|
69 |
* Unused. |
a6c014
|
70 |
*/ |
aca600
|
71 |
@property(nonatomic, copy, nullable) NSString *androidClientID DEPRECATED_ATTRIBUTE; |
a6c014
|
72 |
|
L |
73 |
/** |
|
74 |
* The Google App ID that is used to uniquely identify an instance of an app. |
|
75 |
*/ |
|
76 |
@property(nonatomic, copy) NSString *googleAppID; |
|
77 |
|
|
78 |
/** |
|
79 |
* The database root URL, e.g. @"http://abc-xyz-123.firebaseio.com". |
|
80 |
*/ |
|
81 |
@property(nonatomic, copy, nullable) NSString *databaseURL; |
|
82 |
|
|
83 |
/** |
|
84 |
* The URL scheme used to set up Durable Deep Link service. |
|
85 |
*/ |
|
86 |
@property(nonatomic, copy, nullable) NSString *deepLinkURLScheme; |
|
87 |
|
|
88 |
/** |
|
89 |
* The Google Cloud Storage bucket name, e.g. @"abc-xyz-123.storage.firebase.com". |
|
90 |
*/ |
|
91 |
@property(nonatomic, copy, nullable) NSString *storageBucket; |
|
92 |
|
|
93 |
/** |
|
94 |
* The App Group identifier to share data between the application and the application extensions. |
|
95 |
* The App Group must be configured in the application and on the Apple Developer Portal. Default |
|
96 |
* value `nil`. |
|
97 |
*/ |
|
98 |
@property(nonatomic, copy, nullable) NSString *appGroupID; |
|
99 |
|
|
100 |
/** |
aca600
|
101 |
* Initializes a customized instance of FirebaseOptions from the file at the given plist file path. |
L |
102 |
* This will read the file synchronously from disk. |
|
103 |
* For example: |
|
104 |
* ```swift |
|
105 |
* if let path = Bundle.main.path(forResource:"GoogleServices-Info", ofType:"plist") { |
|
106 |
* let options = FirebaseOptions(contentsOfFile: path) |
|
107 |
* } |
|
108 |
* ``` |
|
109 |
* Note that it is not possible to customize `FirebaseOptions` for Firebase Analytics which expects |
|
110 |
* a static file named `GoogleServices-Info.plist` - |
|
111 |
* https://github.com/firebase/firebase-ios-sdk/issues/230. |
|
112 |
* Returns `nil` if the plist file does not exist or is invalid. |
a6c014
|
113 |
*/ |
454098
|
114 |
- (nullable instancetype)initWithContentsOfFile:(NSString *)plistPath NS_DESIGNATED_INITIALIZER; |
a6c014
|
115 |
|
L |
116 |
/** |
aca600
|
117 |
* Initializes a customized instance of `FirebaseOptions` with required fields. Use the mutable |
L |
118 |
* properties to modify fields for configuring specific services. Note that it is not possible to |
|
119 |
* customize `FirebaseOptions` for Firebase Analytics which expects a static file named |
|
120 |
* `GoogleServices-Info.plist` - https://github.com/firebase/firebase-ios-sdk/issues/230. |
a6c014
|
121 |
*/ |
L |
122 |
- (instancetype)initWithGoogleAppID:(NSString *)googleAppID |
|
123 |
GCMSenderID:(NSString *)GCMSenderID |
aca600
|
124 |
NS_SWIFT_NAME(init(googleAppID:gcmSenderID:))NS_DESIGNATED_INITIALIZER; |
a6c014
|
125 |
|
454098
|
126 |
/** Unavailable. Please use `init(contentsOfFile:)` or `init(googleAppID:gcmSenderID:)` instead. */ |
L |
127 |
- (instancetype)init NS_UNAVAILABLE; |
|
128 |
|
a6c014
|
129 |
@end |
L |
130 |
|
|
131 |
NS_ASSUME_NONNULL_END |