Accessing document in shared guest access folder directly via link or others methods (sharepoint)

I need a way to access the access the following file via one-click.

https://websiteName.sharepoint.com/folder/subfolder/document.pdf

I have a link for guest access to the subfolder containing the file. It is in the following format:

https://websiteName.sharepoint.com/:f:/g/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA?e=BBBBBB

If trying to access the file directly without first accessing the shared folder, sharepoint will prompt for login credentials.


What I learned so far  Accessing:     https://WEBSITE_NAME.sharepoint.com/:f:/g/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA?e=BBBBBB     --> HTTP 301 moved permanently     --> redirects to the following  https://WEBSITE_NAME.sharepoint.com/_layouts/15/guestaccess.aspx?e=BBBBBB&share=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&cid=CCCCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCCCC     --> HTTP 302 found     --> sets cookie FedAuth     --> redirects to the following  https://WEBSITE_NAME.sharepoint.com/FOLDER/SUBFOLDER?cid=CCCCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCCCC     --> returns list of files in shared folder     --> file I want to access is present in the list but     --> accessing/downloading this file is not friendly/easy on mobile devices  https://WEBSITE_NAME.sharepoint.com/FOLDER/SUBFOLDER/DOCUMENT.PDF     --> accessing this link directly wont work without FedAuth cookie. 

I tried creating a website with a hidden iframe to load the required FedAuth cookie and redirect to the desired file but the iframe load failed due to issues with “Cross origin resources”

Any tips programatically access this file or perhaps even crafting a sharepoint link to set the cookie and redirect to lod the desired file instead of loading the shared folder directory??

I am doing this client side on an iPhone. I do not have any access to the sharepoint permissions.