在我的项目中,App已经在App Store上提供。只要App Store上有新版本,应用程序就会弹出提示新版本可用的链接并更新它。用户可以现在或以后通过单击各个按钮进行更新。如何计算新版本在App Store上可用的天数
我可以从App Store中针对捆绑标识符获取有关应用程序的信息来实现这一目标。
NSURL *lookupURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://itunes.apple.com/lookup?bundleId=%@", bundleIdentifier]];
NSData *lookupResults = [NSData dataWithContentsOfURL:lookupURL];
NSDictionary *jsonResults = [NSJSONSerialization JSONObjectWithData:lookupResults options:0 error:nil];
然后槽收到JSON,我可以得到有关新的可用版本号,支持的设备等信息。
jsonResults ---> {
resultCount = 1;
results = (
{
advisories = (
"Unrestricted Web Access"
);
artistId = @@@@@@@@@;
artistName = @@@@@@@@@;
artistViewUrl = @@@@@@@@@";
artworkUrl100 = @@@@@@@@@";
artworkUrl512 = @@@@@@@@@;
artworkUrl60 = @@@@@@@@@;
bundleId = @@@@@@@@@;
contentAdvisoryRating = @@@@@@@@@;
currency = USD;
description = @@@@@@@@@;
features = (
iosUniversal
);
fileSizeBytes = @@@@@@@@@;
formattedPrice = Free;
genreIds = (
@@@@@@@@@
);
genres = (
@@@@@@@@@
);
ipadScreenshotUrls = (
@@@@@@@@@
);
isGameCenterEnabled = 0;
isVppDeviceBasedLicensingEnabled = 1;
kind = software;
languageCodesISO2A = (
@@@@@@@@@@@
);
minimumOsVersion = "7.0";
price = 0;
primaryGenreId = @@@@@@@@@;
primaryGenreName = @@@@@@@@@;
releaseDate = "[email protected]@@@@@@";
releaseNotes = @@@@@@@@@;
screenshotUrls = (
@@@@@@@@@
);
sellerName = @@@@@@@@@;
supportedDevices = (
@@@@@@@@@@@
);
trackCensoredName = @@@@@@@@@;
trackContentRating = "17+";
trackId = @@@@@@@@@;
trackName = @@@@@@@@@;
trackViewUrl = @@@@@@@@@;
version = "2.0";
wrapperType = software;
}
);
}
现在我想计算,因为有多少天新版本可用,用户还没有更新它。我收到的JSON不包含最新更新版本日期。
有没有办法知道这个时间差直接形成的App Store。
你可以只发布你现在存储在jsonResults – Max