You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.3 KiB

6 years ago
6 years ago
6 years ago
5 years ago
6 years ago
6 years ago
6 years ago
5 years ago
6 years ago
6 years ago
6 years ago
  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 <FirebaseInstanceID/FIRInstanceID.h>
  17. NS_ASSUME_NONNULL_BEGIN
  18. @class FIRInstanceIDCheckinPreferences;
  19. @class FIRInstallations;
  20. /**
  21. * Private API used by other Firebase SDKs.
  22. */
  23. @interface FIRInstanceID ()
  24. @property(nonatomic, readonly, strong) NSString *deviceAuthID;
  25. @property(nonatomic, readonly, strong) NSString *secretToken;
  26. @property(nonatomic, readonly, strong) NSString *versionInfo;
  27. @property(nonatomic, readonly, strong) FIRInstallations *installations;
  28. /// A cached value of FID. Should be used only for `-[FIRInstanceID appInstanceID:]`.
  29. @property(atomic, readonly, copy, nullable) NSString *firebaseInstallationsID;
  30. /**
  31. * Private initializer.
  32. */
  33. - (instancetype)initPrivately;
  34. /**
  35. * Returns a Firebase Messaging scoped token for the firebase app.
  36. *
  37. * @return Returns the stored token if the device has registered with Firebase Messaging, otherwise
  38. * returns nil.
  39. */
  40. - (nullable NSString *)token;
  41. /**
  42. * Verify if valid checkin preferences have been loaded in memory.
  43. *
  44. * @return YES if valid checkin preferences exist in memory else NO.
  45. */
  46. - (BOOL)hasValidCheckinInfo;
  47. /**
  48. * Try to load prefetched checkin preferences from the cache. This supports the use case where
  49. * InstanceID library has already obtained a valid checkin and we should be using that.
  50. *
  51. * This should be used as a last gasp effort to retreive any cached checkin preferences before
  52. * hitting the FIRMessaging backend to retrieve new preferences.
  53. *
  54. * Note this is only required because InstanceID and FIRMessaging both require checkin preferences
  55. * which need to be synced with each other.
  56. *
  57. * @return YES if successfully loaded cached checkin preferences into memory else NO.
  58. */
  59. - (BOOL)tryToLoadValidCheckinInfo;
  60. @end
  61. NS_ASSUME_NONNULL_END