No Description

FIRInstanceIDCheckinPreferences.h 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. #import <Foundation/Foundation.h>
  17. /**
  18. * The preferences InstanceID loads from checkin server. The deviceID and secret that checkin
  19. * provides is used to authenticate all future requests to the server. Besides the deviceID
  20. * and secret the other information that checkin provides is stored in a plist on the device.
  21. * The deviceID and secret are persisted in the device keychain.
  22. */
  23. @interface FIRInstanceIDCheckinPreferences : NSObject
  24. /**
  25. * DeviceID and secretToken are the checkin auth credentials and are stored in the Keychain.
  26. */
  27. @property(nonatomic, readonly, copy) NSString *deviceID;
  28. @property(nonatomic, readonly, copy) NSString *secretToken;
  29. /**
  30. * All the other checkin preferences other than deviceID and secret are stored in a plist.
  31. */
  32. @property(nonatomic, readonly, copy) NSString *deviceDataVersion;
  33. @property(nonatomic, readonly, copy) NSString *digest;
  34. @property(nonatomic, readonly, copy) NSString *versionInfo;
  35. @property(nonatomic, readonly, strong) NSMutableDictionary *gServicesData;
  36. @property(nonatomic, readonly, assign) int64_t lastCheckinTimestampMillis;
  37. /**
  38. * The content retrieved from checkin server that should be persisted in a plist. This
  39. * doesn't contain the deviceID and secret which are stored in the Keychain since they
  40. * should be more private.
  41. *
  42. * @return The checkin preferences that should be persisted in a plist.
  43. */
  44. - (NSDictionary *)checkinPlistContents;
  45. /**
  46. * Return whether checkin info exists, valid or not.
  47. */
  48. - (BOOL)hasCheckinInfo;
  49. /**
  50. * Verify if checkin preferences are valid or not.
  51. *
  52. * @return YES if valid checkin preferences else NO.
  53. */
  54. - (BOOL)hasValidCheckinInfo;
  55. @end