1 |
efrain |
1 |
/*
|
|
|
2 |
* Copyright 2019 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 |
@class FIRMessagingAuthKeychain;
|
|
|
20 |
@class FIRMessagingBackupExcludedPlist;
|
|
|
21 |
@class FIRMessagingCheckinPreferences;
|
|
|
22 |
|
|
|
23 |
// These values exposed for testing
|
|
|
24 |
extern NSString *const kFIRMessagingCheckinKeychainService;
|
|
|
25 |
|
|
|
26 |
/**
|
|
|
27 |
* Checkin preferences backing store.
|
|
|
28 |
*/
|
|
|
29 |
@interface FIRMessagingCheckinStore : NSObject
|
|
|
30 |
|
|
|
31 |
/**
|
|
|
32 |
* Checks whether the backup excluded checkin preferences are present on the disk or not.
|
|
|
33 |
*
|
|
|
34 |
* @return YES if the backup excluded checkin plist exists on the disks else NO.
|
|
|
35 |
*/
|
|
|
36 |
- (BOOL)hasCheckinPlist;
|
|
|
37 |
|
|
|
38 |
#pragma mark - Save
|
|
|
39 |
|
|
|
40 |
/**
|
|
|
41 |
* Save the checkin preferences to backing store.
|
|
|
42 |
*
|
|
|
43 |
* @param preferences Checkin preferences to save.
|
|
|
44 |
* @param handler The callback handler which is invoked when the operation is complete,
|
|
|
45 |
* with an error if there is any.
|
|
|
46 |
*/
|
|
|
47 |
- (void)saveCheckinPreferences:(FIRMessagingCheckinPreferences *)preferences
|
|
|
48 |
handler:(void (^)(NSError *error))handler;
|
|
|
49 |
|
|
|
50 |
#pragma mark - Delete
|
|
|
51 |
|
|
|
52 |
/**
|
|
|
53 |
* Remove the cached checkin preferences.
|
|
|
54 |
*
|
|
|
55 |
* @param handler The callback handler which is invoked when the operation is complete,
|
|
|
56 |
* with an error if there is any.
|
|
|
57 |
*/
|
|
|
58 |
- (void)removeCheckinPreferencesWithHandler:(void (^)(NSError *error))handler;
|
|
|
59 |
|
|
|
60 |
#pragma mark - Get
|
|
|
61 |
|
|
|
62 |
/**
|
|
|
63 |
* Get the cached device secret. If we cannot access it for some reason we
|
|
|
64 |
* return the appropriate error object.
|
|
|
65 |
*
|
|
|
66 |
* @return The cached checkin preferences if present else nil.
|
|
|
67 |
*/
|
|
|
68 |
- (FIRMessagingCheckinPreferences *)cachedCheckinPreferences;
|
|
|
69 |
|
|
|
70 |
@end
|