Cloudkibo / iOS

iOS Code
0 stars 0 forks source link

Attach URL in chat #555

Closed sumairasaeed closed 7 years ago

sumairasaeed commented 7 years ago

Write logic to attach URL in chat as whatsapp. URL should be clickable and should open that URL

sumairasaeed commented 7 years ago

Looked and investigated whatsapp feature of attaching URL. Thought over how we can implement it in a similar way as whatsapp There are two parts of sharing URL in whatsapp:

1- Detecting from text view that a URL has been typed.

2- After detecting that URL has been typed, fetch some basic metadata about webpage. e.g. Title , basic info, URL , logo etc.

screen shot 2017-04-04 at 4 13 55 pm

3- URL needs to be linked to a webpage and must be clickable and open up the relevant webpage.

sumairasaeed commented 7 years ago

Here is the link that talks about this feature of whatsapp http://www.androidpolice.com/2015/10/14/whatsapp-2-12-312-starts-showing-rich-previews-for-shared-urls/ (Although this link talks about android but it is similar on iOS)

I have explored on detecting URL from text view. Also investigated on fetching metadata of URL at realtime while typing. Found few open source libraries for this purpose. Here is the link https://github.com/LeonardoCardoso/SwiftLinkPreview

Working to write logic for implementing above described steps: 1- Detecting from text view that a URL has been typed. 2- After detecting that URL has been typed, fetch some basic metadata about webpage. e.g. Title , basic info, URL , logo etc. 3- URL needs to be linked to a webpage and must be clickable and open up the relevant webpage.

Have opened a seperate task to do its UI work as whatsapp UI is rich and we will make same. https://github.com/Cloudkibo/iOS/issues/555

sumairasaeed commented 7 years ago

I have completed the coding for this. Now we are able to share and detect URL/URLs shared and fetch its metadata from URL at runtime while typing as whatsapp.

jekram commented 7 years ago

Thanks

jekram commented 7 years ago

I do not understand why we are opening another issue #555? and how did we tested this without UI?