Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow download from HTTP website #36

Closed
ghost opened this issue Mar 24, 2022 · 1 comment
Closed

Allow download from HTTP website #36

ghost opened this issue Mar 24, 2022 · 1 comment

Comments

@ghost
Copy link

ghost commented Mar 24, 2022

Hello,
thanks for your library.
Currently only HTTPS connections are allowed.
Could you add the possibility to get PDF from HTTP connection.

Cleartext HTTP traffic to ... not permitted

You could put an option to the current call:

fun launchPdfFromUrl(
            context: Context?,
            clearText: Boolean = false, //allow clear text (HTTP) connection
            pdfUrl: String?,
            pdfTitle: String?,
            directoryName: String?,
            enableDownload: Boolean = true
        )
@afreakyelf
Copy link
Owner

Hi, Allowing from insecure HTTP connection is not a good practice that is why i can not declare it for all. However please feel free to checkout the repo and take the code of library and change the manifest file.

Then you can try in your application -

<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
    <uses-permission android:name="android.permission.INTERNET" />
    <application
        ...
        android:usesCleartextTraffic="true"
        ...>
        ...
    </application>
</manifest>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant