Skip to content

Commit cbf24c8

Browse files
authored
Merge pull request #18 from jpush/dev
Dev
2 parents 6897f90 + f91925a commit cbf24c8

File tree

26 files changed

+528
-83
lines changed

26 files changed

+528
-83
lines changed
-1.23 MB
Binary file not shown.
1.33 MB
Binary file not shown.

android/src/io/jchat/android/JMessageModule.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,24 @@ public void gotResult(int status, String desc) {
224224
});
225225
}
226226

227+
@ReactMethod
228+
public void updateMyAvatar(ReadableMap map, final Callback success, final Callback fail) {
229+
try {
230+
String path = map.getString("imgPath");
231+
File file = new File(path);
232+
if (file.exists() && file.isFile()) {
233+
JMessageClient.updateUserAvatar(file, new BasicCallback() {
234+
@Override
235+
public void gotResult(int status, String desc) {
236+
mJMessageUtils.handleCallback(status, desc, success, fail);
237+
}
238+
});
239+
}
240+
} catch (Exception e) {
241+
e.printStackTrace();
242+
}
243+
}
244+
227245
@ReactMethod
228246
public void updateMyInfo(ReadableMap map, final Callback success, final Callback fail) {
229247
UserInfo myInfo = JMessageClient.getMyInfo();

example/android/app/app.iml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
7777
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/check-manifest" />
7878
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
79-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes-jar" />
8079
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
8180
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaPrecompile" />
8281
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
@@ -96,10 +95,12 @@
9695
<orderEntry type="jdk" jdkName="Android API 25 Platform (1)" jdkType="Android SDK" />
9796
<orderEntry type="sourceFolder" forTests="false" />
9897
<orderEntry type="library" name="okio-1.9.0" level="project" />
99-
<orderEntry type="library" name="chatinput-0.4.7" level="project" />
10098
<orderEntry type="library" name="imagepipeline-base-1.0.1" level="project" />
99+
<orderEntry type="library" name="chatinput-0.4.9" level="project" />
100+
<orderEntry type="library" name="XhsEmoticonsKeyboard-2.0.4" level="project" />
101101
<orderEntry type="library" name="textlayoutbuilder-1.0.0" level="project" />
102102
<orderEntry type="library" name="gson-2.8.0" level="project" />
103+
<orderEntry type="library" name="AndroidEmoji-1.0.0" level="project" />
103104
<orderEntry type="library" name="jsr305-3.0.0" level="project" />
104105
<orderEntry type="library" name="transition-25.3.1" level="project" />
105106
<orderEntry type="library" name="design-25.3.1" level="project" />

example/android/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ allprojects {
2929
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
3030
url "$rootDir/../node_modules/react-native/android"
3131
}
32+
maven { url "https://jitpack.io" }
3233
}
3334
}

example/app/routes/Chat/index.js

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ export default class Chat extends Component {
4545
constructor(props) {
4646
super(props);
4747
this.state = {
48-
inputViewLayout: {width:window.width, height:100,},
48+
inputViewLayout: {width:window.width, height:86,},
4949
menuContainerHeight: 1000,
5050
isDismissMenuContainer: false,
51+
shouldExpandMenuContainer: false,
5152
};
5253

5354
this.updateLayout = this.updateLayout.bind(this);
@@ -189,7 +190,10 @@ export default class Chat extends Component {
189190
componentWillUnmount() {
190191
JMessage.removeReceiveMessageListener(this.receiveMessageCallBack)
191192
AuroraIController.removeMessageListDidLoadListener(this.messageListDidLoadCallback)
192-
UIManager.dispatchViewManagerCommand(findNodeHandle(this.refs["MessageList"]), 1, null)
193+
if (Platform.OS === 'android') {
194+
UIManager.dispatchViewManagerCommand(findNodeHandle(this.refs["MessageList"]), 1, null)
195+
}
196+
193197
}
194198

195199
updateLayout(layout) {
@@ -208,12 +212,29 @@ export default class Chat extends Component {
208212
width: Dimensions.get('window').width,
209213
height: 100
210214
},
215+
shouldExpandMenuContainer: false,
211216
});
212217
}
213218

214-
onTouchEditText() {
219+
onTouchEditText = () => {
215220
console.log("scroll to bottom")
216221
AuroraIController.scrollToBottom(true);
222+
if (this.state.shouldExpandMenuContainer) {
223+
this.setState({inputViewLayout: {width:window.width, height:420,}})
224+
}
225+
226+
}
227+
228+
onFullScreen = () => {
229+
this.setState({
230+
inputViewLayout: {width: window.width, height:window.height}
231+
})
232+
}
233+
234+
onRecoverScreen = () => {
235+
this.setState({
236+
inputViewLayout: {width: window.width, height: 480}
237+
})
217238
}
218239

219240
onMsgClick = (message) => {
@@ -358,15 +379,23 @@ export default class Chat extends Component {
358379
}
359380

360381
onSwitchToMicrophoneMode = () => {
361-
this.updateLayout({width:window.width, height:420,})
382+
this.updateLayout({width:window.width, height:338,})
362383
}
363384

364385
onSwitchToGalleryMode = () => {
365-
this.updateLayout({width:window.width, height:420,})
386+
this.updateLayout({width:window.width, height:338,})
366387
}
367388

368389
onSwitchToCameraMode = () => {
369-
this.updateLayout({width:window.width, height:420,})
390+
if (Platform.OS == "android") {
391+
this.updateLayout({width:window.width, height: 338})
392+
this.setState({
393+
shouldExpandMenuContainer: true
394+
})
395+
} else {
396+
this.updateLayout({width:window.width, height:338,})
397+
}
398+
370399
}
371400

372401
onShowKeyboard = (keyboard_height) => {
@@ -413,6 +442,8 @@ export default class Chat extends Component {
413442
onSwitchToCameraMode={this.onSwitchToCameraMode}
414443
onShowKeyboard={this.onShowKeyboard}
415444
onTouchEditText={this.onTouchEditText}
445+
onFullScreen={this.onFullScreen}
446+
onRecoverScreen={this.onRecoverScreen}
416447
/>
417448
</View>
418449
);

example/app/routes/Home/ConversationList/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export default class ConversationList extends React.Component {
116116
this.props.navigation.setParams({
117117
createConversation: this._onCreateConversation
118118
});
119+
119120
}
120121
componentWillMount() {
121122
this.reloadConversationList()

example/ios/JMessageDemo.xcodeproj/project.pbxproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,17 @@
601601
name = Products;
602602
sourceTree = "<group>";
603603
};
604+
6291C0931F99C22600C85F64 /* Recovered References */ = {
605+
isa = PBXGroup;
606+
children = (
607+
E53DEE966F3C4EF59620DD03 /* libRNSVG.a */,
608+
B68903A680EE48DAA80CB4A8 /* libRCTJMessageModule.a */,
609+
B3D3338066F545108CE6489C /* libAuroraIMUI.a */,
610+
2C597C5BCCDA4718A237069C /* libRCTJCoreModule.a */,
611+
);
612+
name = "Recovered References";
613+
sourceTree = "<group>";
614+
};
604615
62D683711F43E8890083CDF6 /* Products */ = {
605616
isa = PBXGroup;
606617
children = (
@@ -666,6 +677,7 @@
666677
00E356EF1AD99517003FC87E /* JMessageDemoTests */,
667678
83CBBA001A601CBA00E9B192 /* Products */,
668679
621730111F4DAA24001ADED4 /* Frameworks */,
680+
6291C0931F99C22600C85F64 /* Recovered References */,
669681
);
670682
indentWidth = 2;
671683
sourceTree = "<group>";

ios/RCTJMessageModule.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@
239239
"$(inherited)",
240240
"$(PROJECT_DIR)/RCTJMessageModule",
241241
);
242+
HEADER_SEARCH_PATHS = "$(SRCROOT)/../../react-native/React/**";
242243
OTHER_LDFLAGS = "-ObjC";
243244
PRODUCT_NAME = "$(TARGET_NAME)";
244245
SKIP_INSTALL = YES;
@@ -253,6 +254,7 @@
253254
"$(inherited)",
254255
"$(PROJECT_DIR)/RCTJMessageModule",
255256
);
257+
HEADER_SEARCH_PATHS = "$(SRCROOT)/../../react-native/React/**";
256258
OTHER_LDFLAGS = "-ObjC";
257259
PRODUCT_NAME = "$(TARGET_NAME)";
258260
SKIP_INSTALL = YES;

ios/RCTJMessageModule/JMessage.framework/Headers/JMSGConstants.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,10 @@ typedef NS_ENUM(NSInteger, JMSGEventNotificationType) {
212212

213213
/// 事件类型: 消息撤回
214214
kJMSGEventNotificationMessageRetract = 55,
215+
/// 事件类型: 消息透传
216+
kJMSGEventNotificationMessageTransparent = 58,
217+
/// 事件类型: 消息回执变更
218+
kJMSGEventNotificationMessageReceiptStatusChange = 68,
215219

216220
// 消息事件
217221
/// 事件类型: 群组被创建
@@ -314,6 +318,8 @@ typedef NS_ENUM(NSInteger, JMSGSDKErrorCode) {
314318
kJMSGErrorSDKMediaHashCodeIllegal = 864006,
315319
/// 媒体HASH校验失败
316320
kJMSGErrorSDKMediaHashVerifyFailed = 864007,
321+
/// 这条消息不支持转发
322+
kJMSGErrorSDKMessageNotSupportForward = 864008,
317323

318324
// ------------------------ Message (865xxx)
319325

@@ -413,6 +419,8 @@ typedef NS_ENUM(NSUInteger, JMSGTcpErrorCode) {
413419
kJMSGErrorTcpUserNotRegistered = 801003,
414420
/// 用户密码错误
415421
kJMSGErrorTcpUserPasswordError = 801004,
422+
/// 多通道同时登录错误,登录失败
423+
kJMSGErrorTcpLoginMultiChannelError = 801007,
416424
/// 目标用户不存在
417425
kJMSGErrorTcpTargetUserNotExist = 803003,
418426
/// 目标群组不存在
@@ -455,14 +463,6 @@ static NSString *const KEY_REGION = @"region"; //区域
455463
static NSString *const KEY_SIGNATURE = @"signature";//签名
456464
static NSString *const KEY_ADDRESS = @"address"; //地址
457465
static NSString *const KEY_STAR = @"star";
458-
static NSString *const KEY_UID = @"uid";
459-
static NSString *const KEY_NO_DISTURB = @"no_disturb";
460-
static NSString *const KEY_BLACKLIST = @"blicklist";
461-
static NSString *const KEY_NOTE_NAME = @"memo_name";//note_name
462-
static NSString *const KEY_NOTE_TEXT = @"memo_others";//note_text
463-
static NSString *const KEY_SHIELD_GROUP = @"shield_group";
464-
static NSString *const KEY_USER_MTIME = @"mtime";
465-
static NSString *const KEY_USER_CTIME = @"ctime";
466466

467467

468468

0 commit comments

Comments
 (0)