Hello.
I've just tried to use the ShareFile command to share a simple text file on Android. I create a text file and then share it like this:
OpenToWrite(1,"simple.txt")
WriteLine(1,"This is a text file.")
WriteLine(1,"It contains nothing but text.")
WriteLine(1,"That is all.")
CloseFile(1)
ShareFile("simple.txt")
No matter what app I choose to share it with, it doesn't seem to work. For example:
Google Drive - Get a "Request contains no data" error immediately
GMail - It puts the file path and name into the 'To:' field
DropBox - Get a "No file to upload" error immediately
Copy to Clipboard - clipboard remains empty/unchanged
FX Save As (file manager) - "The item cannot be saved" error immediately
I've tried it on iOS and it seems to works fine, saving the file to iCloud and attaching it to an email.
If I use
ShareText("This is some text") it works exactly as expected. GMail puts the text in the body of a new email, Twitter puts the text in a new tweet, it gets copied to the clipboard fine, even Google Drive creates a new file using the text as the filename. I could use this command instead but I am worried about any limitations on the size of text that can be passed.
Am I doing something wrong?
EDIT: Forgot to say, I am using AGK2 Tier 1 with Android 7.0 and have tried broadcasting the program and also creating an APK file and installing that (just in case) with the same results.
EDIT2: I am wondering if this might be a location or permissions issue. It seems to be passing the URI of the file to the shared app , which when broadcasting to the AGK2 Player App it comes through as:
//com.thegamecreators.agk_player2.provider/files/TestApp/media/simple.txt which does not seem to exist or at least isn't visible to other apps like the file manager.
Chart data provided with kind permission from
ELSPA