XGInAppMessageManager.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // XGInAppMessageManager.h
  3. // XGInAppMessage
  4. //
  5. // Created by rockzuo on 2020/8/17.
  6. // Copyright © 2020 Tencent. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. /// XGInAppMessageManager事件代理
  11. @protocol XGInAppMessageActionDelegate <NSObject>
  12. @optional
  13. /// 通过下发的自定义参数去做响应
  14. /// @param actionDic 自定义事件字符串标识
  15. - (void)onClickWithCustomAction:(nullable NSDictionary *)actionDic;
  16. @end
  17. /// 消息管理类
  18. @interface XGInAppMessageManager : NSObject
  19. /// 开发者是否允许展示标识, 默认展示,如果您在某些场景不想展示应用内消息可将其置为YES
  20. @property (assign, nonatomic) BOOL refuseMessage;
  21. /// 设置消息展示的window
  22. @property (strong, nonatomic, nullable) UIWindow *targetWindow;
  23. /// 按钮事件响应代理
  24. @property (weak, nonatomic, nullable) id<XGInAppMessageActionDelegate> actionDelegate;
  25. /// 设置消息轮询时间间隔,最小值为10s,此方法需要在单例初始化之前调用
  26. + (void)setMessageTimerInterval:(NSTimeInterval)interval;
  27. /// 单例方法
  28. + (nonnull instancetype)defaultManager;
  29. /// 展示自定义消息
  30. /// @param messageInfo 应用内消息结构
  31. - (void)presentCustomMessage:(nullable NSDictionary *)messageInfo;
  32. /// 关闭消息视图
  33. - (void)dismissPopWindow;
  34. @end