1 |
efrain |
1 |
// Copyright 2019 Google
|
|
|
2 |
//
|
|
|
3 |
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
4 |
// you may not use this file except in compliance with the License.
|
|
|
5 |
// You may obtain a copy of the License at
|
|
|
6 |
//
|
|
|
7 |
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
8 |
//
|
|
|
9 |
// Unless required by applicable law or agreed to in writing, software
|
|
|
10 |
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
12 |
// See the License for the specific language governing permissions and
|
|
|
13 |
// limitations under the License.
|
|
|
14 |
|
|
|
15 |
#import <Foundation/Foundation.h>
|
|
|
16 |
|
|
|
17 |
NS_ASSUME_NONNULL_BEGIN
|
|
|
18 |
|
|
|
19 |
/**
|
|
|
20 |
* A FIRCLSDataCollectionToken represents having permission to upload data. A data collection token
|
|
|
21 |
* is either valid or nil. Every function that directly initiates a network operation that will
|
|
|
22 |
* result in data collection must check to make sure it has been passed a valid token. Tokens should
|
|
|
23 |
* only be created when either (1) automatic data collection is enabled, or (2) the user has
|
|
|
24 |
* explicitly given permission to collect data for a particular purpose, using the API. For all the
|
|
|
25 |
* functions in between, the data collection token getting passed as an argument helps to document
|
|
|
26 |
* and enforce the flow of data collection permission through the SDK.
|
|
|
27 |
*/
|
|
|
28 |
@interface FIRCLSDataCollectionToken : NSObject
|
|
|
29 |
|
|
|
30 |
/**
|
|
|
31 |
* Creates a valid token. Only call this method when either (1) automatic data collection is
|
|
|
32 |
* enabled, or (2) the user has explicitly given permission to collect data for a particular
|
|
|
33 |
* purpose, using the API.
|
|
|
34 |
*/
|
|
|
35 |
+ (instancetype)validToken;
|
|
|
36 |
|
|
|
37 |
/**
|
|
|
38 |
* Use this to verify that a token is valid. If this is called on a nil instance, it will return
|
|
|
39 |
* false.
|
|
|
40 |
* @return true.
|
|
|
41 |
*/
|
|
|
42 |
- (BOOL)isValid;
|
|
|
43 |
|
|
|
44 |
@end
|
|
|
45 |
|
|
|
46 |
NS_ASSUME_NONNULL_END
|