You've already forked hotpocket
BTHLABS-58: Share Extension in Apple Apps
This commit is contained in:
44
services/apple/Shared (App)/HPRPCClient.h
Normal file
44
services/apple/Shared (App)/HPRPCClient.h
Normal file
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// HPRPCClient.h
|
||||
// HotPocket
|
||||
//
|
||||
// Created by Tomek Wójcik on 19/09/2025.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface HPRPCCallResult : NSObject
|
||||
|
||||
@property (nullable) NSError *error;
|
||||
@property (nullable) id result;
|
||||
|
||||
@end
|
||||
|
||||
@protocol HPRPCClientDelegate <NSObject>
|
||||
|
||||
-(void)rpcClientDidReceiveResult:(HPRPCCallResult *)result callId:(NSString *)callId;
|
||||
|
||||
@end
|
||||
|
||||
typedef void (^HPRPCClientCompletionHandler)(NSString * _Nullable callId, HPRPCCallResult * _Nullable result);
|
||||
|
||||
@interface HPRPCClient : NSObject
|
||||
|
||||
@property (nonatomic, weak) id<HPRPCClientDelegate> delegate;
|
||||
@property NSURL *baseURL;
|
||||
@property NSString *accessToken;
|
||||
@property NSURLSession *session;
|
||||
|
||||
-(id)initWithBaseURL:(nullable NSURL *)baseURL accessToken:(nullable NSString *)accessToken;
|
||||
|
||||
-(BOOL)hasCredentials;
|
||||
-(BOOL)call:(nullable NSString *)callId method:(NSString *)method params:(NSArray *)params endopoint:(nullable NSString *)endpoint completionHandler:(HPRPCClientCompletionHandler)completionHandler;
|
||||
-(BOOL)call:(nullable NSString *)callId method:(NSString *)method params:(NSArray *)params endopoint:(nullable NSString *)endpoint;
|
||||
-(BOOL)call:(nullable NSString *)callId method:(NSString *)method params:(NSArray *)params;
|
||||
-(BOOL)call:(nullable NSString *)callId method:(NSString *)method params:(NSArray *)params completionHandler:(HPRPCClientCompletionHandler)completionHandler;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
Reference in New Issue
Block a user