lookupByBundleId method
Look up by bundle id.
Example: look up Google Maps iOS App:
lookupURLByBundleId('com.google.Maps');
lookupURLByBundleId('com.google.Maps', country: 'FR');
Implementation
Future<Map?> lookupByBundleId(String bundleId,
{String? country = 'US', bool useCacheBuster = true}) async {
assert(bundleId.isNotEmpty);
if (bundleId.isEmpty) {
return null;
}
final url = lookupURLByBundleId(bundleId,
country: country ??= '', useCacheBuster: useCacheBuster)!;
if (debugLogging) {
print('upgrader: download: $url');
}
try {
final response =
await client!.get(Uri.parse(url), headers: clientHeaders);
if (debugLogging) {
print('upgrader: response statusCode: ${response.statusCode}');
}
final decodedResults = _decodeResults(response.body);
return decodedResults;
} catch (e) {
if (debugLogging) {
print('upgrader: lookupByBundleId exception: $e');
}
return null;
}
}