40 lines
1.1 KiB
Objective-C
40 lines
1.1 KiB
Objective-C
//
|
|
// AVApiService.h
|
|
// SellyCloudSDK_Example
|
|
//
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
@class AVLiveStreamModel;
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
typedef void(^AVApiSuccess)(id _Nullable responseObject);
|
|
typedef void(^AVApiFailure)(NSError *error);
|
|
|
|
@interface AVApiService : NSObject
|
|
|
|
+ (instancetype)shared;
|
|
|
|
/// GET /live/sdk/alive-list
|
|
- (void)fetchLiveStreams:(void(^)(NSArray<AVLiveStreamModel *> *streams))success
|
|
failure:(nullable AVApiFailure)failure;
|
|
|
|
/// POST /live/sdk/demo/stream-xor
|
|
- (void)reportXorKeyWithVhost:(NSString *)vhost
|
|
app:(NSString *)app
|
|
stream:(NSString *)stream
|
|
xorKey:(nullable NSString *)xorKey
|
|
success:(nullable AVApiSuccess)success
|
|
failure:(nullable AVApiFailure)failure;
|
|
|
|
/// POST /live/sdk/demo/login
|
|
- (void)loginWithUsername:(NSString *)username
|
|
password:(NSString *)password
|
|
success:(void(^)(id responseObject))success
|
|
failure:(void(^)(NSError *error, NSString * _Nullable serverMessage))failure;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|