playMaker

Author Topic: Copy string value to device clipboard - Wanted !  (Read 2372 times)

KrzysztofZuk

  • Playmaker Newbie
  • *
  • Posts: 16
Copy string value to device clipboard - Wanted !
« on: May 16, 2018, 04:50:32 PM »
Hello, is there possibility to create action that will copy String value to the device clipboard :) ?
I created app that show latitude and longitude on android device, and i want to give user possibility to copy this information to the android clipboard (mayby he want send that info to other user, or paste it on google maps etc :)).

Cheers, Chris !
« Last Edit: May 16, 2018, 04:52:21 PM by KrzysztofZuk »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Copy string value to device clipboard - Wanted !
« Reply #1 on: May 16, 2018, 05:27:17 PM »
Hi,
I was looking a bit in the unity forums and i found this :
https://answers.unity.com/questions/885081/can-i-set-a-string-to-androids-clipboard.html

It has a link to this github project and you can get the unitypackage here :
https://github.com/sanukin39/UniClipboard/tree/master/dist

It works for android and ios

So i made 2 actions for it, i did not have time to test them (needs to be tested on a device) but i think that they should work.

You can get then on the attachment below.

Please let me know if they work or not :)
« Last Edit: May 16, 2018, 08:08:34 PM by djaydino »

KrzysztofZuk

  • Playmaker Newbie
  • *
  • Posts: 16
Re: Copy string value to device clipboard - Wanted !
« Reply #2 on: May 16, 2018, 07:17:11 PM »
Thank you very much for answer :) !
Hmm, those actions don't work for me, they don't copy or paste data to clipboard on android and inside in Unity :(. Those action also blocks state (In the state with those actions inside, Unity don't want to go to the next state (with "Finished" event).

Cheers!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Copy string value to device clipboard - Wanted !
« Reply #3 on: May 16, 2018, 08:08:10 PM »
Hi,
Oops i forgot to add finished();

i updated the attachment and also added it below

I also added a debug log that will show in the console, when used in the editor to warn that it does not work in the editor.

can you redownload and try again :)

If they still don't work (on adroid)  i will try to test tomorrow.

KrzysztofZuk

  • Playmaker Newbie
  • *
  • Posts: 16
Re: Copy string value to device clipboard - Wanted !
« Reply #4 on: May 17, 2018, 02:27:38 PM »
Hello, yeah, now it working great :) . Thank you very much for help :) !!!