How to determine the path to a app generated stored file using ios build blocks

The app I'm developing stores a csv file on the phone. Then, I call on postfile to send it to a website where the data are parsed using a php script and stored in a sql table. Works fine on the android using the .MakeFullPath block to form the url for postfile. However, that block uses filescope with the ios build so I can't get the full path to the file on the iphone. Any suggestions? Thanks.

https://doesappinventorrunonios.com/

See also here: Firebase Storage on Android and iOS - #14 by Anke

Thanks Anke. I know that the makefullpath is not working for ios (hence the problem). I was hoping there might be an alternative. Just for context, I spent some time working out the details for posting a file using the android build a couple of years ago. It came down to first finding the full path for the postfile block. So, I have the same problem now with ios until the path can be determined on the fly. Here is a link to the previous post showing how finding the full path was critical to posting the file in android:
Looking for help posting a csv file to a php script (for insertion into mySQL table) using postfile block (not posttext) - #16 by Mark30289

I'd have to check the logic on iOS but I'm not sure it requires a full file path in the PostFile method. Let me check that and get back to you...

1 Like

Just wondering if you had time to look into it further. I've tried using /, //, and no / along with the filename in each case, and no combination worked. Based on that, it seems a full or partial path is required for the postfile block but I'm still not sure. Thank you.

Actually it's worse than I thought. For some reason it's base64-encoding the filename itself rather than reading the file. I'll work on a patch to push out to TestFlight.

1 Like

Many thanks!

Not sure if this was resolved. Thanks again.

I just saw that the postfile block for ios builds is listed as functional... but, I tried using it and it seems to be acting the same way as in the May 1 revelation above (doesn't look like the file contents are being accessed). Wondering if anyone has had success with it? Thanks.

My apologies as this fell off my radar. There is now a new build via TestFlight (2.74 build 41) that should address the issue. Please test it out.

Will do! Thank you.

Quick question... Could I also just use an ipa build onto my own phone to test the (new?) postfile block, or do I have to go through testflight. I installed the Testflight app and opened 2.74 build 41 but am having connection issues using AI companion when prompted. I'm using the https://iosbuildservertest.appinventor.mit.edu/ URL to create the app and to try to connect to Testflight - choosing AI companion from the Connect drop down menu which does present the QR code and 6 digit code for the MIT Testflight app. But then an error occurs when they are connecting. So wondering if the change to the postfile block is present in the app builder, or only in Testflight. Thanks.

You may need to try restarting the companion app by opening the app switcher and swiping up to close it.

The build server hasn't been updated yet with all of the additional patches on TestFlight.

So I have to have app inventor running on my iphone? I have it opened on my pc at home which shares the same wifi connection as my iphone, which is running the Tesflight app. Sorry, to bug you but I haven't used the MIT Testflight app before.

No. You run App Inventor the website in your browser on your computer as normal. My previous comment was about the companion app installed via TestFlight. I've noticed in some cases that the app gets confused about the network configuration and this prevents the connection from establishing. Restarting the app is the only way to get it out of that state.

Ok, thanks.

I keep getting this error after scanning QR code: Error from Companion: error: "Unable to activate constraint with anchors and because they have no common ancestor. Does the constraint or its anchors reference items in different view hierarchies? That's illegal.."

This is a known error when you have invisible components with certain types of constraints (usually percentage sizing). I need to dig into that one more. If you want to privately message me a copy of your AIA file I can also use it in my testing.