FIRMessagingCheckinStore.h 2.1 KB

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