codepath17-g7 / chatspot

1 stars 2 forks source link

Do caching and video messages for chat #46

Open EdenShapiro opened 6 years ago

EdenShapiro commented 6 years ago

Here's what the methods that are currently there [should] do:

  1. once user has selected however many photos they want to send, and they click send, getMediaForAssets gets called on those assets
  2. for each asset in the array of assets, the method getFullImageForAsset gets called and retrieves the full-size image for that asset. (there's also getSmallImageForAsset and getVideoForAsset)
  3. the storage client method to store the file gets called, which returns a url
  4. the image with urlString as a key is cached in the Haneke shared cache
  5. the message is sent with ChatSpotClient method sendMessage, with the urlstring as the attachment
  6. in the ChatMessageCell class, the image is fetched from the cache (if it's not in the cache, it gets downloaded from the url) and displayed

Here are some resources: https://stackoverflow.com/a/32601838/3605761 https://github.com/Haneke/HanekeSwift