Access Issue with Public PDF Files in Google Cloud Storage

Widgets & Design

Hello everyone,

I’m encountering an issue with accessing PDF files generated in Google Cloud Storage from my FlutterFlow application.

Context:

  • I am using a Cloud Function to generate PDF files and upload them to a Google Cloud Storage bucket.

  • After the PDF is created, I make it public using blob.make_public().

  • I have confirmed that the file is accessible by using the URL in a browser, where it displays correctly.

  • Even if the file is created by another process, a long time ago, I face the same issue

Problem:

However, when I try to access the PDF URL via a "Launch URL" widget in FlutterFlow, I receive the following error :

This XML file does not appear to have any style information associated with it. The document tree is shown below. <Error> <Code>AccessDenied</Code> <Message>Access denied.</Message> <Details>Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object. Permission 'storage.objects.get' denied on resource (or it may not exist).</Details> </Error>

Additional Details:

  • The file displays correctly if I refresh the page or access the URL directly in the browser.

  • The URL I’m using is exactly the one provided after the upload, and it is well-formatted.

Questions:

  1. Has anyone encountered this issue and have suggestions for resolving it?

  2. Are there any specific settings in FlutterFlow that I should check regarding access to public URLs?

Thank you in advance for your help!

What have you tried so far?

What We’ve Tried So Far:

  • I switched to a different PDF rendering library, but it didn't resolve the issue.

  • I implemented waits of 5 to 10 seconds, despite the PDF being generated in 1 to 2 seconds, but that also had no effect.

  • I configured all elements in Cloud Storage to be public, but the problem persists.

Did you check FlutterFlow's Documentation for this topic?
Yes
1