SEGSegmentationConstants.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. #ifndef SEGSegmentationConstants_h
  18. #define SEGSegmentationConstants_h
  19. #if defined(DEBUG)
  20. #define SEG_MUST_NOT_BE_MAIN_THREAD() \
  21. do { \
  22. NSAssert(![NSThread isMainThread], @"Must not be executing on the main thread."); \
  23. } while (0);
  24. #else
  25. #define SEG_MUST_NOT_BE_MAIN_THREAD() \
  26. do { \
  27. } while (0);
  28. #endif
  29. static NSString* const kFIRLoggerSegmentation = @"[Firebase/Segmentation]";
  30. /// Keys for values stored in the Segmentation SDK.
  31. static NSString* const kSEGFirebaseApplicationIdentifierKey = @"firebase_app_identifier";
  32. static NSString* const kSEGCustomInstallationIdentifierKey = @"custom_installation_identifier";
  33. static NSString* const kSEGFirebaseInstallationIdentifierKey = @"firebase_installation_identifier";
  34. static NSString* const kSEGAssociationStatusKey = @"association_status";
  35. /// Association Status
  36. static NSString* const kSEGAssociationStatusPending = @"PENDING";
  37. static NSString* const kSEGAssociationStatusAssociated = @"ASSOCIATED";
  38. /// Segmentation error domain when logging errors.
  39. static NSString* const kFirebaseSegmentationErrorDomain = @"com.firebase.segmentation";
  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);
  44. #endif /* SEGSegmentationConstants_h */