added iOS source code
[wl-app.git] / iOS / Pods / FirebaseMessaging / Firebase / Messaging / FIRMessagingCheckinService.h
1 /*
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 /**
20  * Register the device with Checkin Service and get back the `authID`, `secret token` etc. for the
21  * client. Checkin results are cached in the `FIRMessagingDefaultsManager` and periodically refreshed to
22  * prevent them from being stale. Each client needs to register with checkin before registering
23  * with FIRMessaging.
24  */
25 @interface FIRMessagingCheckinService : NSObject
26
27 @property(nonatomic, readonly, strong) NSString *deviceAuthID;
28 @property(nonatomic, readonly, strong) NSString *secretToken;
29 @property(nonatomic, readonly, strong) NSString *versionInfo;
30 @property(nonatomic, readonly, assign) BOOL hasValidCheckinInfo;
31
32 /**
33  *  Verify if valid checkin preferences have been loaded in memory.
34  *
35  *  @return YES if valid checkin preferences exist in memory else NO.
36  */
37 - (BOOL)hasValidCheckinInfo;
38
39 /**
40  *  Try to load prefetched checkin preferences from the cache. This supports the use case where
41  *  InstanceID library has already obtained a valid checkin and we should be using that.
42  *
43  *  This should be used as a last gasp effort to retreive any cached checkin preferences before
44  *  hitting the FIRMessaging backend to retrieve new preferences.
45  *
46  *  Note this is only required because InstanceID and FIRMessaging both require checkin preferences which
47  *  need to be synced with each other.
48  *
49  *  @return YES if successfully loaded cached checkin preferences into memory else NO.
50  */
51 - (BOOL)tryToLoadPrefetchedCheckinPreferences;
52
53 @end