private void invokeSharingClient ( final ResolveInfo selectedResolveInfo ) { isShareInProgress_ = true ; final String channelName = selectedResolveInfo . loadLabel ( context_ . getPackageManager ( ) ) . toString ( ) ; BranchShortLinkBuilder shortLinkBuilder = builder_ . getShortLinkBuilder ( ) ; shortLinkBuilder . generateShortUrlInternal ( new Branch . BranchLinkCreateListener ( ) { @ Override public void onLinkCreate ( String url , BranchError error ) { if ( error == null ) { shareWithClient ( selectedResolveInfo , url , channelName ) ; } else { //If there is a default URL specified share it. String defaultUrl = builder_ . getDefaultURL ( ) ; if ( defaultUrl != null && defaultUrl . trim ( ) . length ( ) > 0 ) { shareWithClient ( selectedResolveInfo , defaultUrl , channelName ) ; } else { if ( callback_ != null ) { callback_ . onLinkShareResponse ( url , channelName , error ) ; } else { PrefHelper . Debug ( "Unable to share link " + error . getMessage ( ) ) ; } if ( error . getErrorCode ( ) == BranchError . ERR_BRANCH_NO_CONNECTIVITY || error . getErrorCode ( ) == BranchError . ERR_BRANCH_TRACKING_DISABLED ) { shareWithClient ( selectedResolveInfo , url , channelName ) ; } else { cancelShareLinkDialog ( false ) ; isShareInProgress_ = false ; } } } } } , true ) ; }
Invokes a sharing client with a link created by the given json objects .