public override void SendMail(string _subject, string _body, bool _isHTMLBody, byte[] _attachmentByteArray, string _mimeType, string _attachmentFileNameWithExtn, string[] _recipients, SharingCompletion _onCompletion) { base.SendMail(_subject, _body, _isHTMLBody, _attachmentByteArray, _mimeType, _attachmentFileNameWithExtn, _recipients, _onCompletion); if (IsMailServiceAvailable()) { if (_attachmentByteArray != null) Console.LogWarning(Constants.kDebugTag, "[Sharing:Mail] Attachments are not supported in editor"); string _mailToAddress = null; if (_recipients != null) _mailToAddress = string.Join(",", _recipients); string _mailToSubject = EscapingString(_subject); string _mailToBody = EscapingString(_body); string _mailToString = string.Format("mailto:{0}?subject={1}&body={2}", _mailToAddress, _mailToSubject, _mailToBody); // Opens mail client Application.OpenURL(_mailToString); // Send event MailShareFinished(null); } }
/// <summary> /// Shares the image at path. /// </summary> /// <param name="_message">Message to share.</param> /// <param name="_imagePath">Path where image exists that needs to be shared.</param> /// <param name="_excludedOptions">List of sharing services to exclude while sharing.</param> /// <param name="_onCompletion">Callback to be triggered when sharing action completes.</param> public void ShareImageAtPath(string _message, string _imagePath, eShareOptions[] _excludedOptions, SharingCompletion _onCompletion) { if (!File.Exists(_imagePath)) { Console.LogWarning(Constants.kDebugTag, "[Sharing] ShareImageAtPath, path is invalid"); ShareImage(_message, null, _excludedOptions, _onCompletion); return; } // Download image from given path URL _imagePathURL = URL.FileURLWithPath(_imagePath); DownloadTexture _newDownload = new DownloadTexture(_imagePathURL, true, false); _newDownload.OnCompletion = (Texture2D _texture, string _error)=>{ // Download went wrong if (!string.IsNullOrEmpty(_error)) { Console.LogWarning(Constants.kDebugTag, "[Sharing] ShareImageAtPath, failed to download texture. Error=" + _error); } ShareImage(_message, _texture, _excludedOptions, _onCompletion); }; // Start download _newDownload.StartRequest(); }
protected virtual void Share(string _message, string _URLString, byte[] _imageByteArray, string _excludedOptionsJsonString, SharingCompletion _onCompletion) { // Pause unity player this.PauseUnity(); // Cache callback OnSharingFinished = _onCompletion; }
/// <summary> /// Share message , URL or image /// </summary> /// <param name="_message">Message to share.</param> /// <param name="_URLString">URL string to share.</param> /// <param name="_imageByteArray">image byte array to create the image from.</param> /// <param name="_excludedOptions">List of sharing services to exclude while sharing.</param> /// <param name="_onCompletion">Callback to be triggered when sharing action completes.</param> public void Share(string _message, string _URLString, byte[] _imageByteArray, eShareOptions[] _excludedOptions, SharingCompletion _onCompletion) { string _excludedOptionsJsonString = null; if (_excludedOptions != null) _excludedOptionsJsonString = _excludedOptions.ToJSON(); Share(_message, _URLString, _imageByteArray, _excludedOptionsJsonString, _onCompletion); }
protected override void Share (string _message, string _URLString, byte[] _imageByteArray, string _excludedOptionsJsonString, SharingCompletion _onCompletion) { base.Share(_message, _URLString, _imageByteArray, _excludedOptionsJsonString, _onCompletion); // Native method call int _byteArrayLength = _imageByteArray == null ? 0 : _imageByteArray.Length; Plugin.Call(Native.Methods.SHARE, _message, _URLString, _imageByteArray, _byteArrayLength, _excludedOptionsJsonString); }
public override void SendTextMessage (string _body, string[] _recipients, SharingCompletion _onCompletion) { base.SendTextMessage (_body, _recipients, _onCompletion); if (IsMessagingServiceAvailable()) { // Send message sendTextMessage(_body, _recipients.ToJSON()); } }
public override void ShareImageOnWhatsApp (byte[] _imageByteArray, SharingCompletion _onCompletion) { base.ShareImageOnWhatsApp(_imageByteArray, _onCompletion); // Failed to share image if (_imageByteArray == null || !IsWhatsAppServiceAvailable()) return; Plugin.Call(Native.Methods.SHARE_ON_WHATS_APP, null, _imageByteArray, _imageByteArray.Length); }
public override void ShareTextMessageOnWhatsApp (string _message, SharingCompletion _onCompletion) { base.ShareTextMessageOnWhatsApp(_message, _onCompletion); // Failed to share message if (string.IsNullOrEmpty(_message) || !IsWhatsAppServiceAvailable()) return; Plugin.Call(Native.Methods.SHARE_ON_WHATS_APP, _message, null, 0); }
protected override void Share(string _message, string _URLString, byte[] _imageByteArray, string _excludedOptionsJsonString, SharingCompletion _onCompletion) { base.Share (_message, _URLString, _imageByteArray, _excludedOptionsJsonString, _onCompletion); // Feature isnt supported Console.LogError(Constants.kDebugTag, Constants.kErrorMessage); // Post failed event SharingFinished(SharingFailedResponse()); }
public override void SendTextMessage(string _body, string[] _recipients, SharingCompletion _onCompletion) { base.SendTextMessage(_body, _recipients, _onCompletion); if (IsMessagingServiceAvailable()) { // Send message sendTextMessage(_body, _recipients.ToJSON()); } }
public override void ShareTextMessageOnWhatsApp(string _message, SharingCompletion _onCompletion) { base.ShareTextMessageOnWhatsApp(_message, _onCompletion); // Failed to share message if (string.IsNullOrEmpty(_message) || !IsWhatsAppServiceAvailable()) return; // Native call shareTextMessageOnWhatsApp(_message); }
public override void ShareImageOnWhatsApp(byte[] _imageByteArray, SharingCompletion _onCompletion) { base.ShareImageOnWhatsApp(_imageByteArray, _onCompletion); // Failed to share image if (_imageByteArray == null || !IsWhatsAppServiceAvailable()) return; // Native call shareImageOnWhatsApp(_imageByteArray, _imageByteArray.Length); }
public void ShareScreenshotOnWhatsApp(SharingCompletion _onCompletion) { // First capture frame StartCoroutine(TextureExtensions.TakeScreenshot((_texture) => { // Convert texture into byte array byte[] _imageByteArray = _texture.EncodeToPNG(); // Share ShareImageOnWhatsApp(_imageByteArray, _onCompletion); })); }
public void ShareScreenshotOnWhatsApp (SharingCompletion _onCompletion) { // First capture frame StartCoroutine(TextureExtensions.TakeScreenshot((_texture)=>{ // Convert texture into byte array byte[] _imageByteArray = _texture.EncodeToPNG(); // Share ShareImageOnWhatsApp(_imageByteArray, _onCompletion); })); }
public void SendMailWithScreenshot(string _subject, string _body, bool _isHTMLBody, string[] _recipients, SharingCompletion _onCompletion) { // First capture frame StartCoroutine(TextureExtensions.TakeScreenshot((_texture) => { // Convert texture into byte array byte[] _imageByteArray = _texture.EncodeToPNG(); SendMail(_subject, _body, _isHTMLBody, _imageByteArray, MIMEType.kPNG, "Screenshot.png", _recipients, _onCompletion); })); }
protected override void Share (string _message, string _URLString, byte[] _imageByteArray, string _excludedOptionsJsonString, SharingCompletion _onCompletion) { base.Share(_message, _URLString, _imageByteArray, _excludedOptionsJsonString, _onCompletion); // Get image byte array length int _byteArrayLength = 0; if (_imageByteArray != null) _byteArrayLength = _imageByteArray.Length; share(_message, _URLString, _imageByteArray, _byteArrayLength, _excludedOptionsJsonString); }
public void SendMailWithScreenshot (string _subject, string _body, bool _isHTMLBody, string[] _recipients, SharingCompletion _onCompletion) { // First capture frame StartCoroutine(TextureExtensions.TakeScreenshot((_texture)=>{ // Convert texture into byte array byte[] _imageByteArray = _texture.EncodeToPNG(); SendMail(_subject, _body, _isHTMLBody, _imageByteArray, MIMEType.kPNG , "Screenshot.png", _recipients, _onCompletion); })); }
public override void ShareImageOnWhatsApp(byte[] _imageByteArray, SharingCompletion _onCompletion) { base.ShareImageOnWhatsApp(_imageByteArray, _onCompletion); // Failed to share image if (_imageByteArray == null || !IsWhatsAppServiceAvailable()) { return; } Plugin.Call(Native.Methods.SHARE_ON_WHATS_APP, null, _imageByteArray, _imageByteArray.Length); }
public override void SendTextMessage(string _body, string[] _recipients, SharingCompletion _onCompletion) { base.SendTextMessage(_body, _recipients, _onCompletion); if (IsMessagingServiceAvailable()) { string _recipientJSONList = _recipients == null ? null : _recipients.ToJSON(); // Native method is called Plugin.Call(Native.Methods.SEND_SMS, _body, _recipientJSONList); } }
public override void ShareTextMessageOnWhatsApp(string _message, SharingCompletion _onCompletion) { base.ShareTextMessageOnWhatsApp(_message, _onCompletion); // Failed to share message if (string.IsNullOrEmpty(_message) || !IsWhatsAppServiceAvailable()) { return; } Plugin.Call(Native.Methods.SHARE_ON_WHATS_APP, _message, null, 0); }
public override void SendTextMessage (string _body, string[] _recipients, SharingCompletion _onCompletion) { base.SendTextMessage (_body, _recipients, _onCompletion); if (IsMessagingServiceAvailable()) { string _recipientJSONList = _recipients == null ? null : _recipients.ToJSON(); // Native method is called Plugin.Call(Native.Methods.SEND_SMS, _body, _recipientJSONList); } }
public override void ShareImageOnWhatsApp(byte[] _imageByteArray, SharingCompletion _onCompletion) { base.ShareImageOnWhatsApp(_imageByteArray, _onCompletion); // Failed to share image if (_imageByteArray == null || !IsWhatsAppServiceAvailable()) { return; } // Native call shareImageOnWhatsApp(_imageByteArray, _imageByteArray.Length); }
public override void ShareTextMessageOnWhatsApp(string _message, SharingCompletion _onCompletion) { base.ShareTextMessageOnWhatsApp(_message, _onCompletion); // Failed to share message if (string.IsNullOrEmpty(_message) || !IsWhatsAppServiceAvailable()) { return; } // Native call shareTextMessageOnWhatsApp(_message); }
public void ShareImageOnWhatsApp(Texture2D _texture, SharingCompletion _onCompletion) { if (_texture == null) { Console.LogError(Constants.kDebugTag, "[Sharing:WhatsApp] Texture is null"); ShareImageOnWhatsApp((byte[])null, _onCompletion); return; } // Convert texture into byte array byte[] _imageByteArray = _texture.EncodeToPNG(); // Share ShareImageOnWhatsApp(_imageByteArray, _onCompletion); }
/// <summary> /// Sends the text message. /// </summary> /// <param name="_body">Body of message.</param> /// <param name="_recipients">List of receipients.</param> /// <param name="_onCompletion">Callback to be triggered when sharing action completes.</param> public virtual void SendTextMessage(string _body, string[] _recipients, SharingCompletion _onCompletion) { // Pause unity player this.PauseUnity(); // Cache callback OnSharingFinished = _onCompletion; // Messaging service isnt available if (!IsMessagingServiceAvailable()) { MessagingShareFinished(MessagingShareFailedResponse()); return; } }
/// <summary> /// Shares the image on whats app. /// </summary> /// <param name="_texture">Texture to take the image from.</param> /// <param name="_onCompletion">Callback to be triggered when sharing action completes.</param> public void ShareImageOnWhatsApp(Texture2D _texture, SharingCompletion _onCompletion) { if (_texture == null) { Console.LogError(Constants.kDebugTag, "[Sharing:WhatsApp] Texture is null"); ShareImageOnWhatsApp((byte[])null, _onCompletion); return; } // Convert texture into byte array byte[] _imageByteArray = _texture.EncodeToPNG(); // Share ShareImageOnWhatsApp(_imageByteArray, _onCompletion); }
/// <summary> /// Shares the image on whatsApp. /// </summary> /// <param name="_imagePath">Path of the image to be shared.</param> /// <param name="_onCompletion">Callback to be triggered when sharing action completes.</param> public void ShareImageOnWhatsApp(string _imagePath, SharingCompletion _onCompletion) { if (!File.Exists(_imagePath)) { Console.LogError(Constants.kDebugTag, "[Sharing:WhatsApp] File doesnt exist. Path=" + _imagePath); ShareImageOnWhatsApp((byte[])null, _onCompletion); return; } // Get file data byte[] _imageByteArray = FileOperations.ReadAllBytes(_imagePath); // Share ShareImageOnWhatsApp(_imageByteArray, _onCompletion); }
/// <summary> /// Shares the image. /// </summary> /// <param name="_message">Message to share.</param> /// <param name="_texture">Texture to share as image.</param> /// <param name="_excludedOptions">List of sharing services to exclude while sharing.</param> /// <param name="_onCompletion">Callback to be triggered when sharing action completes.</param> public void ShareImage(string _message, Texture2D _texture, eShareOptions[] _excludedOptions, SharingCompletion _onCompletion) { byte[] _imageByteArray = null; if (_texture != null) { _imageByteArray = _texture.EncodeToPNG(); } else { Console.LogWarning(Constants.kDebugTag, "[Sharing] ShareImage, texure is null"); } Share(_message, null, _imageByteArray, _excludedOptions, _onCompletion); }
public void ShareImageOnWhatsApp(string _imagePath, SharingCompletion _onCompletion) { if (!File.Exists(_imagePath)) { Console.LogError(Constants.kDebugTag, "[Sharing:WhatsApp] File doesnt exist. Path=" + _imagePath); ShareImageOnWhatsApp((byte[])null, _onCompletion); return; } // Get file data byte[] _imageByteArray = FileOperations.ReadAllBytes(_imagePath); // Share ShareImageOnWhatsApp(_imageByteArray, _onCompletion); }
public virtual void SendMail(string _subject, string _body, bool _isHTMLBody, byte[] _attachmentByteArray, string _mimeType, string _attachmentFileNameWithExtn, string[] _recipients, SharingCompletion _onCompletion) { // Pause unity player this.PauseUnity(); // Cache callback OnSharingFinished = _onCompletion; // Cant send mail if (!IsMailServiceAvailable()) { MailShareFinished(MailShareFailedResponse()); return; } }
public virtual void ShareTextMessageOnWhatsApp (string _message, SharingCompletion _onCompletion) { // Pause unity player this.PauseUnity(); // Cache callback OnSharingFinished = _onCompletion; // Sharing on whatsapp isnt supported if (string.IsNullOrEmpty(_message) || !IsWhatsAppServiceAvailable()) { Console.Log(Constants.kDebugTag, "[Sharing:WhatsApp] Failed to share text"); WhatsAppShareFinished(WhatsAppShareFailedResponse()); return; } }
public virtual void ShareImageOnWhatsApp(byte[] _imageByteArray, SharingCompletion _onCompletion) { // Pause unity player this.PauseUnity(); // Cache callback OnSharingFinished = _onCompletion; // Sharing on whatsapp isnt supported if (_imageByteArray == null || !IsWhatsAppServiceAvailable()) { Console.LogError(Constants.kDebugTag, "[Sharing:WhatsApp] Failed to share image"); WhatsAppShareFinished(WhatsAppShareFailedResponse()); return; } }
/// <summary> /// Sends the mail with attachment from byte array. /// </summary> /// <param name="_subject">Subject of mail.</param> /// <param name="_body">Body of the mail.</param> /// <param name="_isHTMLBody">Indicates if the sent body string is HTML string.</param> /// <param name="_attachmentByteArray">Attachment byte array.</param> /// <param name="_mimeType">MIME type of attachment. ex: image/png, application/pdf .</param> /// <param name="_attachmentFileNameWithExtn">Attachment file name with extension.</param> /// <param name="_recipients">List of receipients.</param> /// <param name="_onCompletion">Callback to be triggered when sharing action completes.</param> public virtual void SendMail(string _subject, string _body, bool _isHTMLBody, byte[] _attachmentByteArray, string _mimeType, string _attachmentFileNameWithExtn, string[] _recipients, SharingCompletion _onCompletion) { // Pause unity player this.PauseUnity(); // Cache callback OnSharingFinished = _onCompletion; // Cant send mail if (!IsMailServiceAvailable()) { MailShareFinished(MailShareFailedResponse()); return; } }
public virtual void ShareTextMessageOnWhatsApp(string _message, SharingCompletion _onCompletion) { // Pause unity player this.PauseUnity(); // Cache callback OnSharingFinished = _onCompletion; // Sharing on whatsapp isnt supported if (string.IsNullOrEmpty(_message) || !IsWhatsAppServiceAvailable()) { Console.Log(Constants.kDebugTag, "[Sharing:WhatsApp] Failed to share text"); WhatsAppShareFinished(WhatsAppShareFailedResponse()); return; } }
/// <summary> /// Shares the image on whats app. /// </summary> /// <param name="_imageByteArray">Image byte array to create the image from.</param> /// <param name="_onCompletion">Callback to be triggered when sharing action completes.</param> public virtual void ShareImageOnWhatsApp(byte[] _imageByteArray, SharingCompletion _onCompletion) { // Pause unity player this.PauseUnity(); // Cache callback OnSharingFinished = _onCompletion; // Sharing on whatsapp isnt supported if (_imageByteArray == null || !IsWhatsAppServiceAvailable()) { Console.LogError(Constants.kDebugTag, "[Sharing:WhatsApp] Failed to share image"); WhatsAppShareFinished(WhatsAppShareFailedResponse()); return; } }
public override void SendMail (string _subject, string _body, bool _isHTMLBody, byte[] _attachmentByteArray, string _mimeType, string _attachmentFileNameWithExtn, string[] _recipients, SharingCompletion _onCompletion) { base.SendMail(_subject, _body, _isHTMLBody, _attachmentByteArray, _mimeType, _attachmentFileNameWithExtn, _recipients, _onCompletion); if (IsMailServiceAvailable()) { // Find attachment data array length int _attachmentByteArrayLength = _attachmentByteArray == null ? 0 : _attachmentByteArray.Length; string _toRecipientsJSONList = (_recipients == null) ? null : _recipients.ToJSON(); Plugin.Call(Native.Methods.SEND_MAIL, _subject, _body, _isHTMLBody, _attachmentByteArray, _attachmentByteArrayLength, _mimeType, _attachmentFileNameWithExtn, _toRecipientsJSONList, null, null); } }
public void ShareImageOnWhatsApp(string _imagePath, SharingCompletion _onCompletion) { DownloadAsset _request = new DownloadAsset(new URL(_imagePath), true); _request.OnCompletion = (WWW _www, string _error) => { if (string.IsNullOrEmpty(_error)) { ShareImageOnWhatsApp(_www.bytes, _onCompletion); } else { DebugUtility.Logger.LogError(Constants.kDebugTag, "[Sharing] The operation could not be completed. Error=" + _error); ShareImageOnWhatsApp((byte[])null, _onCompletion); return; } }; _request.StartRequest(); }
public override void SendMail(string _subject, string _body, bool _isHTMLBody, byte[] _attachmentByteArray, string _mimeType, string _attachmentFileNameWithExtn, string[] _recipients, SharingCompletion _onCompletion) { base.SendMail(_subject, _body, _isHTMLBody, _attachmentByteArray, _mimeType, _attachmentFileNameWithExtn, _recipients, _onCompletion); if (IsMailServiceAvailable()) { // Attachment data array length int _attachmentByteArrayLength = 0; if (_attachmentByteArray != null) _attachmentByteArrayLength = _attachmentByteArray.Length; sendMail(_subject, _body, _isHTMLBody, _attachmentByteArray, _attachmentByteArrayLength, _mimeType, _attachmentFileNameWithExtn, _recipients.ToJSON()); } }
/// <summary> /// Sends the mail with an attachment. /// </summary> /// <param name="_subject">Subject of mail.</param> /// <param name="_body">Body of the mail.</param> /// <param name="_isHTMLBody">Indicates if the sent body string is HTML string.</param> /// <param name="_attachmentPath">Path to attachment file.</param> /// <param name="_mimeType">MIME type of attachment. ex: image/png, application/pdf .</param> /// <param name="_recipients">List of receipients.</param> /// <param name="_onCompletion">Callback to be triggered when sharing action completes.</param> public void SendMailWithAttachment(string _subject, string _body, bool _isHTMLBody, string _attachmentPath, string _mimeType, string[] _recipients, SharingCompletion _onCompletion) { byte[] _attachmentByteArray = null; string _filename = null; // File exists if (File.Exists(_attachmentPath)) { _attachmentByteArray = FileOperations.ReadAllBytes(_attachmentPath); _filename = Path.GetFileName(_attachmentPath); } else { Console.LogWarning(Constants.kDebugTag, "[Sharing:Mail] Sending file with no attachments, file doesnt exist at path=" + _attachmentPath); } SendMail(_subject, _body, _isHTMLBody, _attachmentByteArray, _mimeType, _filename, _recipients, _onCompletion); }
public void SendMailWithTexture (string _subject, string _body, bool _isHTMLBody, Texture2D _texture, string[] _recipients, SharingCompletion _onCompletion) { byte[] _imageByteArray = null; string _mimeType = null; string _attachmentName = null; // Convert texture into byte array if (_texture != null) { _imageByteArray = _texture.EncodeToPNG(); _attachmentName = "texture.png"; _mimeType = MIMEType.kPNG; } else { Console.LogWarning(Constants.kDebugTag, "[Sharing:Mail] Sending mail with no attachments, attachment is null"); } SendMail(_subject, _body, _isHTMLBody, _imageByteArray, _mimeType, _attachmentName, _recipients, _onCompletion); }
public override void SendTextMessage(string _body, string[] _recipients, SharingCompletion _onCompletion) { base.SendTextMessage(_body, _recipients, _onCompletion); if (IsMessagingServiceAvailable()) { string appendedRecipients = ""; if (_recipients != null && _recipients.Length > 0) { int i = 0; for (; i < (_recipients.Length - 1); i++) { appendedRecipients += _recipients[i]; appendedRecipients += ";"; } appendedRecipients += _recipients[i]; } // Native method is called Plugin.Call(NativeInfo.Methods.SEND_SMS, _body, appendedRecipients); } }
public override void SendTextMessage(string _body, string[] _recipients, SharingCompletion _onCompletion) { base.SendTextMessage (_body, _recipients, _onCompletion); if (IsMessagingServiceAvailable()) { string appendedRecipients = ""; if(_recipients != null && _recipients.Length > 0) { int i = 0; for(; i < (_recipients.Length-1); i++) { appendedRecipients += _recipients[i]; appendedRecipients += ";"; } appendedRecipients += _recipients[i]; } // Native method is called Plugin.Call(NativeInfo.Methods.SEND_SMS, _body, appendedRecipients); } }
public void SendMailWithTexture(string _subject, string _body, bool _isHTMLBody, Texture2D _texture, string[] _recipients, SharingCompletion _onCompletion) { byte[] _imageByteArray = null; string _mimeType = null; string _attachmentName = null; // Convert texture into byte array if (_texture != null) { _imageByteArray = _texture.EncodeToPNG(); _attachmentName = "texture.png"; _mimeType = MIMEType.kPNG; } else { DebugUtility.Logger.LogWarning(Constants.kDebugTag, "[Sharing] Sending mail with no attachments, attachment is null"); } SendMail(_subject, _body, _isHTMLBody, _imageByteArray, _mimeType, _attachmentName, _recipients, _onCompletion); }
private IEnumerator ShowViewCoroutine(IShareView _shareView, SharingCompletion _onCompletion) { while (!_shareView.IsReadyToShowView) { yield return(null); } // Pause unity player this.PauseUnity(); // Cache callback OnSharingFinished = _onCompletion; if (_shareView is MailShareComposer) { ShowMailShareComposer((MailShareComposer)_shareView); } else if (_shareView is MessageShareComposer) { ShowMessageShareComposer((MessageShareComposer)_shareView); } else if (_shareView is WhatsAppShareComposer) { ShowWhatsAppShareComposer((WhatsAppShareComposer)_shareView); } else if (_shareView is FBShareComposer) { ShowFBShareComposer((FBShareComposer)_shareView); } else if (_shareView is TwitterShareComposer) { ShowTwitterShareComposer((TwitterShareComposer)_shareView); } else { ShowShareSheet((ShareSheet)_shareView); } }
private IEnumerator ShowViewCoroutine (IShareView _shareView, SharingCompletion _onCompletion) { while (!_shareView.IsReadyToShowView) yield return null; // Pause unity player this.PauseUnity(); // Cache callback OnSharingFinished = _onCompletion; if (_shareView is MailShareComposer) { ShowMailShareComposer((MailShareComposer)_shareView); } else if (_shareView is MessageShareComposer) { ShowMessageShareComposer((MessageShareComposer)_shareView); } else if (_shareView is WhatsAppShareComposer) { ShowWhatsAppShareComposer((WhatsAppShareComposer)_shareView); } else if (_shareView is FBShareComposer) { ShowFBShareComposer((FBShareComposer)_shareView); } else if (_shareView is TwitterShareComposer) { ShowTwitterShareComposer((TwitterShareComposer)_shareView); } else { ShowShareSheet((ShareSheet)_shareView); } }
public void ShareImageOnSocialNetwork(string _message, Texture2D _texture, SharingCompletion _onCompletion) { ShareImage(_message, _texture, m_socialNetworkExcludedList, _onCompletion); }
public void Share(string _message, string _URLString, byte[] _imageByteArray, eShareOptions[] _excludedOptions, SharingCompletion _onCompletion) { string _excludedOptionsJsonString = null; if (_excludedOptions != null) { _excludedOptionsJsonString = _excludedOptions.ToJSON(); } Share(_message, _URLString, _imageByteArray, _excludedOptionsJsonString, _onCompletion); }
public void ShareImageAtPath(string _message, string _imagePath, eShareOptions[] _excludedOptions, SharingCompletion _onCompletion) { URL _imagePathURL = URL.FileURLWithPath(_imagePath); DownloadAsset _newDownload = new DownloadAsset(_imagePathURL, true); _newDownload.OnCompletion = (WWW _www, string _error) => { byte[] _imageData = null; if (string.IsNullOrEmpty(_error)) { _imageData = _www.bytes; } else { DebugUtility.Logger.LogWarning(Constants.kDebugTag, "[Sharing] The operation could not be completed. Error=" + _error); } Share(_message, null, _imageData, _excludedOptions, _onCompletion); }; _newDownload.StartRequest(); }
public void ShareImage(string _message, Texture2D _texture, eShareOptions[] _excludedOptions, SharingCompletion _onCompletion) { byte[] _imageByteArray = null; if (_texture != null) { _imageByteArray = _texture.EncodeToPNG(); } else { DebugUtility.Logger.LogWarning(Constants.kDebugTag, "[Sharing] ShareImage, texure is null"); } Share(_message, null, _imageByteArray, _excludedOptions, _onCompletion); }
public void ShareScreenShot(string _message, eShareOptions[] _excludedOptions, SharingCompletion _onCompletion) { // First capture screenshot StartCoroutine(TextureExtensions.TakeScreenshot((_texture) => { // Share image ShareImage(_message, _texture, _excludedOptions, _onCompletion); })); }
public void ShareURL(string _message, string _URLString, eShareOptions[] _excludedOptions, SharingCompletion _onCompletion) { if (string.IsNullOrEmpty(_URLString)) { DebugUtility.Logger.LogWarning(Constants.kDebugTag, "[Sharing] ShareURL, URL is null/empty"); } Share(_message, _URLString, null, _excludedOptions, _onCompletion); }
public void ShareMessage(string _message, eShareOptions[] _excludedOptions, SharingCompletion _onCompletion) { Share(_message, null, null, _excludedOptions, _onCompletion); }
public void ShareImageOnSocialNetwork(string _message, byte[] _imageByteArray, SharingCompletion _onCompletion) { Share(_message, null, _imageByteArray, m_socialNetworkExcludedList, _onCompletion); }
public void ShareScreenShotOnSocialNetwork(string _message, SharingCompletion _onCompletion) { ShareScreenShot(_message, m_socialNetworkExcludedList, _onCompletion); }
public void ShareImageOnSocialNetwork (string _message, Texture2D _texture, SharingCompletion _onCompletion) { ShareImage(_message, _texture, m_socialNetworkExcludedList, _onCompletion); }
public void ShareScreenShotOnSocialNetwork (string _message, SharingCompletion _onCompletion) { ShareScreenShot(_message, m_socialNetworkExcludedList, _onCompletion); }
public void ShareURLOnSocialNetwork (string _message, string _URLString, SharingCompletion _onCompletion) { ShareURL(_message, _URLString, m_socialNetworkExcludedList, _onCompletion); }
public void ShareURLOnSocialNetwork(string _message, string _URLString, SharingCompletion _onCompletion) { ShareURL(_message, _URLString, m_socialNetworkExcludedList, _onCompletion); }
public void ShareImageOnSocialNetwork(string _message, string _imagePath, SharingCompletion _onCompletion) { ShareImageAtPath(_message, _imagePath, m_socialNetworkExcludedList, _onCompletion); }