Android 接入阿里反馈 (基础版)

本文介绍如何在应用中集成阿里百川的反馈系统,包括注册成为百川用户、导入lib包、配置appsecret及初始化FeedbackAPI等步骤,并提供自定义反馈页面的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.去阿里加入百川,申请成为百川用户

2. 下载阿里反馈的lib包,将资源导入,添加依赖

3. 在application中注册你申请的appscreet

FeedbackAPI.initAnnoy(this,“你的appkey”);

4.进入反馈页面

private void initFeedBack() {
    FeedbackAPI.Chat_Url = "https://h5.m.taobao.com/aliww/openim/fb.html";
    String env = "online";
    Map<String, String> uiCustomInfoMap = new HashMap<String, String>();
    uiCustomInfoMap.put("env", env);
    uiCustomInfoMap.put("pageTitle","用户反馈");
    uiCustomInfoMap.put("hideLoginSuccess","true");
    FeedbackAPI.setUICustomInfo(uiCustomInfoMap);
    FeedbackAPI.setCustomContact("请输入您的手机号码", false);



    /******     通过activity进入反馈页面        **************/
  /*  String errorMsg = FeedbackAPI.openFeedbackActivity(this);
    if (!TextUtils.isEmpty(errorMsg)) {
        Toast.makeText(this, errorMsg, Toast.LENGTH_SHORT).show();
    }*/


    /*******    通过fragment进入反馈页面       ************/
    Fragment fragment=FeedbackAPI.getFeedbackFragment();
    FragmentManager fm=getSupportFragmentManager();
    FragmentTransaction transaction=fm.beginTransaction();
    transaction.replace(R.id.frame_content,fragment);
    transaction.commit();
}

5。通过uiCustomInfoMap还可以自定义更多的属性

 //enableAudio(是否开启语音 1:开启 0:关闭)
 //bgColor(消息气泡背景色 "#ffffff"),
 //color(消息内容文字颜色 "#ffffff"),
 //avatar(当前登录账号的头像),string,为http url
 //toAvatar(客服账号的头像),string,为http url
 //themeColor(标题栏自定义颜色 "#ffffff")
 //profilePlaceholder: (顶部联系方式),string
 //profileTitle: (顶部联系方式左侧提示内容), String
 //chatInputPlaceholder: (输入框里面的内容),string
 //profileUpdateTitle:(更新联系方式标题), string
 //profileUpdateDesc:(更新联系方式文字描述), string
 //profileUpdatePlaceholder:(更新联系方式), string
 //profileUpdateCancelBtnText: (取消更新), string
 //profileUpdateConfirmBtnText: (确定更新),string
 //sendBtnText: (发消息),string
 //sendBtnTextColor: ("white"),string
 //sendBtnBgColor: ('red'),string
 //hideLoginSuccess: true  隐藏登录成功的toast
 //pageTitle: (Web容器标题), string
 //photoFromCamera: (拍摄一张照片),String
 //photoFromAlbum: (从相册选取), String
 //voiceContent:(点击这里录制语音), String
 //voiceCancelContent: (滑到这里取消录音), String
 //voiceReleaseContent: (松开取消录音), String

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值