Link in SMS from android app

I want to send a link in SMS from my android application. I am able to do so. But whole body doesn't reflect as a link. Part of SMS is not shown as a link. Any help how to do so in android app.

SmsManager smsManager = SmsManager.getDefault();
selectedSMSMessage = "http://www.mydeeplink.com?SignInId=" + SignIn.userid;

smsManager.sendTextMessage(selectedContact, null, selectedSMSMessage, null, null);
Toast.makeText(getActivity(), "Message Sent",
        Toast.LENGTH_LONG).show();

1 answer

  • answered 2018-04-17 05:22 Joif

    Try this

    public static void main(String[] args) {
    
        String id = SignIn.userid;
    
        String trimmedID = id.trim();
    
        String selectedSMSMessage = "http://www.mydeeplink.com?SignInId=" + trimmedID;
    
    }