示例#1
0
    private static SharedActivityType ReturnSharedActivity(string activtyString)
    {
        SharedActivityType sharedActivityType = SharedActivityType.OTHERS;

#if UNITY_EDITOR
        sharedActivityType = SharedActivityType.OTHERS;
#elif UNITY_IOS
        if (string.IsNullOrEmpty(activtyString) || string.IsNullOrWhiteSpace(activtyString))
        {
            sharedActivityType = SharedActivityType.CANCEL;
        }
        else if (activtyString.Equals("com.apple.UIKit.activity.PostToFacebook"))
        {
            sharedActivityType = SharedActivityType.FACEBOOK;
        }
        else if (activtyString.Equals("com.apple.UIKit.activity.PostToTwitter"))
        {
            sharedActivityType = SharedActivityType.TWITTER;
        }
        else if (activtyString.Equals("com.burbn.instagram.shareextension"))
        {
            sharedActivityType = SharedActivityType.INSTAGRAM;
        }
        else
        {
            sharedActivityType = SharedActivityType.OTHERS;
        }
#endif
        return(sharedActivityType);
    }
示例#2
0
    public static void shareResultCallBack(bool shareComplete, string shareActivity)
    {
        isSharing = false;

        Debug.Log("shareResultCallBack called with shareComplete : " + shareComplete + "\n shareActivity : " + shareActivity);

        SharedActivityType sharedActivityType = ReturnSharedActivity(shareActivity);

        if (shareComplete)
        {
            onShareCompleteAction?.Invoke();
        }
        else if (!shareComplete && sharedActivityType == SharedActivityType.CANCEL)
        {
            onShareCancelAction?.Invoke();
        }
        onShareActivityAction?.Invoke(sharedActivityType);
    }