ALCCommunicator.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // ALCCommunicator.h
  3. // AppLovinSDK
  4. //
  5. // Created by Thomas So on 7/4/19.
  6. //
  7. #import <AppLovinSDK/ALCSubscriber.h>
  8. @class ALCCommunicator;
  9. @class ALCMessagingService;
  10. NS_ASSUME_NONNULL_BEGIN
  11. /**
  12. * This communicator SDK acts as a hub for all SDK pub/sub communication.
  13. */
  14. @interface ALCCommunicator : NSObject
  15. /**
  16. * Add the provided subscriber to the set of subscribers for a given topic.
  17. */
  18. - (void)subscribe:(id<ALCSubscriber>)subscriber forTopic:(NSString *)topic;
  19. /**
  20. * Add the provided subscriber to the set of subscribers for the given topics.
  21. */
  22. - (void)subscribe:(id<ALCSubscriber>)subscriber forTopics:(NSArray<NSString *> *)topics;
  23. /**
  24. * Remove the provided subscriber from the set of subscribers for a given topic.
  25. */
  26. - (void)unsubscribe:(id<ALCSubscriber>)subscriber forTopic:(NSString *)topic;
  27. /**
  28. * Remove the provided subscriber from the set of subscribers for the given topics.
  29. */
  30. - (void)unsubscribe:(id<ALCSubscriber>)subscriber forTopics:(NSArray<NSString *> *)topics;
  31. /**
  32. * @return @c YES if the SDK will handle a published @c ALCMessage for a given @c topic.
  33. */
  34. - (BOOL)respondsToTopic:(NSString *)topic;
  35. /**
  36. * The messaging service for the communicator SDK responsible for relaying messages within the system.
  37. */
  38. @property (nonatomic, strong, readonly) ALCMessagingService *messagingService;
  39. /**
  40. * Returns the default communicator instance.
  41. */
  42. @property (class, strong, readonly) ALCCommunicator *defaultCommunicator;
  43. - (instancetype)init NS_UNAVAILABLE;
  44. + (instancetype)new NS_UNAVAILABLE;
  45. @end
  46. NS_ASSUME_NONNULL_END