Reputation: 185
I am trying to load the list of LINE contacts in my Android application and open chat screen with the specific contact on tapping it. I can open the chat screen but I have to manually tap the contact to start the chat with the contact. I have read the available information from https://developers.line.me/en/docs/line-login/using-line-url-scheme/. But it didn't help me out. Also, I cannot find the list of Line contacts either. I get an empty string when I run the program.
Cursor cursor = getContentResolver().query(
RawContacts.CONTENT_URI,
new String[] { RawContacts.CONTACT_ID, RawContacts.DISPLAY_NAME_PRIMARY },
RawContacts.ACCOUNT_TYPE + "= ?",
new String[] { "jp.naver.line.android" },
null);
ArrayList<String> LineContacts = new ArrayList<String>();
int contactNameColumn = cursor.getColumnIndex(RawContacts.DISPLAY_NAME_PRIMARY);
while (cursor.moveToNext())
{
LineContacts.add(cursor.getString(contactNameColumn));
}
cursor.close();
Log.d(TAG,LineContacts.size());
Opening the line app using intent.
String sendText = "line://nv/chat";
Intent intent = new Intent();
try {
intent = Intent.parseUri(sendText, Intent.URI_INTENT_SCHEME);
} catch (URISyntaxException e) {
e.printStackTrace();
}
startActivity(intent);
Upvotes: 2
Views: 2602
Reputation: 1384
Accordingly new documentation it is possible...
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://line.me/R/oaMessage/" + "@lineId/"+"?"+"Hi%20there%21"));
context.startActivity(intent);
Refers to https://developers.line.biz/en/docs/line-login/using-line-url-scheme/#sending-text-messages
Upvotes: 1
Reputation: 21766
As per the documentation it looks not possible what are you looking for.
Below is list of the available URL schemes for the LINE app:
For more details check here
Upvotes: 3