playMaker

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

KrzysztofZuk

  • Playmaker Newbie
  • *
  • Posts: 16
    • View Profile
Copy string value to device clipboard - Wanted !
« on: May 16, 2018, 01: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, 01:52:21 PM by KrzysztofZuk »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 3047
    • View Profile
    • jinxtergames
Re: Copy string value to device clipboard - Wanted !
« Reply #1 on: May 16, 2018, 02: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 :)

KrzysztofZuk

  • Playmaker Newbie
  • *
  • Posts: 16
    • View Profile
Re: Copy string value to device clipboard - Wanted !
« Reply #2 on: May 16, 2018, 04: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: 3047
    • View Profile
    • jinxtergames
Re: Copy string value to device clipboard - Wanted !
« Reply #3 on: May 16, 2018, 05: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
    • View Profile
Re: Copy string value to device clipboard - Wanted !
« Reply #4 on: May 17, 2018, 11:27:38 AM »
Hello, yeah, now it working great :) . Thank you very much for help :) !!!