/// <summary> /// Shares a URL using the native sharing utility. /// </summary> /// <param name="url">URL.</param> /// <param name="subject">Subject.</param> public static void ShareURL(string url, string subject = "") { #if UNITY_EDITOR Debug.Log("ShareURL is only available on mobile devices."); #elif UNITY_IOS iOSNativeShare.ShareURL(url, subject); #elif UNITY_ANDROID AndroidNativeShare.ShareTextOrURL(url, subject); #else Debug.Log("ShareURL FAILED: platform not supported."); #endif }
/// <summary> /// Shares the image at the given path via native sharing utility. /// </summary> /// <param name="imagePath">Image path.</param> /// <param name="message">Message.</param> /// <param name="subject">Subject.</param> public static void ShareImage(string imagePath, string message, string subject = "") { #if UNITY_EDITOR Debug.Log("ShareImage is only available on mobile devices."); #elif UNITY_IOS iOSNativeShare.ShareImage(imagePath, message, subject); #elif UNITY_ANDROID AndroidNativeShare.ShareImage(imagePath, message, subject); #else Debug.Log("ShareImage FAILED: platform not supported."); #endif }
/// <summary> /// Shares the image at the given path via native sharing UI. /// </summary> /// <param name="imagePath">Image path.</param> /// <param name="message">Message.</param> /// <param name="subject">Subject.</param> public static void ShareImage(string imagePath, string message, string subject = "") { // Share the screenshot via the native share utility #if UNITY_IOS iOSNativeShare.ShareImage(imagePath, message, subject); #elif UNITY_ANDROID AndroidNativeShare.ShareImage(imagePath, message, subject); #else if (Debug.isDebugBuild) { Debug.Log("ShareImage: FAIL. Platform not supported"); } #endif }