New 'isConnected' API

Summary: Expose the newly created `isConnected` API to iOS FlipperClient API.

Reviewed By: antonk52

Differential Revision: D46841190

fbshipit-source-id: c36eb08427d60c73fad8f92100df5d012149b4a8
This commit is contained in:
Lorenzo Blasa
2023-06-20 00:46:55 -07:00
committed by Facebook GitHub Bot
parent 7cec520729
commit 63f8c47cfa
2 changed files with 20 additions and 9 deletions

View File

@@ -13,7 +13,7 @@
#import "FlipperStateUpdateListener.h"
/**
Represents a connection between the Sonar desktop och client side. Manages the
Represents a connection between the Flipper desktop client side. Manages the
lifecycle of attached plugin instances.
*/
@interface FlipperClient : NSObject
@@ -41,41 +41,48 @@ this client.
- (NSObject<FlipperPlugin>*)pluginWithIdentifier:(NSString*)identifier;
/**
Establish a connection to the Sonar desktop.
Establish a connection to the Flipper desktop.
*/
- (void)start;
/**
Stop the connection to the Sonar desktop.
Stop the connection to the Flipper desktop.
*/
- (void)stop;
/**
Get the log of state changes from the sonar client
Get the log of state changes from the Flipper client.
*/
- (NSString*)getState;
/**
Get the current summarized state of the sonar client
Get the current summarized state of the Flipper client.
*/
- (NSArray<NSDictionary*>*)getStateElements;
/**
Subscribe a ViewController to state update change notifications
Return true if the app is connected to Flipper desktop. Otherwise, returns
false.
*/
- (BOOL)isConnected;
/**
Subscribe a ViewController to state update change notifications.
*/
- (void)subscribeForUpdates:(id<FlipperStateUpdateListener>)controller;
/**
Sets the certificate provider responsible for obtaining certificates
Sets the certificate provider responsible for obtaining certificates.
*/
- (void)setCertificateProvider:(id<FlipperKitCertificateProvider>)provider;
/**
Get the certificate provider of Flipper Client
Get the certificate provider of Flipper Client.
*/
- (id<FlipperKitCertificateProvider>)getCertificateProvider;
// initializers are disabled. You must use `+[FlipperClient sharedClient]`
// Initializers are disabled. You must use `+[FlipperClient sharedClient]`
// instance.
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;