在我的項目中,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