【问题标题】:Open chat screen of LINE android app with a specific contact与特定联系人打开 LINE android 应用程序的聊天屏幕
【发布时间】:2018-12-08 18:44:25
【问题描述】:

我正在尝试在我的 Android 应用程序中加载 LINE 联系人列表,并在点击时打开与特定联系人的聊天屏幕。我可以打开聊天屏幕,但我必须手动点击联系人才能开始与联系人聊天。我已阅读来自https://developers.line.me/en/docs/line-login/using-line-url-scheme/ 的可用信息。但这并没有帮助我。另外,我也找不到 Line 联系人列表。运行程序时得到一个空字符串。

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());

使用意图打开线路应用程序。

    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);

【问题讨论】:

    标签: java android android-intent android-contacts line-api


    【解决方案1】:

    根据文档,它看起来不可能您在寻找什么。

    以下是 LINE 应用可用的 URL 方案列表:

    1. 打开相机和相机胶卷
    2. 打开位置屏幕
    3. 共享您的机器人帐户
    4. 打开您的机器人时间轴和帐户页面
    5. 发送短信
    6. 打开个人资料信息
    7. 打开常用 LINE 应用屏幕
    8. 打开 LINE 应用设置屏幕打开
    9. 贴纸店开主题店
    10. 使用 LINE Out 拨打电话

    更多详情请查看here

    【讨论】:

    【解决方案2】:

    因此,新的文档是可能的......

    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);
    

    https://developers.line.biz/en/docs/line-login/using-line-url-scheme/#sending-text-messages

    【讨论】:

      猜你喜欢
      • 2016-09-13
      • 2016-06-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-23
      • 1970-01-01
      相关资源
      最近更新 更多