(iOS SDK) Spotted a bug with protocol CKItemsBrowserDelegate
RespondidaI experienced a strange behaviour with "CKItemsBrowserDelegate" protocol.
The method ...
-(void) itemsBrowser:(CKItemsBrowser*)browser didAddCacheItems:(NSArray*)newItems atIndexes:(NSIndexSet*)indexes;
seems to be fired twice when the delegate is active.
The scenario to reproduce is :
- Run you chat app
- When the app is active, send message to "a contact" in current device via other device.
- then Open the contact conversation.
Then the Output :
The right scenario : the messagesBrowser will fire method "didAddCacheItems" once. The new message should be append at the bottom/last of the cacheItems.
Scenario that currently happen : the messagesBrowser (CKItemsBrowserDelegate) fires method "didAddCacheItems" twice. The first cacheItems is the new message, the the second cacheItems is the rest of the message (based on how many messages per page you wanna show #pageSize).
With the current scenario, my messages appeared in the wrong position. The latest message appear first, then follow the other last messages.
Latest message should show at the bottom, not first.
NB: this bug only happen when the page "Conversation" is open at the first time when the app fresh RUN. When you open the conversation with a contact at the second time and later, the method ""didAddCacheItems" fired normally (only once).
Hope the SDK team can investigate this issue!
-
Hi Gerson !
You may have a look at the RainbowiOSSDKIM demo I had to deal with the same "issue", I think your problem is that the messages are stored in the wrong order in your array and then the indexes sent by CKItemsBrowser don't match !
I hope it'll solve your issue
Iniciar sesión para dejar un comentario.
Comentarios
1 comentario