VOMediaUploadManagerProtocol
@protocol VOMediaUploadManagerProtocol
VOMediaUploadManagerProtocol
is the interface for uploading VOVoucherMedia
.
Uploading events will be triggered to a manager implementing this interface.
-
Upload a
VOVoucherMedia
.Declaration
Objective-C
- (void)uploadMediaData:(NSData *)data withType:(VOVoucherMediaType)type path:(NSString *)path suffix:(NSString *)suffix contentType:(NSString *)contentType onSuccess:(void (^)(NSDictionary *))onSucceed onFail:(void (^)(NSError *))onFail;
Swift
func uploadMediaData(_ data: Data!, with type: VOVoucherMediaType, path: String!, suffix: String!, contentType: String!, onSuccess onSucceed: (([AnyHashable : Any]?) -> Void)!, onFail: ((Error?) -> Void)!)
Parameters
data
- the data representation of the
VOVoucherMedia
.type
- the
VOVoucherMediaType
of theVOVoucherMedia
to be uploaded.path
- the path to the Vouchr server’s v2 endpoint to retrieve the upload URL.
suffix
- the filename extension of the
VOVoucherMedia
.contentType
- the MIME type of the
VOVoucherMedia
.onSucceed
- success callblock when the request completes
onFail
- block to be executed upon failure of the request.