private void InitImagesComposer(AN_SocialImageShareBuilders composer, UM_ShareDialogBuilder builder) { foreach (var image in builder.Images) { composer.AddImage(image); } }
public void SystemSharingDialog(UM_ShareDialogBuilder builder, Action <SA_Result> callback) { var composer = new AN_ShareComposer(); InitFullComposer(composer, builder); ShareWithComposer(composer, callback); }
public void ShareToWhatsapp(UM_ShareDialogBuilder builder, Action <SA_Result> callback) { UM_EditorAPIEmulator.WaitForNetwork(() => { // UM_DialogsUtility.ShowMessage("Share To Whatsapp", "Editor API Sharing Emulation."); callback.Invoke(new SA_Result()); }); }
public void ShareToInstagram(UM_ShareDialogBuilder builder, Action <SA_Result> callback) { Texture2D image = null; if (builder.Images.Count > 0) { image = builder.Images[0]; } ISN_Instagram.Post(image, builder.TextWithUrl, callback); }
public void ShareToWhatsapp(UM_ShareDialogBuilder builder, Action <SA_Result> callback) { if (builder.Images.Count > 0) { ISN_Whatsapp.Post(builder.Images[0]); } else { ISN_Whatsapp.Post(builder.TextWithUrl); } callback.Invoke(new SA_Result()); }
public void ShareToWhatsapp(UM_ShareDialogBuilder builder, Action <SA_Result> callback) { if (!AN_WhatsappSharing.IsAppInstalled) { callback.Invoke(new SA_Result(new SA_Error(100, "The Whatsapp app isn't found on device"))); return; } var composer = new AN_WhatsappSharing(); InitImagesComposer(composer, builder); ShareWithComposer(composer, callback); }
public void ShareToTwitter(UM_ShareDialogBuilder builder, Action <SA_Result> callback) { if (!AN_TwitterSharing.IsAppInstalled) { callback.Invoke(new SA_Result(new SA_Error(100, "The Twitter app isn't found on device"))); return; } var composer = new AN_TwitterSharing(); InitImagesComposer(composer, builder); composer.SetText(builder.TextWithUrl); ShareWithComposer(composer, callback); }
public void SystemSharingDialog(UM_ShareDialogBuilder builder, Action <SA_Result> callback) { ISN_UIActivityViewController controller = new ISN_UIActivityViewController(); controller.SetText(builder.TextWithUrl); foreach (var image in builder.Images) { controller.AddImage(image); } controller.Present((result) => { if (result.IsSucceeded && result.Completed) { callback.Invoke(new SA_Result()); } else { callback.Invoke(result); } }); }
public void ShareToTwitter(UM_ShareDialogBuilder builder, Action <SA_Result> callback) { ISN_Twitter.Post(builder.Text, builder.Url, builder.Images.ToArray(), callback); }
private void InitFullComposer(AN_SocialFullShareBuilder composer, UM_ShareDialogBuilder builder) { InitImagesComposer(composer, builder); composer.SetText(builder.TextWithUrl); }