Changed to generate a channel token using ajax instead to be able to work with an app cache.