[iOS] Document invite module methods

This commit is contained in:
Saúl Ibarra Corretgé 2018-05-02 13:20:37 +02:00 committed by Lyubo Marinov
parent 6c602accae
commit cf6dd98b02
2 changed files with 32 additions and 5 deletions

View File

@ -23,14 +23,17 @@
@protocol AddPeopleControllerDelegate @protocol AddPeopleControllerDelegate
/** /**
* Called when an AddPeopleController has results for a query that was previously provided. * Called when an AddPeopleController has results for a query that was
* previously provided.
*/ */
- (void)addPeopleController:(AddPeopleController * _Nonnull)controller - (void)addPeopleController:(AddPeopleController * _Nonnull)controller
didReceiveResults:(NSArray<NSDictionary*> * _Nonnull)results didReceiveResults:(NSArray<NSDictionary*> * _Nonnull)results
forQuery:(NSString * _Nonnull)query; forQuery:(NSString * _Nonnull)query;
/** /**
* TODO. * Called when an AddPeopleController has finished the inviting process, either
* succesfully or not. In case of failure the failedInvitees array will contain
* the items for which invitations failed.
*/ */
- (void)inviteSettled:(NSArray<NSDictionary *> * _Nonnull)failedInvitees - (void)inviteSettled:(NSArray<NSDictionary *> * _Nonnull)failedInvitees
fromSearchController:(AddPeopleController * _Nonnull)addPeopleController; fromSearchController:(AddPeopleController * _Nonnull)addPeopleController;

View File

@ -41,10 +41,12 @@ RCT_EXPORT_MODULE();
} }
/** /**
* Calls the corresponding JitsiMeetView's delegate to request that the native * Initiates the process to add people. This involves calling a delegate method
* invite search be presented. * in the InviteControllerDelegate so the native host application can start
* the query process.
* *
* @param scope * @param externalAPIScope - Scope identifying the JitsiMeetView where the
* calling JS code is being executed.
*/ */
RCT_EXPORT_METHOD(beginAddPeople:(NSString *)externalAPIScope) { RCT_EXPORT_METHOD(beginAddPeople:(NSString *)externalAPIScope) {
JitsiMeetView *view = [JitsiMeetView viewForExternalAPIScope:externalAPIScope]; JitsiMeetView *view = [JitsiMeetView viewForExternalAPIScope:externalAPIScope];
@ -52,6 +54,16 @@ RCT_EXPORT_METHOD(beginAddPeople:(NSString *)externalAPIScope) {
[controller beginAddPeople]; [controller beginAddPeople];
} }
/**
* Indicates the the invite process has settled / finished.
*
* @param externalAPIScope - Scope identifying the JitsiMeetView where the
* calling JS code is being executed.
* @param addPeopleControllerScope - Scope identifying the AddPeopleController
* wich was settled.
* @param failedInvitees - Array with the invitees which were not invited due
* to a failure.
*/
RCT_EXPORT_METHOD(inviteSettled:(NSString *)externalAPIScope RCT_EXPORT_METHOD(inviteSettled:(NSString *)externalAPIScope
addPeopleControllerScope:(NSString *)addPeopleControllerScope addPeopleControllerScope:(NSString *)addPeopleControllerScope
failedInvitees:(NSArray *)failedInvitees) { failedInvitees:(NSArray *)failedInvitees) {
@ -60,6 +72,18 @@ RCT_EXPORT_METHOD(inviteSettled:(NSString *)externalAPIScope
[controller inviteSettled:addPeopleControllerScope failedInvitees:failedInvitees]; [controller inviteSettled:addPeopleControllerScope failedInvitees:failedInvitees];
} }
/**
* Process results received for the given query. This involves calling a
* delegate method in AddPeopleControllerDelegate so the native host application
* is made aware of the query results.
*
* @param externalAPIScope - Scope identifying the JitsiMeetView where the
* calling JS code is being executed.
* @param addPeopleControllerScope - Scope identifying the AddPeopleController
* for which the results were received.
* @param query - The actual query for which the results were received.
* @param results - The query results.
*/
RCT_EXPORT_METHOD(receivedResults:(NSString *)externalAPIScope RCT_EXPORT_METHOD(receivedResults:(NSString *)externalAPIScope
addPeopleControllerScope:(NSString *)addPeopleControllerScope addPeopleControllerScope:(NSString *)addPeopleControllerScope
query:(NSString *)query query:(NSString *)query