Giter Site home page Giter Site logo

jpush / jmessage-flutter-plugin Goto Github PK

View Code? Open in Web Editor NEW
166.0 22.0 59.0 362 KB

JMessage's Flutter plugin (Android & iOS). 极光推送官方支持的 Flutter 插件(Android & iOS)。

Home Page: https://docs.jiguang.cn

License: MIT License

Java 39.53% Ruby 0.83% Objective-C 27.80% Dart 31.69% Shell 0.13%
jmessage flutter ios android

jmessage-flutter-plugin's Issues

logout之后再login,await没有返回

`- (void)login:(FlutterMethodCall*)call result:(FlutterResult)result {
NSDictionary *user = call.arguments;

[JMSGUser loginWithUsername:user[@"username"] password:user[@"password"] completionHandler:^(id resultObject, NSError *error) {
if (error) {
result([error flutterError]);
return;
}

JMSGUser *myInfo = [JMSGUser myInfo];
// 为了和 Android 行为一致,在登录的时候自动下载缩略图。
[myInfo thumbAvatarData:^(NSData *data, NSString *objectId, NSError *error) {
  // 下载失败也及时返回。
  result(nil);
}];

}];
}`
是因为第二重新登录的时候下载缩略图回调不会调用,所以login接口无限期等待

安卓集成不了呀

flutter 1.5 的版本

安卓一直报错:
[AndroidUtil] AndroidManifest.xml missing required component: cn.jpush.im.android.helpers.ipc.IMProvider

已经按文档配置了 gradle
defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.fixtime.fixtime" minSdkVersion 21 targetSdkVersion 28 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" // ndk { // //选择要添加的对应 cpu 类型的 .so 库。 // abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a', // } manifestPlaceholders = [ JPUSH_PKGNAME : applicationId, JPUSH_APPKEY : "xxxxxxxxxxxxxxxxxxxxx", //JPush上注册的包名对应的appkey. JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可. ] }

参考文档还是用的 react的。。。。
dependencies { compile project(':react-native-fs') compile project(':jmessage-react-plugin') compile project(':jcore-react-native') compile project(':aurora-imui-react-native') compile fileTree(include: ['*.jar'], dir: 'libs') implementation 'com.android.support:appcompat-v7:27.1.0' compile 'com.facebook.react:react-native:+' // From node_modules }

如何判断对方是不是自己好友?

如何判断对方是不是自己好友?
jmessage-flutter里只有好友列表,消息中没有方法判断当前用户是否为好友。
难道每次点击都要编历一遍好友列表么?

type: 会话类型。可以为 (JMSingle | JMGroup | JMChatRoom)。这个到底是传什么值

getConversation(target:"JMSingle")

报错:
NoSuchMethodError (NoSuchMethodError: Class 'String' has no instance method 'toJson'.

换成
{"username":"xxx", "type":"JMSingle"}
也是同样的错误

请问到底是填什么。

另外

var message = await jmessage.createMessage(
type: JMMessageType.image,
targetType: msg.from.targetType,
path: msg.thumbPath,
extras: {"key1": "value1"}
);

构造 message 里的 msg 是什么,该怎么用。。

[ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(871303, Invalid username., )

E/flutter ( 7080): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(871303, Invalid username., )
E/flutter ( 7080): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7)
E/flutter ( 7080): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:302:33)
E/flutter ( 7080): <asynchronous suspension>
E/flutter ( 7080): #2      JmessageFlutter.login (package:jmessage_flutter/jmessage_flutter.dart:271:20)
E/flutter ( 7080): <asynchronous suspension>
E/flutter ( 7080): #3      _LoginState._login (package:im/page/login.dart:24:20)
E/flutter ( 7080): #4      _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:49:6)
E/flutter ( 7080): #5      _LoginState._login (package:im/page/login.dart:20:9)
E/flutter ( 7080): #6      _LoginState.build.<anonymous closure> (package:im/page/login.dart:75:17)
E/flutter ( 7080): #7      _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:49:6)
E/flutter ( 7080): #8      _LoginState.build.<anonymous closure> (package:im/page/login.dart:65:24)
E/flutter ( 7080): #9      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:511:14)
E/flutter ( 7080): #10     _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:566:30)
E/flutter ( 7080): #11     GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:166:24)
E/flutter ( 7080): #12     TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:240:9)
E/flutter ( 7080): #13     TapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:211:7)
E/flutter ( 7080): #14     GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
E/flutter ( 7080): #15     _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:225:20)
E/flutter ( 7080): #16     _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:199:22)
E/flutter ( 7080): #17     _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
E/flutter ( 7080): #18     _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
E/flutter ( 7080): #19     _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter ( 7080): #20     _rootRunUnary (dart:async/zone.dart:1136:13)
E/flutter ( 7080): #21     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
E/flutter ( 7080): #22     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
E/flutter ( 7080): #23     _invoke1 (dart:ui/hooks.dart:233:10)
E/flutter ( 7080): #24     _dispatchPointerDataPacket (dart:ui/hooks.dart:154:5)
E/flutter ( 7080): 

调用者两个方法时,都会出错

.login(username: username, password: password);
.userRegister(username: username, password: password);

flutter version:1.5
jmessage-flutter-plugin: 0.0.16

消息监听事件回调 收不到消息啊

登录0001,监听消息,0002发送消息 ,监听不到
await Application.jmessage.login(username: '0001', password: "123456");
await Application.jmessage.addReceiveMessageListener((dynamic msg){
print("收到消息");
print(msg.toString());
});

在控制台可以admin角色用户发送给不同的用户可以接收到,但是代码里面测试相互发送不了

 JMSingle targetType = JMSingle.fromJson({
       'username': "halower",
       'appKey': kMockAppkey
    });
     var message = await Jmessage.createMessage(
          type: JMMessageType.text,
          targetType: targetType,
          text: '测试一下'
        );
       var sendedMessage = await Jmessage.sendMessage(
          message: message,
          sendOption: JMMessageSendOptions.fromJson({
              'isShowNotification': true, 
              // 'isRetainOffline': true,
          })
        );
       print('这里执行不下来,但是也没有捕获到错误');

收取语音文件时,SDK 未自动下载

图片文件有自动下载并获取到本地路径 , 语音文件没有 , 只有一个 filename , 通过 filename . serveMessageId 与 消息id , 均不能 down 语音文件 , 报错can't not find this message.

安卓向 iOS 发送消息里,发送方的头像为空

安卓发信息时,在 ios 上收到的消息,avatarThumbPath 字段为空

{id: msgId_1558932246499132, serverMessageId: 3717093152, isSend: false, from: {type: user, gender: unknown, username: 3900, appKey: 203ea0587d6d1decf9490c5c, nickname: ��, avatarThumbPath: , birthday: 1970-01-01, region: , signature: , address: , noteName: , noteText: , isNoDisturb: false, isInBlackList: false, isFriend: false, extras: {}}, createTime: 1558932246337, extras: {}, target: {type: user, gender: unknown, username: 4000, appKey: 203ea0587d6d1decf9490c5c, nickname: denechen, avatarThumbPath: /var/mobile/Containers/Data/Application/119D2CF1-2178-4206-BCEC-F04670526323/Documents/4000_268218011/avatar/4000_203ea0587d6d1decf9490c5c/thumb/B9D6DD997B86032DB61626D973002C6E, birthday: , region: , signature: , address: , noteName: , noteText: , isNoDisturb: false, isInBlackList: false, isFriend: false, extras: {}}, type: text, text: Text Message Test!}

但安卓上 getMyInfo 是有头像信息的

my info is:
I/flutter (13167): {type: user, gender: unknown, username: 3900, appKey: 203ea0587d6d1decf9490c5c, nickname: ��, avatarThumbPath: /data/user/0/com.fixtime.fixtime/files/images/small-avatar/92FCDCB1530A2B6A7EFE9D21776C7301.png, birthday: 1970-01-01, region: , signature: , address: , noteName: , noteText: , isNoDisturb: false, isInBlackList: false, isFriend: false, extras: {}}

updateMyAvatar

android里的updateMyAvatar 一直保错七牛云失败什么的,反正头像上传永远不成功

location message的一些问题

  1. JmessageFlutter().createMessage中,经度纬度都是int类型,但是在Android中却是double类型,很明显在flutter中两者也应该都是double类型
  2. LocationMessage的解析问题: JMMessage的Android SDK中,使用Android Studio可以看到latitudelongitudescale作为 LocationContent的属性,在Java中的类型都是Number,导致flutter中获取位置消息时会出现如下报错:
E/MethodChannel#jmessage_flutter( 3242): java.lang.IllegalArgumentException: Unsupported Number type: class cn.jmessage.support.google.gson.internal.LazilyParsedNumber
E/MethodChannel#jmessage_flutter( 3242): 	at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:241)
E/MethodChannel#jmessage_flutter( 3242): 	at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:286)
E/MethodChannel#jmessage_flutter( 3242): 	at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:278)
E/MethodChannel#jmessage_flutter( 3242): 	at io.flutter.plugin.common.StandardMethodCodec.encodeSuccessEnvelope(StandardMethodCodec.java:57)
E/MethodChannel#jmessage_flutter( 3242): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:204)
E/MethodChannel#jmessage_flutter( 3242): 	at com.jiguang.jmessageflutter.JmessageFlutterPlugin.getHistoryMessages(JmessageFlutterPlugin.java:1160)
E/MethodChannel#jmessage_flutter( 3242): 	at com.jiguang.jmessageflutter.JmessageFlutterPlugin.onMethodCall(JmessageFlutterPlugin.java:182)
E/MethodChannel#jmessage_flutter( 3242): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:201)
E/MethodChannel#jmessage_flutter( 3242): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:88)
E/MethodChannel#jmessage_flutter( 3242): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:219)
E/MethodChannel#jmessage_flutter( 3242): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#jmessage_flutter( 3242): 	at android.os.MessageQueue.next(MessageQueue.java:323)
E/MethodChannel#jmessage_flutter( 3242): 	at android.os.Looper.loop(Looper.java:136)
E/MethodChannel#jmessage_flutter( 3242): 	at android.app.ActivityThread.main(ActivityThread.java:6077)
E/MethodChannel#jmessage_flutter( 3242): 	at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#jmessage_flutter( 3242): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
E/MethodChannel#jmessage_flutter( 3242): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)

造成这种错误的原因应该是flutter不支持Number类型的转换。
个人的解决办法是在JsonUtils.java中转换LocationMessage时,将longitudelatitudescaleNumber转为doubleint

如何获取chatroom的历史聊天信息、

  JMChatRoom formchatroom = JMChatRoom.fromJson({'roomId': '23487994'});
  await jmessage.getHistoryMessages(type: formchatroom, from: 0, limit: 10).then((msgsssList){
    for(JMNormalMessage latemsgs in msgsssList) {
      print(msgsssList);
      print(latemsgs.toJson()['text']);
    }
  });

没有找到官方的demo代码,自己大概这么写了一段。好像不大行。
麻烦给一份可运行的代码示例 谢谢

打包失败 ChatRoomHandler.enterChatRoom(params, result);

D:\flutter.pub-cache\hosted\pub.flutter-io.cn\jmessage_flutter-0.2.0\android\src\main\java\com\jiguang\jmessageflutter\JmessageFlutterPlugin.java:2432: ����: �Ҳ�������
ChatRoomHandler.enterChatRoom(params, result);
^
����: ��� ChatRoomHandler
�: �� JmessageFlutterPlugin
D:\flutter.pub-cache\hosted\pub.flutter-io.cn\jmessage_flutter-0.2.0\android\src\main\java\com\jiguang\jmessageflutter\JmessageFlutterPlugin.java:2438: ����: �Ҳ�������
ChatRoomHandler.exitChatRoom(params, result);
^
����: ��� ChatRoomHandler
�: �� JmessageFlutterPlugin
D:\flutter.pub-cache\hosted\pub.flutter-io.cn\jmessage_flutter-0.2.0\android\src\main\java\com\jiguang\jmessageflutter\JmessageFlutterPlugin.java:2457: ����: �Ҳ�������
ChatRoomHandler.getChatRoomConversationList(null, result);
^
����: ��� ChatRoomHandler
�: �� JmessageFlutterPlugin
ע: ijЩ�����ļ�ʹ�û򸲸����ѹ�ʱ�� API��
ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:deprecation ���±��롣
ע: ijЩ�����ļ�ʹ����δ�����򲻰�ȫ�IJ�����
ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:unchecked ���±��롣
3 ������

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':jmessage_flutter:compileReleaseJavaWithJavac'.

Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 3m 28s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 209.0s (!)
Gradle task assembleRelease failed with exit code 1

getConversations

getConversations 没有返回avatarThumbPath的具体值 ,只返回了空 ,但实际是有值的

android release下init异常

2019-10-27 14:45:51.909 4616-4616/? E/MethodChannel#jmessage_flutter: Failed to handle method call
b.a.a.b.g: Subscriber class b.a.c.h.a has no public methods called onEvent
at b.a.a.b.n.a(Unknown Source:347)
at b.a.a.b.e.b(Unknown Source:7)
at b.a.a.b.e.a(Unknown Source:0)
at b.a.c.c.a.a(Unknown Source:22)
at b.a.c.c.a(Unknown Source:60)
at cn.jpush.im.android.api.JMessageClient.init(Unknown Source:69)
at com.jiguang.jmessageflutter.Fa.za(:7)
at com.jiguang.jmessageflutter.Fa.a(:6)
at d.a.b.a.o$a.a(:2)
at io.flutter.embedding.engine.a.c.a(:16)
at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(:2)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:363)
at android.os.Looper.loop(Looper.java:173)
at android.app.ActivityThread.main(ActivityThread.java:8113)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)

debug模式下正常。

flutter doctor --android-licenses[✓] Flutter (Channel beta, v1.10.7, on Mac OS X 10.15 19A602, locale zh-Hans-CN)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.1)
[✓] Android Studio (version 3.5)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.1)
[✓] VS Code (version 1.39.2)
[✓] Proxy Configuration
[✓] Connected device (2 available)

• No issues found!

Android创建会话后发消息报错

E/flutter (31077): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(898002, [nihfuskdjahfoijhasfljnwolketn], )
E/flutter (31077): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7)
E/flutter (31077): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:302:33)
E/flutter (31077):
E/flutter (31077): #2 JmessageFlutter.sendTextMessage (package:jmessage_flutter/jmessage_flutter.dart:468:33)
E/flutter (31077):
E/flutter (31077): #3 IMProvide.sendText (package:school_recruit/provide/provide_im.dart:62:14)
E/flutter (31077): #4 _ChatPageState._operation. (package:school_recruit/pages/im/page_chat.dart:111:51)
E/flutter (31077): #5 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:511:14)
E/flutter (31077): #6 _InkResponseState.build. (package:flutter/src/material/ink_well.dart:566:30)
E/flutter (31077): #7 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:166:24)
E/flutter (31077): #8 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:240:9)
E/flutter (31077): #9 TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:177:9)
E/flutter (31077): #10 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:436:9)
E/flutter (31077): #11 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:73:12)
E/flutter (31077): #12 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:11)
E/flutter (31077): #13 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:221:19)
E/flutter (31077): #14 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:199:22)
E/flutter (31077): #15 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
E/flutter (31077): #16 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
E/flutter (31077): #17 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter (31077): #18 _rootRunUnary (dart:async/zone.dart:1136:13)
E/flutter (31077): #19 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
E/flutter (31077): #20 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
E/flutter (31077): #21 _invoke1 (dart:ui/hooks.dart:233:10)
E/flutter (31077): #22 _dispatchPointerDataPacket (dart:ui/hooks.dart:154:5)

请问这是什么错误?

这真是令人恶心的报错 FAILURE: Build failed with an exception.

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not resolve all files for configuration ':app:debugRuntimeClasspath'.

Could not download jmessage.aar (cn.jiguang.sdk:jmessage:2.9.0)
Could not get resource 'https://jcenter.bintray.com/cn/jiguang/sdk/jmessage/2.9.0/jmessage-2.9.0.aar'.
> Could not GET 'https://jcenter.bintray.com/cn/jiguang/sdk/jmessage/2.9.0/jmessage-2.9.0.aar'.
> Remote host closed connection during handshake
Could not download jcore.aar (cn.jiguang.sdk:jcore:2.1.0)
Could not get resource 'https://jcenter.bintray.com/cn/jiguang/sdk/jcore/2.1.0/jcore-2.1.0.aar'.
> Could not GET 'https://jcenter.bintray.com/cn/jiguang/sdk/jcore/2.1.0/jcore-2.1.0.aar'.
> Remote host closed connection during handshake

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1m 22s
Finished with error: Gradle task assembleDebug failed with exit code 1

image

我在自己的工程添加yaml,运行出错。下了example试试也是同的样的问题。
这是什么原因?这真是令人恶心的报错。

调用init方法后多次hot restart会导致程序卡死

Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.15.1 19B88, locale zh-Hans-CN)

自己的项目发现了这个问题,第一次hot restart可以,第二次界面没反应,第三次控制台没反应
下载了example,运行发现也是三次卡死
如果注释掉了init方法就不会有这个问题,只在ios模拟器上测试了

iphoneXR模拟器启动,报兼容问题

Flutter版本

Flutter 1.7.8+hotfix.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 20e59316b8 (5 weeks ago) • 2019-07-18 20:04:33 -0700
Engine • revision fee001c93f
Tools • Dart 2.4.0

控制台报错信息

Resolving dependencies of `Podfile`
    [!] CocoaPods could not find compatible versions for pod "JCore":
      In snapshot (Podfile.lock):
        JCore (< 3.0.0, = 2.1.1, >= 1.0.0)

      In Podfile:
        jmessage_flutter (from `.symlinks/plugins/jmessage_flutter/ios`) was resolved to 0.0.1, which depends on
          JMessage was resolved to 3.9.0, which depends on
            JCore (< 3.0.0, >= 1.0.0)

    It seems like you've changed the constraints of dependency `JCore` inside your development pod `jmessage_flutter`.
    You should run `pod update JCore` to apply changes you've made.


Error output from CocoaPods:
↳

    [!] The version of CocoaPods used to generate the lockfile (1.7.5) is higher than the version of the current executable (1.7.1). Incompatibility issues may arise.

    [!] Automatically assigning platform `ios` with version `9.3` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

更新不到最新版本

jmessage_flutter 0.2.0 which doesn't match any versions, version solving failed.
pub get failed (1)

0.0.18 安卓不能 Login

机型 一加7pro , 安卓9,测试了 wifi 4g,都无法连接上,日志显示连接超时::

I/flutter (22672): jmessage 开始初始化

W/JIGUANG-JMessage(22672): [JMessageClient] this receiver is already registed ! receiver = com.jiguang.jmessageflutter.JmessageFlutterPlugin@d01493b

D/JIGUANG-JMessage(22672): [RequestingThread] Action - sendRequestInternal - connection:, timeout:60000, threadId:2820

D/JIGUANG-JMessage(22672): [RequestingThread] Action - sendCommand

D/JIGUANG-JMessage(22672): [RequestingThread] request is [Requesting] - timeout:50000, times:1, request:cn.jmessage.biz.j.a@b7067bf

D/JIGUANG-JMessage(22672): [RequestingThread] Request params - cmd:100

D/JIGUANG-JMessage(22672): [RequestingThread] Action - sendCommand

D/JIGUANG-JMessage(22672): [RequestingThread] request is [Requesting] - timeout:40000, times:2, request:cn.jmessage.biz.j.a@b7067bf

D/JIGUANG-JMessage(22672): [RequestingThread] Request params - cmd:100

D/JIGUANG-JMessage(22672): [RequestingThread] Action - sendCommand

D/JIGUANG-JMessage(22672): [RequestingThread] request is [Requesting] - timeout:30000, times:3, request:cn.jmessage.biz.j.a@b7067bf

D/JIGUANG-JMessage(22672): [RequestingThread] Request params - cmd:100

D/JIGUANG-JMessage(22672): [RequestingThread] Action - sendCommand

D/JIGUANG-JMessage(22672): [RequestingThread] request is [Requesting] - timeout:20000, times:4, request:cn.jmessage.biz.j.a@b7067bf

D/JIGUANG-JMessage(22672): [RequestingThread] Request params - cmd:100

D/JIGUANG-JMessage(22672): [RequestingThread] Action - sendCommand

D/JIGUANG-JMessage(22672): [RequestingThread] request is [Requesting] - timeout:10000, times:5, request:cn.jmessage.biz.j.a@b7067bf

D/JIGUANG-JMessage(22672): [RequestingThread] Request params - cmd:100

D/JIGUANG-JMessage(22672): [RequestingThread] Action - sendCommand

D/JIGUANG-JMessage(22672): [RequestingThread] request is [Requesting] - timeout:0, times:6, request:cn.jmessage.biz.j.a@b7067bf

D/JIGUANG-JMessage(22672): [RequestingThread] Request params - cmd:100

I/flutter (22672): jmessage login error

I/flutter (22672): PlatformException(871201, Get response timeout,please try again later., )

[AndroidUtil] AndroidManifest.xml missing required component: cn.jpush.im.android.helpers.ipc.IMProvider

安卓已经在 build.gradle 里添加了配置,报错如下:

[AndroidUtil] AndroidManifest.xml missing required component: cn.jpush.im.android.helpers.ipc.IMProvider

我的配置文件:
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.fixtime.fixtime"
minSdkVersion 21
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
ndk {
//选择要添加的对应 cpu 类型的 .so 库。
abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a',
}
manifestPlaceholders = [
JPUSH_PKGNAME : applicationId,
JPUSH_APPKEY : "xxxxxxxxxxxxxxxxx", //JPush上注册的包名对应的appkey.
JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
]
}

Flutter接口缺少返回状态。

目前的很多接口(注册,登录,更改密码)的返回值是Future。在上层没法做状态展示。
应该统一封装一个返回结果的类。

class JMResult<T> {
    T result;
    int status;
    String description;
}

然后修改方法的返回值:

Future<JMResult<void>> login({
    @required String username,
    @required String password,
  }) async {}

Future<JMResult<JMUserInfo>> getMyInfo() async {}

Future<JMResult<Map>> downloadOriginalGroupAvatar({
    @required String id,
  }) async {}

getConversations有问题

JmessageFlutter().getConversations(); 

拿到的lastMessage是错误的,一直显示第一条信息。

导致列表顺序也是错的。

没有群头像?

class JMGroupInfo {
String id; // 群组 id
String name; // 群组名称
String desc; // 群组描述
int level; // 群组等级,默认等级 4
String owner; // 群主的 username
String ownerAppKey; // 群主的 appKey
int maxMemberCount; // 最大成员数
bool isNoDisturb; // 是否免打扰
bool isBlocked; // 是否屏蔽群消息
JMGroupType groupType; // 群类型
JMGroup get targetType => JMGroup.fromJson({
'groupId': id
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.