Add isMethodSupported handler
Summary: Allows plugin to check if something is supported by that app, for example an extension command or a new feature, before trying to use it. Reviewed By: passy Differential Revision: D14225957 fbshipit-source-id: 3c5a29a06b56fe5f1da772824232547447872344
This commit is contained in:
committed by
Facebook Github Bot
parent
dbb4fa1191
commit
40ada838d7
@@ -53,6 +53,13 @@ class FlipperConnectionImpl : public FlipperConnection {
|
||||
receivers_[method] = receiver;
|
||||
}
|
||||
|
||||
/**
|
||||
Runtime check which receivers are supported for this app
|
||||
*/
|
||||
bool hasReceiver(const std::string& method) {
|
||||
return receivers_.find(method) != receivers_.end();
|
||||
}
|
||||
|
||||
private:
|
||||
FlipperConnectionManager* socket_;
|
||||
std::string name_;
|
||||
|
||||
Reference in New Issue
Block a user