使用react native pdf视图传递标头值

时间:2018-12-04 09:04:04

标签: reactjs native react-native-pdf

请大家我发现传递标头值来响应本机pdf视图(https://https://github.com/rumax/react-native-PDFView)。我已经尝试过这样做const resources = { resource: 'fjfjfjhfjjfj.com', resourceType: 'url', urlProps: { method: 'GET', headers: { 'Accept-Language': 'en-us,en;q=0.5', 'Accept-encoding': 'application/pdf', 'Referer': 'http://localhost/youdeymad', }, } };

  `<PDFView
    style={{ flex: 1 }}
    onError={error => {
      Alert.alert(
        'Error',
        'An error occured fetching invoice, Please try again later'
      );
      props.stopLoading(false);
    }}
    onLoad={() => props.stopLoading(false)}
    // resource={`${SERVER_URL}/mobilesales/showreceipt/${props.saleId}`}
    //  resourceType="url"

    // Run "node demo/utils/server.js" to start the local server. Put correct IP
    resource={resources.resource}
    resourceType={resourceType}
    urlProps={resources.urlProps}
  />`




0 个答案:

没有答案