【发布时间】:2011-11-15 12:22:42
【问题描述】:
我的应用程序中有一个 ListPanel,定义如下:
//Create List View Using ListStore Created in data.js
SpotiPod.listPanel = new Ext.List({
id: 'artistList',
store: SpotiPod.ListStore,
itemTpl: '<div>{ArtistName}</div>',
grouped: true,
indexBar: true,
listeners: {
itemtap: function(list, index){
var rec = list.store.getAt(index)
//Ext.Msg.alert(rec.get('ArtistName'), 'Load In Spotify?', function(){location.href = rec.get('SpotifyURI');});
Ext.Msg.show({
title: rec.get('ArtistName'),
msg: 'Load In Spotify?',
buttons: Ext.MessageBox.YESNO,
fn: showSpotify
});
function showSpotify(btn){
if(btn == 'yes'){
window.open(rec.get('SpotifyURI'));
}
}
}
}
});
应用程序显示艺术家列表,并应使用 Spotify URI 提供指向他们的链接,当您单击“是”加载 Spotify 时,它应该打开应用程序并显示艺术家。下面的应用程序在浏览器和 iPhone 上的移动 safari 中运行良好。但是,如果我将应用程序添加到主屏幕并运行它,那么它就不再起作用了。我收到“无法显示 URL”的错误消息。
是否有人对如何更改此设置以允许正确触发链接有任何想法?
干杯
亚当
【问题讨论】:
-
将应用程序添加到主屏幕是什么意思?
-
正如我在移动 safari 中访问网络应用程序的地址,即 mydomain.com/mywebapp 并从那里运行到 spotify 的链接将起作用并打开 spotify 应用程序并加载正确的信息。如果我选择“添加到主屏幕”并将应用程序放在我的跳板上,那么这将停止工作。
标签: javascript iphone url sencha-touch