public void join ( final Respoke . TaskCompletionListener completionListener ) { if ( ! isConnected ( ) ) { Respoke . postTaskError ( completionListener , "Can't complete request when not connected. " + "Please reconnect!" ) ; return ; } if ( ( groupID == null ) || ( groupID . length ( ) == 0 ) ) { Respoke . postTaskError ( completionListener , "Group name must be specified" ) ; return ; } String urlEndpoint = String . format ( "/v1/groups/%s" , groupID ) ; signalingChannel . sendRESTMessage ( "post" , urlEndpoint , null , new RespokeSignalingChannel . RESTListener ( ) { @ Override public void onSuccess ( Object response ) { joined = true ; Respoke . postTaskSuccess ( completionListener ) ; } @ Override public void onError ( final String errorMessage ) { Respoke . postTaskError ( completionListener , errorMessage ) ; } } ) ; }
Join this group