FIRInstallationsStoredItem.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. #import "FirebaseInstallations/Source/Library/InstallationsIDController/FIRInstallationsStatus.h"
  18. @class FIRInstallationsStoredAuthToken;
  19. @class FIRInstallationsStoredIIDCheckin;
  20. NS_ASSUME_NONNULL_BEGIN
  21. /**
  22. * The class is supposed to be used by `FIRInstallationsStore` only. It is required to
  23. * serialize/deserialize the installation data into/from `NSData` to be stored in Keychain.
  24. *
  25. * WARNING: Modification of the class properties can lead to incompatibility with the stored data
  26. * encoded by the previous class versions. Any modification must be evaluated and, if it is really
  27. * needed, the `storageVersion` must be bumped and proper migration code added.
  28. */
  29. @interface FIRInstallationsStoredItem : NSObject <NSSecureCoding>
  30. /// A stable identifier that uniquely identifies the app instance.
  31. @property(nonatomic, copy, nullable) NSString *firebaseInstallationID;
  32. /// The `refreshToken` is used to authorize the installation auth token requests.
  33. @property(nonatomic, copy, nullable) NSString *refreshToken;
  34. @property(nonatomic, nullable) FIRInstallationsStoredAuthToken *authToken;
  35. @property(nonatomic) FIRInstallationsStatus registrationStatus;
  36. /// Instance ID default auth token imported from IID store as a part of IID migration.
  37. @property(nonatomic, nullable) NSString *IIDDefaultToken;
  38. /// The version of local storage.
  39. @property(nonatomic, readonly) NSInteger storageVersion;
  40. @end
  41. NS_ASSUME_NONNULL_END