import React, {Component} from 'react';
import {Alert, Platform, View} from 'react-native';
import WebView, {FileDownload} from 'react-native-webview';
const HTML = `
\n
Downloads
Example zip file download
`;
type Props = {};
type State = {};
export default class Downloads extends Component {
state = {};
onFileDownload = ({ nativeEvent }: { nativeEvent: FileDownload } ) => {
Alert.alert("File download detected", nativeEvent.downloadUrl);
};
render() {
const platformProps = Platform.select({
ios: {
onFileDownload: this.onFileDownload,
},
});
return (
);
}
}