jshare-flutter-plugin icon indicating copy to clipboard operation
jshare-flutter-plugin copied to clipboard

安卓平台获取用户信息失败时返回信息错误

Open qxb568 opened this issue 5 years ago • 2 comments

JshareFlutterPlugin.java 中: getUserInfo函数onError处理中,返回code是个int,而flutter中通过getEnumFromString来处理code的值,所以code只应该返回:success、cancel、fail 其他接口也有类似错误 image

qxb568 avatar Feb 17 '20 04:02 qxb568

我也碰到了。
JShareResponse.fromJson(Map<dynamic, dynamic>json) : code=getEnumFromString(JShareCode.values, json["code"]), message=json["message"];

T getEnumFromString<T>(Iterable<T> values,String str) { return values.firstWhere((f) => f.toString().split('.').last == str , orElse: () => null); }

json["code"]返回一个int 然而 getEnumFromString 的第二个参数是String

shaohui93 avatar Aug 26 '20 14:08 shaohui93

建议邮件轰炸极光技术邮箱:[email protected] ,或者前往极光社区 https://community.jiguang.cn 提问,响应还蛮快的

RA1NO3O avatar Jun 01 '21 06:06 RA1NO3O