SEGSegmentationConstants.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. #if defined(DEBUG)
  18. #define SEG_MUST_NOT_BE_MAIN_THREAD() \
  19. do { \
  20. NSAssert(![NSThread isMainThread], @"Must not be executing on the main thread."); \
  21. } while (0);
  22. #else
  23. #define SEG_MUST_NOT_BE_MAIN_THREAD() \
  24. do { \
  25. } while (0);
  26. #endif
  27. extern NSString* const kFIRLoggerSegmentation;
  28. /// Keys for values stored in the Segmentation SDK.
  29. extern NSString* const kSEGFirebaseApplicationIdentifierKey;
  30. extern NSString* const kSEGCustomInstallationIdentifierKey;
  31. extern NSString* const kSEGFirebaseInstallationIdentifierKey;
  32. extern NSString* const kSEGAssociationStatusKey;
  33. /// Association Status
  34. extern NSString* const kSEGAssociationStatusPending;
  35. extern NSString* const kSEGAssociationStatusAssociated;
  36. /// Segmentation error domain when logging errors.
  37. extern NSString* const kFirebaseSegmentationErrorDomain;
  38. /// Used for reporting generic internal Segmentation errors.
  39. extern NSString* const kSEGErrorDescription;
  40. /// Segmentation Request Completion callback.
  41. /// @param success Decide whether the network operation succeeds.
  42. /// @param result Return operation result data.
  43. typedef void (^SEGRequestCompletion)(BOOL success, NSDictionary<NSString*, id>* result);