Skip to content

Commit 861f8e5

Browse files
KenChoiKenChoi
authored andcommitted
Merge branch 'dev' of github.com:jpush/jmessage-react-plugin into dev
2 parents b1b1034 + d6a1390 commit 861f8e5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

ios/RCTJMessageModule/RCTJMessageModule.m

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,12 @@ - (JMSGOptionalContent *)convertDicToJMSGOptionalContent:(NSDictionary *)dic {
821821
return;
822822
}
823823

824+
BOOL isDescend = false;
825+
if (param[@"isDescend"]) {
826+
NSNumber *number = param[@"isDescend"];
827+
isDescend = [number boolValue];
828+
}
829+
824830
[self getConversationWithDictionary:param callback:^(JMSGConversation *conversation, NSError *error) {
825831
if (error) {
826832
failCallback(@[[error errorToDictionary]]);
@@ -832,12 +838,16 @@ - (JMSGOptionalContent *)convertDicToJMSGOptionalContent:(NSDictionary *)dic {
832838
JMSGMessage *message = obj;
833839
return [message messageToDictionary];
834840
}];
835-
841+
836842
if (!messageArr) {
837843
successCallback(@[@[]]);
838844
return;
839845
}
840846

847+
if (isDescend) {
848+
messageDicArr = [[messageDicArr reverseObjectEnumerator] allObjects];
849+
}
850+
841851
successCallback(@[messageDicArr]);
842852
}];
843853
}

0 commit comments

Comments
 (0)