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

Permission Issue in android 12 #54

Open
Yabaze opened this issue Jan 5, 2023 · 7 comments · May be fixed by #62
Open

Permission Issue in android 12 #54

Yabaze opened this issue Jan 5, 2023 · 7 comments · May be fixed by #62
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Yabaze
Copy link

Yabaze commented Jan 5, 2023

Still im facing permission issue

log: WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE Permission is not given. Permission taking popup (using https://github.com/Karumi/Dexter) is going to be shown

@Yabaze
Copy link
Author

Yabaze commented Jan 5, 2023

I'm using Latest version

implementation 'com.github.Gkemon:Android-XML-to-PDF-Generator:2.6.8'

@Yabaze
Copy link
Author

Yabaze commented Jan 5, 2023

log: Denied permission: android.permission.WRITE_EXTERNAL_STORAGE

log: Granted permission: android.permission.READ_EXTERNAL_STORAGE

log: All necessary permission is not granted by user. Please do that first

private var xmlToPDFLifecycleObserver: PdfGenerator.XmlToPDFLifecycleObserver? = null

binding.viewModel = viewModel
binding.lifeCycle = this
binding.lifecycleOwner = this
xmlToPDFLifecycleObserver = PdfGenerator.XmlToPDFLifecycleObserver(requireActivity())
lifecycle.addObserver(xmlToPDFLifecycleObserver!!)

PdfGenerator.getBuilder().setContext(requireActivity()).fromViewSource()
.fromViewList(listOf(binding.contentView, binding.questionsRecyclerView))
.setFileName(
"Test" + " - " + Calendar.getInstance().timeInMillis
)
.setFolderNameOrPath(resources.getString(R.string.app_name))
.actionAfterPDFGeneration(PdfGenerator.ActionAfterPDFGeneration.OPEN)
.savePDFSharedStorage(xmlToPDFLifecycleObserver)
.build(object : PdfGeneratorListener() {
override fun onFailure(failureResponse: FailureResponse) {
super.onFailure(failureResponse)
Toast.makeText(context, "" + failureResponse.errorMessage, Toast.LENGTH_SHORT)
.show()
}

            override fun showLog(log: String) {
                super.showLog(log)
                Toast.makeText(context, "log->$log", Toast.LENGTH_SHORT)
                    .show()
                Log.e(
                    "generatePdf", "log: $log"
                )
            }

            override fun onStartPDFGeneration() {}
            override fun onFinishPDFGeneration() {}
            override fun onSuccess(response: SuccessResponse) {
                super.onSuccess(response)
            }
        })

@Gkemon
Copy link
Owner

Gkemon commented May 16, 2023

Hi, @Yabaze sorry for the late reply. Actually, it might be for Dexter Library and which is not yet maintained. So I think I need to change it. for now, you check this permission from your app level with proper library

@Gkemon Gkemon added enhancement New feature or request help wanted Extra attention is needed labels May 16, 2023
@Gkemon
Copy link
Owner

Gkemon commented May 16, 2023

Need help

If any want interested, please change the Dexter library from my project and add some thing best for handling all of the cases and pull request me.

@Deepalli-developer
Copy link

implementation 'com.github.Gkemon:Android-XML-to-PDF-Generator:2.6.8' i am using latest librray but i got also same permission denied error

@theMr17 theMr17 linked a pull request Aug 29, 2023 that will close this issue
@theMr17
Copy link
Contributor

theMr17 commented Sep 17, 2023

Hi @Gkemon, Hope you are doing well! Please have look at my PR #62.

@Gkemon
Copy link
Owner

Gkemon commented Sep 17, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants