Closed Bug 1122174 Opened 5 years ago Closed 4 years ago
Access a SMS thread via URL
In order to search for sms threads via Rocketbar, we would like to have a way of accessing a SMS thread by URL. Once we are able to do so, we can store the URL and metadata in the places datastore.
With this small patch and using this URL: app://sms.gaiamobile.org/#thread&id=10 this works fine :) Needs unit tests ! In Bug 1011089 we should change the hash when changing panel.
(In reply to Julien Wajsberg [:julienw] from comment #1) > Created attachment 8549927 [details] [review] > Github PR > > With this small patch and using this URL: > app://sms.gaiamobile.org/#thread&id=10 this works fine :) > > Needs unit tests ! and clean up of course, this is quick and dirty. For example I'd do a "MessageManager.getThreadFromId" that would do both the search and the registerMessage call.
That was quick :) I think one thing that might be nice would be to define a common URL structure to use across apps. I think this would be extremely helpful when doing cross-app development in gaia, and help keep things sane. If we want to use a hash, this could look something like: app://origin#object/action/param:value In the SMS case, this could look like: app://sms.gaiamobile.org/index.html#thread/view/id/10 Maybe a calendar event could have: app://calendar.gaiamobile.org/index.html#event/view/id/12345 or app://calendar.gaiamobile.org/index.html#account/edit/id/12345 This is just a quick thought, and may not be the most ideal. I do think there would be a lot of benefit in creating a standardized URL structure.
Oops, in that example code I did <paramKey>/<paramValue>. It could be that, or delimited with colons. I've seen both work well.
I used this format because the code was already done to support this format ;) but yeah, any format woud work for me, we just need to define one.
(In reply to Julien Wajsberg [:julienw] from comment #5) > I used this format because the code was already done to support this format > ;) but yeah, any format woud work for me, we just need to define one. Sounds good. Let me spend some time in the parent bug (bug 1122171) suggesting a format and getting feedback from people.
I'm putting the fix I did here to my patch in bug 1162030, do duping. Once we settle on a format, we can change how we generate/parse URLs.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1162030
You need to log in before you can comment on or make changes to this bug.