getDeepLink method
Implementation
Future<String?> getDeepLink({
required String url,
required String idExtractionRegex,
required String androidDeepLinkTemplate,
required String iosDeepLinkTemplate,
}) async {
String filledUrl(String id) {
return Platform.isAndroid
? androidDeepLinkTemplate.replaceAll('{id}', id)
: iosDeepLinkTemplate.replaceAll('{id}', id);
}
final newEntityId = await _getSocialMediaId(url, idExtractionRegex);
logger.d('newEntityId: $newEntityId');
if (newEntityId != null) {
final newUrl = filledUrl(newEntityId);
logger.d('newUrl: $newUrl');
return newUrl;
}
return null;
}