FIRAppCheckInterop.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright 2020 Google LLC
  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. @protocol FIRAppCheckTokenResultInterop;
  18. NS_ASSUME_NONNULL_BEGIN
  19. NS_SWIFT_NAME(AppCheckTokenHandlerInterop)
  20. typedef void (^FIRAppCheckTokenHandlerInterop)(id<FIRAppCheckTokenResultInterop> tokenResult);
  21. NS_SWIFT_NAME(AppCheckInterop) @protocol FIRAppCheckInterop
  22. /// Retrieve a cached or generate a new FAA Token. If forcingRefresh == YES always generates a new
  23. /// token and updates the cache.
  24. - (void)getTokenForcingRefresh:(BOOL)forcingRefresh
  25. completion:(FIRAppCheckTokenHandlerInterop)handler
  26. NS_SWIFT_NAME(getToken(forcingRefresh:completion:));
  27. /// Retrieve a new limited-use Firebase App Check token
  28. - (void)getLimitedUseTokenWithCompletion:(FIRAppCheckTokenHandlerInterop)handler
  29. NS_SWIFT_NAME(getLimitedUseToken(completion:));
  30. /// A notification with the specified name is sent to the default notification center
  31. /// (`NotificationCenter.default`) each time a Firebase app check token is refreshed.
  32. /// The user info dictionary contains `-[self notificationTokenKey]` and
  33. /// `-[self notificationAppNameKey]` keys.
  34. - (NSString *)tokenDidChangeNotificationName;
  35. /// `userInfo` key for the FAC token in a notification for `tokenDidChangeNotificationName`.
  36. - (NSString *)notificationTokenKey;
  37. /// `userInfo` key for the `FirebaseApp.name` in a notification for
  38. /// `tokenDidChangeNotificationName`.
  39. - (NSString *)notificationAppNameKey;
  40. @end
  41. NS_ASSUME_NONNULL_END