findApp method

  1. @override
Future<ApiResourceDto<AppAttributesDto>> findApp(
  1. String bundleId
)
override

Finds the app whose bundle identifier exactly matches bundleId.

Implementation

@override
Future<ApiResourceDto<AppAttributesDto>> findApp(String bundleId) async {
  final query = Uri(
    queryParameters: <String, String>{'filter[bundleId]': bundleId},
  ).query;
  final response = _map(await _request('GET', '/v1/apps?$query'), 'apps');
  final data = _list(response['data'], 'apps.data');
  SmfError.check(
    data.length == 1,
    data.isEmpty
        ? 'No App Store Connect app found for $bundleId'
        : 'Multiple App Store Connect apps found for $bundleId',
    SmfErrorCode.appNotFound,
  );
  return _appResource(data.single);
}