示例#1
0
    private UM_ShareDialogBuilder GetSharingContent()
    {
        var builder = new UM_ShareDialogBuilder();

        builder.SetText("Hello world GIF");
        builder.SetUrl(m_SharableUrl);

        return(builder);
    }
示例#2
0
    private UM_ShareDialogBuilder MakeSharingBuilder()
    {
        var builder = new UM_ShareDialogBuilder();

        builder.SetText("Помоги, собрать загаданные слова!");

#if UNITY_IOS
        builder.SetUrl("https://itunes.apple.com/app/id" + Main.AppleId);
#endif


#if UNITY_ANDROID
        builder.SetUrl("https://play.google.com/store/apps/details?id=" + Application.identifier);
#endif

        //Juts generating simple red texture with 32x32 resolution
        var sampleRedTexture = SA_IconManager.GetIcon(Color.red, 32, 32);
        builder.AddImage(screenShot());

        return(builder);
    }
示例#3
0
    private UM_ShareDialogBuilder MakeSharingBuilder()
    {
        var builder = new UM_ShareDialogBuilder();

        builder.SetText("Hello world!");
        builder.SetUrl("https://stansassets.com/");

        //Juts generating simple red texture with 32x32 resolution
        var sampleRedTexture = SA_IconManager.GetIcon(Color.red, 32, 32);

        builder.AddImage(sampleRedTexture);

        return(builder);
    }
示例#4
0
    public void OnClickShare()
    {
        var client  = UM_SocialService.SharingClient;
        var builder = new UM_ShareDialogBuilder();

#if PLATFORM_ANDROID
        builder.SetUrl("https://play.google.com/store/apps/details?id=com.saiked.headbouncer");
        builder.SetText("I have achived a high score of " + PlayerPrefsController.GetBestScore() + " in #HeadBouncer. Will you do better ? You can find this game on Google Play");
#elif PLATFORM_UNITY
        builder.SetUrl("https://apps.apple.com/us/app/head-bouncer/id1471767673");
        builder.SetText("I have achived a high score of " + PlayerPrefsController.GetBestScore() + " in #HeadBouncer. Will you do better ? You can find this game on App Store");
#endif

        client.SystemSharingDialog(builder, (result) => {
            if (result.IsSucceeded)
            {
                Debug.Log("Sharing started ");
            }
            else
            {
                Debug.Log("Failed to share: " + result.Error.FullMessage);
            }
        });
    }
        public IEnumerator SystemShareDialog()
        {
            var @lock   = new CallbackLock();
            var client  = UM_SocialService.SharingClient;
            var builder = new UM_ShareDialogBuilder();

            builder.SetText("Hello world!");
            builder.SetUrl("https://stansassets.com/");

            //Juts generating smaple red tuxture with 32x32 resolution
            Texture2D sampleRedTexture = SA_IconManager.GetIcon(Color.red, 32, 32);

            builder.AddImage(sampleRedTexture);

            client.SystemSharingDialog(builder, (result) => {
                @lock.Unlock();
                Assert.IsTrue(result.IsSucceeded);
            });

            yield return(@lock.WaitToUnlock());
        }