Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know if the player shared my link on a social app?

I am using Unity3d and C# scripts/code. I just started to use Native share plugin by Yasirkula.

Here is part of my code:

NativeShare().SetSubject( "Check out this game!" ).SetText( "Link to my app here" ).Share();

When I reach this line the user sees a sharing menu, and he can choose any sharing app he wishes. How to make sure that the user actually shared the link on Whatsapp, FaceBook, Twiter and not using his clipboard or any other app? I want to reward the user only on a real social share.

like image 780
Tal Angel Avatar asked Jul 11 '18 17:07

Tal Angel


2 Answers

Native Share has a way to choose what app you want to share with, but it's Android only:

// Share on WhatsApp only, if installed (Android only)
if( NativeShare.TargetExists( "com.whatsapp" ) )
        new NativeShare().AddFile( filePath ).SetText( "Hello world!" ).SetTarget( "com.whatsapp" ).Share();

With this, you could make one button for each app you want to allow the user to share with, preventing sharing with non-social apps. I think this is the closest you can get of what you want.

Unfortunately I don't know if there are any workarounds for iOS and cancel/back button.

like image 90
Nathalia Soragge Avatar answered Sep 21 '22 02:09

Nathalia Soragge


A lot of marketing emails use this technique to trace emails status:

The raw idea is to put a parameter in the URL that will be shared and track when this URL is used to access your application.

The parameter can be a cryptographic nonce with useful information. When you receive a request with that URL you decrypt the nonce and use this data to identify the user sharing the link.

Here you can investigate how this pattern is applied to trace email status (open, read, etc...)

like image 43
Miguel Avatar answered Sep 23 '22 02:09

Miguel