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.

56 lines
1.7 KiB

5 years ago
5 years ago
5 years ago
5 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 "FIRInstanceID+Private.h"
  17. #import <FirebaseInstallations/FirebaseInstallations.h>
  18. #import <FirebaseInstanceID/FIRInstanceID_Private.h>
  19. #import "FIRInstanceIDAuthService.h"
  20. #import "FIRInstanceIDDefines.h"
  21. #import "FIRInstanceIDTokenManager.h"
  22. @class FIRInstallations;
  23. @interface FIRInstanceID ()
  24. @property(nonatomic, readonly, strong) FIRInstanceIDTokenManager *tokenManager;
  25. @end
  26. @implementation FIRInstanceID (Private)
  27. // This method just wraps our pre-configured auth service to make the request.
  28. // This method is only needed by first-party users, like Remote Config.
  29. - (void)fetchCheckinInfoWithHandler:(FIRInstanceIDDeviceCheckinCompletion)handler {
  30. [self.tokenManager.authService fetchCheckinInfoWithHandler:handler];
  31. }
  32. // TODO(#4486): Delete the method, `self.firebaseInstallationsID` and related
  33. // code for Firebase 7 release.
  34. - (NSString *)appInstanceID:(NSError **)outError {
  35. return self.firebaseInstallationsID;
  36. }
  37. #pragma mark - Firebase Installations Compatibility
  38. /// Presence of this method indicates that this version of IID uses FirebaseInstallations under the
  39. /// hood. It is checked by FirebaseInstallations SDK.
  40. + (BOOL)usesFIS {
  41. return YES;
  42. }
  43. @end