strvcom / ios-chat-component

Chat modular library
MIT License
1 stars 1 forks source link

Store messages #25

Closed cejanen closed 4 years ago

cejanen commented 4 years ago

Add keychainswift as 3rd party for wrapping keychain operations. Custom KeychainManager class created. Added methods to store / load unsent messages from chatcore. To be able to resend messages after app did become active is necessary to post notification from app delegate. For now storing unsent message whenever send message fails (not just for network, will be updated when merging all tasks features). Also custom object to wrap data was created. Resending logic is at core.

cejanen commented 4 years ago

I think at core is missing remove from notif center...

cejanen commented 4 years ago

I removed notif and created resend func at core.

cejanen commented 4 years ago

@schwarja I found out that cache messages can be some either they are not so I added custom generated id (before I could send twice same message but would send only once in resend logic) Also I added condition not to store same message twice on keychain and also added remove logic at chat core. DidbecomeActive notif is also hooked to chat core