twilio / twilio-chat-demo-ios

Twilio Programmable Chat Demo Application for iOS
28 stars 16 forks source link

Sending messages while offline #22

Open martinrybak opened 7 years ago

martinrybak commented 7 years ago

If I take the device offline and send a message I will not see the message appear in the chat. If I come back online it will appear. However, if the app is shutdown/restarted, the message will be lost.

Following the "optimistic UI" paradigm, outgoing messages should appear immediately and sent in the background. If the message send fails for a non-network related reason, it should show as failed with an option to retry. See the behavior of the iOS Messages app: https://uxplanet.org/optimistic-1000-34d9eefe4c05

Is this functionality possible in your SDK? If so the demo app should reflect it.

rbeiter commented 6 years ago

Hi @martinrybak – first sorry for the long delay in response! Deeper offline support, including retries of operations when there is no network connection, is on Programmable Chat's roadmap but I do not have a date to share with you at this time. Until then, this is accomplishable only within the host application. When we support this natively, this demo app will definitely reflect how to best utilize that feature.

Govind13100 commented 5 years ago

Hi, is the offline feature is added ? i have a same problem.

Gray-Wind commented 5 years ago

Hi, offline support is not added yet, we have plans to support it, but we still do not have a date to share with you.

s-gilroy commented 5 years ago

@Gray-Wind just to be clear. Does this mean reading existing chats while offline or only sending new messages? My use case requires a user to view chat histories even if the device has no connection. From what I can tell the demo app seems to hold these messages in memory but does not persist them on disk.

Gray-Wind commented 5 years ago

Demo app is made to be very simple. In your app you could store messages in some persistence storage for now.

In the future we do plan to support reading existing messages from channels, which was loaded before. We hope to done it by the end of this year.

s-gilroy commented 5 years ago

Sounds great. Thanks!