你知道如何将一个网络应用程序添加到iPhone的主屏幕......现在我如何检测我的应用程序是否已添加到用户iPhone的主屏幕.
如果已添加,我如何启动存储在用户主屏幕而不是Safari中的应用程序.
NOTE : its a web app simply bookmarked on the home screen of an iPhone - it is NOT a native app.
有任何想法吗 ?
我正在尝试使用http://goo.gl带有以下jQuery函数的API 来缩短URL
$.ajax({
url: 'https://www.googleapis.com/urlshortener/v1/url?key=MY_API_KEY',
crossDomain: true,
type: 'POST',
contentType: 'application/json',
data: '{longUrl:"'+encodeURI(url)+'"}',
dataType: 'jsonp',
success: function(e) {
alert(JSON.stringify(e));
}
});
Run Code Online (Sandbox Code Playgroud)
我在JSON中收到以下错误:
{"error":{"errors":[{"domain":"global","reason":"required","message":"Required parameter: shortUrl","locationType":"parameter","location":"shortUrl"}],"code":400,"message":"Required parameter: shortUrl"}}
Run Code Online (Sandbox Code Playgroud)
为什么要求短网址?我究竟做错了什么?