FUNContext.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // Copyright 2017 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. #import <Foundation/Foundation.h>
  16. @class FIRApp;
  17. @protocol FIRAppCheckInterop;
  18. @protocol FIRAuthInterop;
  19. @protocol FIRMessagingInterop;
  20. NS_ASSUME_NONNULL_BEGIN
  21. /**
  22. * FUNContext is a helper class for gathering metadata for a function call.
  23. */
  24. @interface FUNContext : NSObject
  25. - (id)init NS_UNAVAILABLE;
  26. @property(nonatomic, copy, nullable, readonly) NSString *authToken;
  27. @property(nonatomic, copy, nullable, readonly) NSString *FCMToken;
  28. /// Firebase app check (FAC) token if available.
  29. @property(nonatomic, copy, nullable, readonly) NSString *appCheckToken;
  30. @end
  31. /**
  32. * A FUNContextProvider gathers metadata and creats a FUNContext.
  33. */
  34. @interface FUNContextProvider : NSObject
  35. - (id)init NS_UNAVAILABLE;
  36. - (instancetype)initWithAuth:(nullable id<FIRAuthInterop>)auth
  37. messaging:(nullable id<FIRMessagingInterop>)messaging
  38. appCheck:(nullable id<FIRAppCheckInterop>)appCheck NS_DESIGNATED_INITIALIZER;
  39. - (void)getContext:(void (^)(FUNContext *context, NSError *_Nullable error))completion;
  40. @end
  41. NS_ASSUME_NONNULL_END