botstack icon indicating copy to clipboard operation
botstack copied to clipboard

Introducing: Webviews for Botstack

Open davidmann4 opened this issue 8 years ago • 4 comments

@pferdefleisch @ramonh @tosh @christophrumpel @legeekette @toshe @Cryt1c @evo42

Hi,

with https://github.com/davidmann4/botstack/commit/9c66197db9891c6953a6504674a8a024c7828ec9 I've added webview support. Now I am thinking about common webviews users would might need.

so far I´ve added a datepicker. Feel free to brainstorm Ideas.

@tosh: you already played around with camera support in webviews?

cheers,

David

how it works: bot framework creates a link to the webview - user has a small browser which loads a rails servlet. The HTML5 site makes a post request to another servlet which handles the request like a normal message. ecample: https://github.com/davidmann4/botstack/blob/master/app/views/webview/date_picker.html.erb

security: i generate a token (HMAC(user_id, rails_random_secret)) to sign the url of the webview. The webview also has a CSRF field. https://github.com/davidmann4/botstack/blob/master/app/controllers/webview_controller.rb#L6

davidmann4 avatar Dec 25 '16 08:12 davidmann4

I'm looking forward to see how you implemented this. You might want to look into https://github.com/trailblazer/cells for this. May be overkill but this is a great use case for it.

mraaroncruz avatar Dec 25 '16 13:12 mraaroncruz

I haven't (camera) but @sido378 & @allanberger might know if camera access is already supported in webviews

tosh avatar Dec 25 '16 16:12 tosh

if you have ideas for webviews let me know - currently on the roadmap: datepicker: from - to datepicker: single_date datepicker: single_date_with_time

davidmann4 avatar Dec 25 '16 17:12 davidmann4

Have to day I haven't used them before, but I will let you know when I have some ideas.

christophrumpel avatar Dec 30 '16 09:12 christophrumpel