No Description

NSError+FIRInstanceID.h 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 <Foundation/Foundation.h>
  17. FOUNDATION_EXPORT NSString *const kFIRInstanceIDDomain;
  18. typedef NS_ENUM(NSUInteger, FIRInstanceIDErrorCode) {
  19. // Unknown error.
  20. kFIRInstanceIDErrorCodeUnknown = 0,
  21. // Http related errors.
  22. kFIRInstanceIDErrorCodeAuthentication = 1,
  23. kFIRInstanceIDErrorCodeNoAccess = 2,
  24. kFIRInstanceIDErrorCodeTimeout = 3,
  25. kFIRInstanceIDErrorCodeNetwork = 4,
  26. // Another operation is in progress.
  27. kFIRInstanceIDErrorCodeOperationInProgress = 5,
  28. // Failed to perform device check in.
  29. kFIRInstanceIDErrorCodeRegistrarFailedToCheckIn = 6,
  30. kFIRInstanceIDErrorCodeInvalidRequest = 7,
  31. // InstanceID generic errors
  32. kFIRInstanceIDErrorCodeMissingDeviceID = 501,
  33. // InstanceID Token specific errors
  34. kFIRInstanceIDErrorCodeMissingAPNSToken = 1001,
  35. kFIRInstanceIDErrorCodeMissingAPNSServerType = 1002,
  36. kFIRInstanceIDErrorCodeInvalidAuthorizedEntity = 1003,
  37. kFIRInstanceIDErrorCodeInvalidScope = 1004,
  38. kFIRInstanceIDErrorCodeInvalidStart = 1005,
  39. kFIRInstanceIDErrorCodeInvalidKeyPair = 1006,
  40. // InstanceID Identity specific errors
  41. // Generic InstanceID keypair error
  42. kFIRInstanceIDErrorCodeMissingKeyPair = 2001,
  43. kFIRInstanceIDErrorCodeInvalidKeyPairTags = 2002,
  44. kFIRInstanceIDErrorCodeInvalidKeyPairCreationTime = 2005,
  45. kFIRInstanceIDErrorCodeInvalidIdentity = 2006,
  46. };
  47. @interface NSError (FIRInstanceID)
  48. @property(nonatomic, readonly) FIRInstanceIDErrorCode instanceIDErrorCode;
  49. + (NSError *)errorWithFIRInstanceIDErrorCode:(FIRInstanceIDErrorCode)errorCode;
  50. + (NSError *)errorWithFIRInstanceIDErrorCode:(FIRInstanceIDErrorCode)errorCode
  51. userInfo:(NSDictionary *)userInfo;
  52. + (NSError *)FIRInstanceIDErrorMissingCheckin;
  53. @end