You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The app will crash when we tap a link (inside the pdf ) that begins with "file://". The exception thrown is "exposed beyond app through Intent.getData()".
Sample link file:///C:/Users/Sample/Downloads/Sample%20Project%20Inc.%20User%20Guide%20(1).pdf
For the meantime I forked the app and put a try catch block inside the handleUri method.
Like this :
private void handleUri(String uri) {
// If the property is true just pass the link back to flutter
if (!this.preventLinkNavigation) {
try{
Uri parsedUri = Uri.parse(uri);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(parsedUri);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
if (intent.resolveActivity(context.getPackageManager()) != null) {
context.startActivity(intent, null);
}
}catch (Exception ignored){}
}
this.onLinkHandler(uri);
}
https://github.com/JeffTyfoom/flutter_pdfview
The text was updated successfully, but these errors were encountered:
The app will crash when we tap a link (inside the pdf ) that begins with "file://". The exception thrown is "exposed beyond app through Intent.getData()".
Sample link file:///C:/Users/Sample/Downloads/Sample%20Project%20Inc.%20User%20Guide%20(1).pdf
For the meantime I forked the app and put a try catch block inside the handleUri method.
Like this :
private void handleUri(String uri) {
// If the property is true just pass the link back to flutter
if (!this.preventLinkNavigation) {
try{
Uri parsedUri = Uri.parse(uri);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(parsedUri);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
if (intent.resolveActivity(context.getPackageManager()) != null) {
context.startActivity(intent, null);
}
}catch (Exception ignored){}
}
this.onLinkHandler(uri);
}
The text was updated successfully, but these errors were encountered: