Exemplo n.º 1
0
    public static void InstagramShare(string status, Texture2D texture)
    {
        switch (Application.platform)
        {
        case RuntimePlatform.Android:
            if (texture != null)
            {
                AndroidSocialGate.StartShareIntent("Share", status, texture, "com.instagram.android");
            }
            else
            {
                AndroidSocialGate.StartShareIntent("Share", status, "com.instagram.android");
            }


            break;

        case RuntimePlatform.IPhonePlayer:

            IOSSocialManager.Instance.InstagramPost(texture, status);
            break;

#if UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2
        case RuntimePlatform.WP8Player:
#else
        case RuntimePlatform.WSAPlayerARM:
        case RuntimePlatform.WSAPlayerX64:
        case RuntimePlatform.WSAPlayerX86:
#endif
            break;
        }
    }
Exemplo n.º 2
0
    public static void FacebookShare(string message, Texture2D texture)
    {
        switch (Application.platform)
        {
        case RuntimePlatform.Android:
            if (texture != null)
            {
                AndroidSocialGate.StartShareIntent("Share", message, texture, "facebook.katana");
            }
            else
            {
                AndroidSocialGate.StartShareIntent("Share", message, "facebook.katana");
            }

            break;

        case RuntimePlatform.IPhonePlayer:
            IOSSocialManager.Instance.FacebookPost(message, null, texture);
            break;

#if UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2
        case RuntimePlatform.WP8Player:
#else
        case RuntimePlatform.WSAPlayerARM:
        case RuntimePlatform.WSAPlayerX64:
        case RuntimePlatform.WSAPlayerX86:
#endif
            break;
        }
    }
Exemplo n.º 3
0
    public static void ShareMedia(string caption, string message, Texture2D texture)
    {
        switch (Application.platform)
        {
        case RuntimePlatform.Android:
            if (texture != null)
            {
                AndroidSocialGate.StartShareIntent(caption, message, texture);
            }
            else
            {
                AndroidSocialGate.StartShareIntent(caption, message);
            }

            break;

        case RuntimePlatform.IPhonePlayer:
            IOSSocialManager.Instance.ShareMedia(message, texture);
            break;

#if UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2
        case RuntimePlatform.WP8Player:
#else
        case RuntimePlatform.WSAPlayerARM:
        case RuntimePlatform.WSAPlayerX64:
        case RuntimePlatform.WSAPlayerX86:
#endif
            break;
        }
    }
Exemplo n.º 4
0
    public static void FacebookShare(string message, Texture2D texture)
    {
        switch (Application.platform)
        {
        case RuntimePlatform.Android:
            if (texture != null)
            {
                AndroidSocialGate.StartShareIntent("Share", message, texture, "facebook.katana");
            }
            else
            {
                AndroidSocialGate.StartShareIntent("Share", message, "facebook.katana");
            }

            break;

        case RuntimePlatform.IPhonePlayer:
            IOSSocialManager.instance.FacebookPost(message, texture);
            break;

        case RuntimePlatform.WP8Player:
            WP8SocialManager.instance.FacebookPost(message, texture);
            break;
        }
    }
Exemplo n.º 5
0
    public static void TwitterShare(string status, Texture2D texture)
    {
        switch (Application.platform)
        {
        case RuntimePlatform.Android:
            if (texture != null)
            {
                AndroidSocialGate.StartShareIntent("Share", status, texture, "twi");
            }
            else
            {
                AndroidSocialGate.StartShareIntent("Share", status, "twi");
            }


            break;

        case RuntimePlatform.IPhonePlayer:
            IOSSocialManager.instance.TwitterPost(status, null, texture);
            break;

        case RuntimePlatform.WP8Player:
            break;
        }
    }
Exemplo n.º 6
0
    public static void ShareMedia(string caption, string message, Texture2D texture)
    {
        switch (Application.platform)
        {
        case RuntimePlatform.Android:
            if (texture != null)
            {
                AndroidSocialGate.StartShareIntent("Share", message, texture);
            }
            else
            {
                AndroidSocialGate.StartShareIntent("Share", message);
            }

            break;

        case RuntimePlatform.IPhonePlayer:
            IOSSocialManager.instance.ShareMedia(message, texture);
            break;

        case RuntimePlatform.WP8Player:
            WP8SocialManager.instance.ShareMedia(message, texture);
            break;
        }
    }
    public static void InstagramShare(string status, Texture2D texture)
    {
        switch (Application.platform)
        {
        case RuntimePlatform.Android:
            if (texture != null)
            {
                AndroidSocialGate.StartShareIntent("Share", status, texture, "com.instagram.android");
            }
            else
            {
                AndroidSocialGate.StartShareIntent("Share", status, "com.instagram.android");
            }


            break;

        case RuntimePlatform.IPhonePlayer:

            IOSSocialManager.Instance.InstagramPost(texture, status);
            break;

        case RuntimePlatform.WP8Player:
            break;
        }
    }
Exemplo n.º 8
0
 public void ShareTexture()
 {
     #if UNITY_IOS
     IOSSocialManager.instance.ShareMedia("Timi's Playground", (Texture2D)textureToSave.mainTexture);
     #elif UNITY_ANDROID
     AndroidSocialGate.StartShareIntent("Timi's Playground", "Timi's Playground", (Texture2D)textureToSave.mainTexture);
     #endif
 }
Exemplo n.º 9
0
    public void NativeInvite(Texture2D tex)
    {
#if UNITY_IOS
        IOSSocialManager.OnMediaSharePostResult += HandleOnShareCallback;
        IOSSocialManager.Instance.ShareMedia(string.Format("{0} #{1}", Constants.ShareURLLink(Constants.ShareCodes.Native), Constants.HashTagSocials), tex);
#endif

#if UNITY_ANDROID
        AndroidSocialGate.OnShareIntentCallback += HandleOnShareIntentCallback;
        AndroidSocialGate.StartShareIntent(LocaliseText.Get("GameName"), string.Format("{0} #{1}", Constants.ShareURLLink(Constants.ShareCodes.Native), Constants.HashTagSocials), tex);
#endif
    }
Exemplo n.º 10
0
    private IEnumerator CaptureScreenshot(string text, GameObject[] disableObjects, GameObject[] enableObjects)
    {
        if (disableObjects != null)
        {
            for (int i = 0; i < disableObjects.Length; i++)
            {
                disableObjects[i].SetActive(false);
            }
        }

        if (enableObjects != null)
        {
            for (int i = 0; i < enableObjects.Length; i++)
            {
                enableObjects[i].SetActive(true);
            }
        }

        yield return(new WaitForEndOfFrame());

        // Create a texture the size of the screen, RGB24 format
        int       width  = Screen.width;
        int       height = Screen.height;
        Texture2D tex    = new Texture2D(width, height, TextureFormat.RGB24, false);

        // Read screen contents into the texture
        tex.ReadPixels(new Rect(0, 0, width, height), 0, 0);

        if (enableObjects != null)
        {
            for (int i = 0; i < enableObjects.Length; i++)
            {
                enableObjects[i].SetActive(false);
            }
        }

        if (disableObjects != null)
        {
            for (int i = 0; i < disableObjects.Length; i++)
            {
                disableObjects[i].SetActive(true);
            }
        }

        tex.Apply();

        AndroidSocialGate.StartShareIntent("Share", text, tex);

        Destroy(tex);
    }
Exemplo n.º 11
0
    private static void OnFacebookPackageCheckResult(AN_PackageCheckResult res)
    {
        if (res.IsSucceeded)
        {
            //if is installed lest shared it
            AndroidSocialGate.StartShareIntent(_shareTitle, _shareContent + " " + _playStoreURL, defaultImageToShare, "facebook.katana");
        }

        else
        {
            AndroidMessage msg = AndroidMessage.Create("Share error!", "Please before install facebook app");
        }

        AndroidNativeUtility.OnPackageCheckResult -= OnFacebookPackageCheckResult;
    }
Exemplo n.º 12
0
    IEnumerator ShareScreen()
    {
        bgLoadCanvasGroup.alpha          = 1;
        bgLoadCanvasGroup.blocksRaycasts = true;
        Texture2D texture = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, true);

        texture.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0);
        texture.Apply();
        yield return(new WaitForSeconds(4));

        bgLoadCanvasGroup.alpha          = 0;
        bgLoadCanvasGroup.blocksRaycasts = false;

        AndroidSocialGate.StartShareIntent("Share", "This is my score. Try to Beat me! https://play.google.com/store/apps/details?id=com.Dreamup.Swapper", texture);
    }
Exemplo n.º 13
0
    private IEnumerator PostTWScreenshot()
    {
        yield return(new WaitForEndOfFrame());

        // Create a texture the size of the screen, RGB24 format
        int       width  = Screen.width;
        int       height = Screen.height;
        Texture2D tex    = new Texture2D(width, height, TextureFormat.RGB24, false);

        // Read screen contents into the texture
        tex.ReadPixels(new Rect(0, 0, width, height), 0, 0);
        tex.Apply();

        AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share", tex, "twi");

        Destroy(tex);
    }
Exemplo n.º 14
0
    public static void WhatsappShare(string message, Texture2D texture = null)
    {
        switch (Application.platform)
        {
        case RuntimePlatform.Android:
            AndroidSocialGate.StartShareIntent(string.Empty, message, texture, "whatsapp");
            break;

        case RuntimePlatform.IPhonePlayer:
            if (texture == null)
            {
                IOSSocialManager.Instance.WhatsAppShareText(message);
            }
            else
            {
                IOSSocialManager.Instance.WhatsAppShareImage(texture);
            }
            break;
        }
    }
Exemplo n.º 15
0
    public static void ShareMedia(string caption, string message, Texture2D[] textures)
    {
        switch (Application.platform)
        {
        case RuntimePlatform.Android:
            AndroidSocialGate.StartShareIntent(caption, message, textures);
            break;

        case RuntimePlatform.IPhonePlayer:
            //TODO: Add iOS platform implementation here
            break;

#if UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2
        case RuntimePlatform.WP8Player:
#else
        case RuntimePlatform.WSAPlayerARM:
        case RuntimePlatform.WSAPlayerX64:
        case RuntimePlatform.WSAPlayerX86:
#endif
            break;
        }
    }
Exemplo n.º 16
0
 public static void TwitterDefaultShare()
 {
     AndroidSocialGate.StartShareIntent(_shareTitle, _shareContent + " " + _playStoreURL, defaultImageToShare, "twi");
 }
Exemplo n.º 17
0
 public void PostImage()
 {
     AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share", ImageToShare, "twi");
 }
 private void PostMSG()
 {
     AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share", "twi");
 }
 private void PostImage()
 {
     AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share", ImageToShare, "facebook.katana");
 }
Exemplo n.º 20
0
 public void ShareText()
 {
     AndroidSocialGate.OnShareIntentCallback += HandleOnShareIntentCallback;
     AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share https://d45nf.app.goo.gl/QcRv");
     //AndroidSocialGate.StartVideoPickerAndShareIntent("message for video", "share the video");
 }
 public void GoogleShare()
 {
     AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share", shareTexture, "com.google.android.apps.plus");
 }
 public void TwitterShare()
 {
     AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share", shareTexture, "twi");
 }
 public void InstaShare()
 {
     AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share", shareTexture, "insta");
 }
 public void ShareImage()
 {
     AndroidSocialGate.StartShareIntent("Hello Share Intent", "Sharing Hello wolrd image", shareTexture);
 }
 public void ShareText()
 {
     Debug.Log("ShareText");
     AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share");
 }
Exemplo n.º 26
0
 public void ShareText()
 {
     AndroidSocialGate.OnShareIntentCallback += HandleOnShareIntentCallback;
     AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share");
 }
Exemplo n.º 27
0
 public static void NativeSharing()
 {
     AndroidSocialGate.StartShareIntent(_shareTitle, _shareContent + " " + _playStoreURL, defaultImageToShare);
 }
Exemplo n.º 28
0
 public void ShareText()
 {
     AndroidSocialGate.OnShareIntentCallback += HandleOnShareIntentCallback;
     AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share https://d45nf.app.goo.gl/QcRv");
 }