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',
String? language = 'en',
bool useCacheBuster = true}) async {
assert(bundleId.isNotEmpty);
if (bundleId.isEmpty) {
return null;
}
final url = lookupURLByBundleId(bundleId,
country: country ?? '',
language: language ?? '',
useCacheBuster: useCacheBuster)!;
if (debugLogging) {
print('Version Sentry: Final url $url');
}
try {
final response =
await client!.get(Uri.parse(url), headers: clientHeaders);
final decodedResults = _decodeResults(response.body);
return decodedResults;
} catch (e) {
if (debugLogging) {
print('Version Sentry: API Error: $e');
}
return null;
}
}