SEGSegmentationConstants.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. static NSString* const kFIRLoggerSegmentation = @"[Firebase/Segmentation]";
  28. /// Keys for values stored in the Segmentation SDK.
  29. static NSString* const kSEGFirebaseApplicationIdentifierKey = @"firebase_app_identifier";
  30. static NSString* const kSEGCustomInstallationIdentifierKey = @"custom_installation_identifier";
  31. static NSString* const kSEGFirebaseInstallationIdentifierKey = @"firebase_installation_identifier";
  32. static NSString* const kSEGAssociationStatusKey = @"association_status";
  33. /// Association Status
  34. static NSString* const kSEGAssociationStatusPending = @"PENDING";
  35. static NSString* const kSEGAssociationStatusAssociated = @"ASSOCIATED";
  36. /// Segmentation error domain when logging errors.
  37. kFirebaseSegmentationErrorDomain = @"com.firebase.segmentation";
  38. /// Segmentation FIRLogger domain.
  39. static NSString* const kFIRLoggerSegmentation = @"[Firebase/Segmentation]";
  40. /// Used for reporting generic internal Segmentation errors.
  41. NSString* const kSEGErrorDescription = @"SEGErrorDescription";
  42. /// Segmentation Request Completion callback.
  43. /// @param success Decide whether the network operation succeeds.
  44. /// @param result Return operation result data.
  45. typedef void (^SEGRequestCompletion)(BOOL success, NSDictionary<NSString*, id>* result);