-
Notifications
You must be signed in to change notification settings - Fork 19
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
sharePic function not working on Godot 3.0.2 and Android #1
Comments
The module expects a native absolute path, so you'll need to convert your
Please tell me if it works, I've not tested ;) |
I have tried this:
It doesn't work and it just prints "icon.png". I also tried this:
which prints this:
0 means OK but it doesn't work neither. With that code the print messages are shown after closing the sharing menu, when coming back to the game. But if I add one "yield(get_tree(), "idle_frame")" right after the last print, I get the output in the console just when I tap the button, before opening the sharing menu. I also have tried to find a directory called "org.godotengine.godotsharedemo" in my Android device but it doesn't seem to exist. I'm not sure if this is related to the issue. I'm not very experienced so I'm just trying things. Any guidance or tips for a workaround would be very appreciated. Thanks for your work! |
Well, I think we found some new bugs...
but the It seems like all the problem is because the save isn't working as it should also. Can you test your code on PC to see if the file is saved? You can use the following code to check this out:
or just open the directory using your file manager. |
I've tried this code:
For both Android and PC I get I get |
After hours of research I managed to make it work 😀. I read this section https://developer.android.com/training/secure-file-sharing/ and they recommend to use a
That worked for me. |
Thank you very much, I'll read the docs and probably update the module code ;) |
Today I realised that my amends only work for "icon.png" but not for the rest of PNG files due to this issue: godotengine/godot#15380. I think currently there is no way of copying PNG files during the export because Godot uses the ".import" files instead. This means that the However, since I needed the ability to share PNG files, no screen capture needed, I've come up with a workaround. For example, if you wanted to share two pictures "res://img1.png" and "res://img2.png" in your Godot 3 demo project, you could follow these steps:
And that should do the trick. I am aware this is a dirty workaround with all sorts of drawbacks, but I couldn't come up with a better solution. This won't be needed when those 2 issues from the Godot repository are fixed. Let me know if I am missing something obvious or if there is some better solution to this. I hope I explained myself well enough, let me know otherwise. |
Perfect explanation, my friend, it's a good workaround to me. Thanks for sharing your research, I'm sure it'll help many other users with the same issues ;) I just updated the code to use FileProvider, your solution should work now with no changes on the module. |
Great, I've just tested the new update and it works fine for me. Thanks! |
The screen capture was fixed on Godot 3.1. |
Since currently there are issues with screen capture in Godot 3, I have modified the demo project a little bit to try this:
The sharing menu is showing correctly and the title, subject and text are set correctly as well. However, the picture is not attached in any case (Facebook, Whatsapp, Gmail...) and instead an empty box is shown. No errors are shown in the console.
Am I doing something wrong? I have tried this on Godot 3.0.2 and Xiaomi MI5 with Android MIUI.
Thanks
The text was updated successfully, but these errors were encountered: