easemob / react-native-chat-sdk

MIT License
2 stars 10 forks source link

Not getting all historical message of conversation #28

Open ahmedShaheer3 opened 1 year ago

ahmedShaheer3 commented 1 year ago

Description

hey there thanks advance for you time and help. i calling fetchHistoryMessages() but not getting all historical message specially the new one's also i have getLatestMessage() its working fine and showing me the latest message but when i call fetchHistoryMessages() i am not getting all the history message following i my code

let paginationLimit = 45 let lastEvaluatedKey = '' let convType = 0; // getting messages from server const conversation = await chatManager.fetchHistoryMessages( convId, convType, paginationLimit, lastEvaluatedKey, ); console.log('RESPONSE[RETRIVE_CONVERSATION_MESSAGE]', conversation);

Note: just for testing i again switch back to version 1.1.1 its working fine i am getting all message currenlty i am using 1.1.2beta-4

Version

1.1.2beta-4

Output of npx react-native info

System: OS: macOS 13.0.1 CPU: (8) arm64 Apple M1 Memory: 99.14 MB / 8.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.9.0 - /opt/homebrew/bin/node Yarn: 1.22.19 - /opt/homebrew/bin/yarn npm: 8.19.1 - /opt/homebrew/bin/npm Watchman: 2022.09.05.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4 Android SDK: Not Found IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8815526 Xcode: 14.3/14E222b - /usr/bin/xcodebuild Languages: Java: 11.0.16.1 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.1.0 => 18.1.0 react-native: 0.70.6 => 0.70.6 react-native-macos: Not Found npmGlobalPackages:

Steps to reproduce

npx react-native run-android

yarn instal react-native-agora-chat

  // getting messages from server
  const conversation = await chatManager.fetchHistoryMessages(
    convId,
    convType,
    paginationLimit,
    lastEvaluatedKey,
  );

Snack, code example, screenshot, or link to a repository

https://github.com/

Platform

SimulatorOrDevice

iOSVersion

ahmedShaheer3 commented 1 year ago

hey there i am still facing this issue in 1.1.2-beta-5

AsteriskZuo commented 1 year ago

The fetchHistoryMessages interface mainly added the direction parameter between version 1.1.1 and version 1.1.2. If you switch versions, ios recommends cleaning the cache. Problems can be checked by comparison. For example: start xcode or android studio, check the input parameters in debug mode, and compare the results.