PBSDK.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. //
  2. // PBSDK.h
  3. // PBSDK
  4. //
  5. // Created by mbp on 2024/12/8.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import "PBUserInfo.h"
  9. //#define HXAppKey @"1104241202169398#demo"
  10. #define HXAppKey @"1104241202169398#live-video"
  11. #define RtcAppId @"f27f43da2ed24e68ac07e11124011d35"
  12. @import AgoraRtcKit;
  13. NS_ASSUME_NONNULL_BEGIN
  14. @protocol PBSDKDelegate <NSObject>
  15. - (void)pb_rtcEngineRequestToken:(AgoraRtcEngineKit *)engine;
  16. - (void)pb_rtcEngine:(AgoraRtcEngineKit *)engine didJoinedOfUid:(NSUInteger)uid elapsed:(NSInteger)elapsed;
  17. - (void)pb_rtcEngine:(AgoraRtcEngineKit *)engine didOfflineOfUid:(NSUInteger)uid reason:(AgoraUserOfflineReason)reason;
  18. - (void)pb_rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine remoteVideoStateChangedOfUid:(NSUInteger)uid state:(AgoraVideoRemoteState)state reason:(AgoraVideoRemoteReason)reason elapsed:(NSInteger)elapsed;
  19. @end
  20. @interface PBAgoraRtcEngineKitCfg: NSObject
  21. /// 声网 appId
  22. @property (nonatomic, copy) NSString *appId;
  23. @end
  24. @interface PBSDK : NSObject
  25. @property (nonatomic,assign) BOOL isUser;//是否是用户 不是则为主播
  26. @property(nonatomic,copy) void (^moduleKeepAliveCallback)(id result, BOOL keepAlive);
  27. @property (nonatomic, weak ) id <PBSDKDelegate> delegate;
  28. @property(nonatomic,copy) void (^navigateToVuePageBlock)(NSString *url);
  29. @property (nonatomic, copy ) NSString *accessToken;
  30. @property (nonatomic, copy ) NSNumber *expiresTime;
  31. @property (nonatomic, copy ) NSString *refreshToken;
  32. @property (nonatomic, strong) AgoraRtcEngineKit *agoraRtcEngineKit;
  33. + (PBSDK *)shared;
  34. + (void)initSDK;
  35. + (BOOL)isLogin;
  36. @property (nonatomic,strong) PBUserInfo *userinfo;
  37. - (void)loginUser;
  38. - (void)openLive;
  39. ///初始化环形
  40. - (void)initiateIM;
  41. + (UIViewController *)yt_topmostViewController;
  42. + (UIViewController *)dc_findCurrentShowingViewController;
  43. @end
  44. NS_ASSUME_NONNULL_END