reVerifyAppLinks static method
Force re-verification of app links
Implementation
static Future<VerificationResult> reVerifyAppLinks(String packageName) async {
if (!await isAdbAvailable()) {
return VerificationResult(
checkName: 'Android Runtime Test - Re-verify App Links',
status: VerificationStatus.skipped,
message: 'ADB not available',
);
}
if (!await isDeviceConnected()) {
return VerificationResult(
checkName: 'Android Runtime Test - Re-verify App Links',
status: VerificationStatus.skipped,
message: 'No Android device connected',
);
}
try {
final result = await Process.run('adb', [
'shell',
'pm',
'verify-app-links',
'--re-verify',
packageName,
]);
if (result.exitCode == 0) {
return VerificationResult(
checkName: 'Android Runtime Test - Re-verify App Links',
status: VerificationStatus.success,
message: 'App links re-verification initiated',
fixSuggestion: 'Wait a few seconds, then check status again',
);
} else {
return VerificationResult(
checkName: 'Android Runtime Test - Re-verify App Links',
status: VerificationStatus.error,
message: 'Failed to re-verify app links: ${result.stderr}',
);
}
} catch (e) {
return VerificationResult(
checkName: 'Android Runtime Test - Re-verify App Links',
status: VerificationStatus.error,
message: 'Error re-verifying app links: $e',
);
}
}