Hello guys!I'm new here and I'm not a good programmer, but I'm trying to create an app with outSystems which is a fantastic tool. Forgive me if you find any silly mistakes.I'm trying to implement a function to share an image.Here are some screenshots about the problem:
I implemented it like this
When I open it in the browser, it works.
But when I try to run in the app installed on the android phone, it doesn't work
This is part of a larger solution, but create a specific file (Share.oap) to attach here to share what I'm trying.
I tried to use some modules available in Forge, but I couldn't put it to work either.
But I think it will be much simpler if it works in javascript.
Can someone help me?
Hey guys!
Hi,
Which browser are you using. The share method is only available over https:// and only supported by a limited set of browsers, see
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share
Regards,
Daniel
Thanks for the guidance Daniel.
I checked it out.
When I run the code in the same browser outside the APP it works. The same code in the APP does not work.
Hi Mauro,
The query selector you're using on your javascript code is incorrect. In Outsystems, widgets have a runtime Id that is not exactly what you define as its name on Service Studio.
In your case, you should pass the btnShare icon runtime id as an input parameter to your javascript code, and change that code as follows:
Hope this helps.
Best regards,
Paulo Moreira
Thank you for your contribution Paulo.
The Button was working normally. The function was called but does not recognize the navigator.share call
However, I implemented your suggestion and the error remains.
Mauro Jr.