parent
958c118e84
commit
d0a4530314
@ -0,0 +1,30 @@ |
|||||||
|
package io.openim.flutter_openim_sdk.listener; |
||||||
|
|
||||||
|
import io.openim.flutter_openim_sdk.util.CommonUtil; |
||||||
|
|
||||||
|
public class OnListenerForService implements open_im_sdk_callback.OnListenerForService { |
||||||
|
@Override |
||||||
|
public void onFriendApplicationAccepted(String s) { |
||||||
|
CommonUtil.emitEvent("listenerForService", "onFriendApplicationAccepted", s); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void onFriendApplicationAdded(String s) { |
||||||
|
CommonUtil.emitEvent("listenerForService", "onFriendApplicationAdded", s); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void onGroupApplicationAccepted(String s) { |
||||||
|
CommonUtil.emitEvent("listenerForService", "onGroupApplicationAccepted", s); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void onGroupApplicationAdded(String s) { |
||||||
|
CommonUtil.emitEvent("listenerForService", "onGroupApplicationAdded", s); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void onRecvNewMessage(String s) { |
||||||
|
CommonUtil.emitEvent("listenerForService", "onRecvNewMessage", s); |
||||||
|
} |
||||||
|
} |
@ -1,16 +1,17 @@ |
|||||||
/// callback类型 |
/// callback类型 |
||||||
class ListenerType { |
class ListenerType { |
||||||
static final simpleMsgListener = 'simpleMsgListener'; |
static const simpleMsgListener = 'simpleMsgListener'; |
||||||
static final connectListener = 'connectListener'; |
static const connectListener = 'connectListener'; |
||||||
static final userListener = 'userListener'; |
static const userListener = 'userListener'; |
||||||
static final groupListener = 'groupListener'; |
static const groupListener = 'groupListener'; |
||||||
static final advancedMsgListener = 'advancedMsgListener'; |
static const advancedMsgListener = 'advancedMsgListener'; |
||||||
static final conversationListener = 'conversationListener'; |
static const conversationListener = 'conversationListener'; |
||||||
static final friendListener = 'friendListener'; |
static const friendListener = 'friendListener'; |
||||||
static final signalingListener = 'signalingListener'; |
static const signalingListener = 'signalingListener'; |
||||||
static final msgSendProgressListener = "msgSendProgressListener"; |
static const msgSendProgressListener = "msgSendProgressListener"; |
||||||
static final workMomentsListener = "workMomentsListener"; |
static const workMomentsListener = "workMomentsListener"; |
||||||
static final organizationListener = "organizationListener"; |
static const organizationListener = "organizationListener"; |
||||||
static final customBusinessListener = "customBusinessListener"; |
static const customBusinessListener = "customBusinessListener"; |
||||||
static final messageKvInfoListener = "messageKvInfoListener"; |
static const messageKvInfoListener = "messageKvInfoListener"; |
||||||
|
static const listenerForService = "listenerForService"; |
||||||
} |
} |
||||||
|
@ -0,0 +1,38 @@ |
|||||||
|
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; |
||||||
|
|
||||||
|
/// 好友关系监听 |
||||||
|
class OnListenerForService { |
||||||
|
Function(FriendApplicationInfo i)? onFriendApplicationAdded; |
||||||
|
Function(FriendApplicationInfo i)? onFriendApplicationAccepted; |
||||||
|
Function(GroupApplicationInfo info)? onGroupApplicationAccepted; |
||||||
|
Function(GroupApplicationInfo info)? onGroupApplicationAdded; |
||||||
|
Function(Message msg)? onRecvNewMessage; |
||||||
|
|
||||||
|
OnListenerForService({ |
||||||
|
this.onFriendApplicationAdded, |
||||||
|
this.onFriendApplicationAccepted, |
||||||
|
this.onGroupApplicationAccepted, |
||||||
|
this.onGroupApplicationAdded, |
||||||
|
this.onRecvNewMessage, |
||||||
|
}); |
||||||
|
|
||||||
|
void friendApplicationAccepted(FriendApplicationInfo u) { |
||||||
|
onFriendApplicationAccepted?.call(u); |
||||||
|
} |
||||||
|
|
||||||
|
void friendApplicationAdded(FriendApplicationInfo u) { |
||||||
|
onFriendApplicationAdded?.call(u); |
||||||
|
} |
||||||
|
|
||||||
|
void groupApplicationAccepted(GroupApplicationInfo info) { |
||||||
|
onGroupApplicationAccepted?.call(info); |
||||||
|
} |
||||||
|
|
||||||
|
void groupApplicationAdded(GroupApplicationInfo info) { |
||||||
|
onGroupApplicationAdded?.call(info); |
||||||
|
} |
||||||
|
|
||||||
|
void recvNewMessage(Message msg) { |
||||||
|
onRecvNewMessage?.call(msg); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,9 @@ |
|||||||
|
import 'dart:developer'; |
||||||
|
|
||||||
|
/// print full log |
||||||
|
class Logger { |
||||||
|
// Sample of abstract logging function |
||||||
|
static void print(String text) { |
||||||
|
log('** $text', name: 'flutter_openim_sdk'); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue