From 9d78e7d654c51c22ce4be87efef5bc1f8d5a2d08 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 31 Oct 2019 16:16:48 +0300 Subject: Fix authentication --- Juick/API.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Juick/API.h (limited to 'Juick/API.h') diff --git a/Juick/API.h b/Juick/API.h new file mode 100644 index 0000000..fcf9fb1 --- /dev/null +++ b/Juick/API.h @@ -0,0 +1,39 @@ +// +// APIClient.h +// Juick +// +// Created by Vitaly Takmazov on 22/08/16. +// Copyright © 2016 com.juick. All rights reserved. +// +#import +#import "Message.h" +#import "DeviceRegistration.h" + +@protocol JuickAuthorizationDelegate +-(void) unauthorized; +@end + +@interface API : NSObject + +@property (nonatomic, strong) id delegate; + +-(void) pullNextFromPath:(NSString *)path params:(NSDictionary *)params callback:(void(^)(NSArray*, NSError *))callback; +-(void) postMessage:(NSString *)text result:(void(^)(Message *, NSError *))callback; +-(void) postReplyToThread:(NSNumber *)mid inReplyTo:(NSNumber *)rid text:(NSString *)text result:(void(^)(Message *, NSError *))callback; +-(void) postPMToUser:(NSString *)uname text:(NSString *)text result:(void(^)(NSError *))callback; +-(void) fetchChats:(void(^)(NSArray *, NSError *))callback; +-(void) fetchChatWithUser:(NSString *)uname callback:(void(^)(NSArray *, NSError *))callback; +-(void) authenticateWithUser:(NSString *)username password:(NSString *)password callback:(void(^)(BOOL))completed; +-(void) signout; +-(void) me:(void(^)(User *, NSError *))callback; +-(void) refreshDeviceRegistration:(DeviceRegistration *)registrationData callback:(void(^)(BOOL))callback; +-(void) getUserByName:(NSString *) name callback:(void(^)(User *))callback; +-(void) fetchImageWithURL:(NSURL *) url callback:(void(^)(NSData *))callback; +@property (nonatomic, strong) User * currentUser; + ++(NSString *) messagesUrl; ++(NSString *) threadUrl; ++(NSString *) feedUrl; ++(NSString *) discussionsUrl; + +@end -- cgit v1.2.3