Location Proxies, are they capable?

64 views
Skip to first unread message

Tim Stone

unread,
May 18, 2012, 12:53:26 PM5/18/12
to sam...@googlegroups.com
Hi guys,

I'm writing a Spotify app and part of their guidelines state that:

When your application is launched, Spotify will load its index.html from within the application bundle and push it onto the global history stack. To load subsequent pages/sections, use the full URI of the resource you’re going to load, like… `<a href="href="href="spotify:app:$APPNAME:argument">`  …or the history of your application won’t be attached to the global history in Spotify, meaning the back/forward buttons in Spotify won’t behave as expected. You can also push new states programmatically, by setting window.location to spotify:app:$APPNAME:arguments". Avoid history.pushState() for pushing new pages onto the stack - you’ll get a security exception if you try to do so.

Is this at all doable with Sammy? I've played with Sammy's Location and Path Proxies which look promising but I'm not sure exactly what to do with them!

I've also tried:

`this.before('', function(route) {
  window.location = "spotify:app:myapp:" + route.path;
}); `

to no real avail. Both using Path Proxies and the before() method seem to break my app more than help it but possibly just because I'm using them wrong.

Any help would be hugely appreciated,
Tim

Daniel D.

unread,
May 18, 2012, 1:26:42 PM5/18/12
to sam...@googlegroups.com
Per recent (and still fresh in my mind) review of Sammy's v.0.6.3
code, "window.location = new_location" is all that Sammy does when
it's own "setLocation" is invoked. Otherwise, it just listens / polls
for changes in window.location. In other words, i did not see any
evidence of stable pre 0.7.x versions of Sammy using anything but
window.location. This likely means that 0.6.3 should work for you.
0.7.+ may not depending on the browser.

Daniel.
> --
> You received this message because you are subscribed to the Google Groups
> "Sammy.js" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/sammyjs/-/lmwlRby0eZcJ.
> To post to this group, send email to sam...@googlegroups.com.
> To unsubscribe from this group, send email to
> sammyjs+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/sammyjs?hl=en.

alexandroid

unread,
May 19, 2012, 3:27:26 AM5/19/12
to Sammy.js
Hi Tim,

What's a Spotify app?

Tim Stone

unread,
May 19, 2012, 6:13:11 AM5/19/12
to sam...@googlegroups.com
Spotify is a cloud-based music player, a Spotify app is basically a web app that adheres to Spotify's integration guidelines.

So when using Spotify people can click on your app's icon and (hopefully) benefit from whatever extended capabilities it allows.

Hope that helps!
Reply all
Reply to author
Forward
0 new messages