FIRIAMClientInfoFetcher.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. */
  16. #import <Foundation/Foundation.h>
  17. @class FIRInstallations;
  18. // A class for wrapping the interactions for retrieving client side info to be used in
  19. // request parameter for interacting with Firebase iam servers.
  20. NS_ASSUME_NONNULL_BEGIN
  21. @interface FIRIAMClientInfoFetcher : NSObject
  22. - (instancetype)initWithFirebaseInstallations:(nullable FIRInstallations *)installations;
  23. - (instancetype)init NS_UNAVAILABLE;
  24. // Fetch the up-to-date Firebase Installation ID (FID) and Firebase Installation Service (FIS) token
  25. // data. Since it involves a server interaction, completion callback is provided for receiving the
  26. // result.
  27. - (void)fetchFirebaseInstallationDataWithProjectNumber:(NSString *)projectNumber
  28. withCompletion:
  29. (void (^)(NSString *_Nullable FID,
  30. NSString *_Nullable FISToken,
  31. NSError *_Nullable error))completion;
  32. // Following are synchronous methods for fetching data
  33. - (nullable NSString *)getDeviceLanguageCode;
  34. - (nullable NSString *)getAppVersion;
  35. - (nullable NSString *)getOSVersion;
  36. - (nullable NSString *)getOSMajorVersion;
  37. - (nullable NSString *)getTimezone;
  38. - (NSString *)getIAMSDKVersion;
  39. @end
  40. NS_ASSUME_NONNULL_END