Geen omschrijving

FIRInstanceID_Private.h 2.1KB

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