private static void SharePromoCode(string promoCode) { GetSocialUi.CreateInvitesView() .SetLinkParams(new LinkParams { { LinkParams.KeyPromoCode, promoCode } }) .SetCustomInviteContent(InviteContent.CreateBuilder() .WithText("Use my Promo Code to get a personal discount: " + InviteTextPlaceholders.PlaceholderPromoCode + " . " + InviteTextPlaceholders.PlaceholderAppInviteUrl) .Build()) .Show(); }
private static void SharePromoCode(string promoCode) { var inviteContent = new InviteContent() { Text = "Use my Promo Code to get a personal discount: " + InviteTextPlaceholders.PlaceholderPromoCode + " . " + InviteTextPlaceholders.PlaceholderAppInviteUrl }; // FIXME: use proper constants inviteContent.AddLinkParam(LinkParams.KeyPromoCode, promoCode); //todo InvitesViewBuilder.Create().SetCustomInviteContent(inviteContent).Show(); }
public void Invite() { if (GetSocial.IsInitialized) { var linkParams = new LinkParams(); linkParams.Add("invite", "invite_value"); var inviteContent = InviteContent.CreateBuilder() .WithMediaAttachment(MediaAttachment.Image(image)) .Build(); GetSocialUi.CreateInvitesView().SetCustomInviteContent(inviteContent).SetInviteCallbacks( onComplete: (channelId) => { Debug.Log("Invitation was sent via " + channelId); InitScript.Instance.ShowReward(); }, onCancel: (channelId) => Debug.Log("Invitation via " + channelId + " was cancelled"), onFailure: (channelId, error) => Debug.LogError("Invitation via" + channelId + "failed, error: " + error.Message) ).Show(); } }
IEnumerator ShareDelay() { yield return(new WaitForEndOfFrame()); Texture2D captureScreenshotAsTexture = ScreenCapture.CaptureScreenshotAsTexture(); if (GetSocial.IsInitialized) { var inviteContent = InviteContent.CreateBuilder() .WithText("Try to beat me in this game [APP_INVITE_URL]") // NOTE: if you customize the text [APP_INVITE_URL] placeholder have to be used .WithMediaAttachment(MediaAttachment.Image(captureScreenshotAsTexture)) .Build(); bool wasShown = GetSocialUi.CreateInvitesView() .SetCustomInviteContent(inviteContent) .SetInviteCallbacks( onComplete: (channelId) => Debug.Log("Invitation was sent via " + channelId), onCancel: (channelId) => Debug.Log("Invitation via " + channelId + " was cancelled"), onFailure: (channelId, error) => Debug.LogError("Invitation via" + channelId + "failed, error: " + error.Message) ) .Show(); } }
/// <summary> /// Sets the custom invite content. /// </summary> /// <returns>The custom invite content.</returns> /// <param name="inviteContent">Custom invite content to send with this invite.</param> public InvitesViewBuilder SetCustomInviteContent(InviteContent inviteContent) { _inviteContent = inviteContent; return(this); }
public override string ToString() { StringBuilder __sb = new StringBuilder("THInviteProvider("); bool __first = true; if (Name != null && __isset.name) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("Name: "); __sb.Append(Name); } if (ProviderId != null && __isset.providerId) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("ProviderId: "); __sb.Append(ProviderId); } if (__isset.os) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("Os: "); __sb.Append(Os); } if (__isset.displayOrder) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("DisplayOrder: "); __sb.Append(DisplayOrder); } if (IconUrl != null && __isset.iconUrl) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("IconUrl: "); __sb.Append(IconUrl); } if (__isset.enabled) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("Enabled: "); __sb.Append(Enabled); } if (__isset.supportsInviteText) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("SupportsInviteText: "); __sb.Append(SupportsInviteText); } if (__isset.supportsInviteImageUrl) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("SupportsInviteImageUrl: "); __sb.Append(SupportsInviteImageUrl); } if (__isset.supportsInviteSubject) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("SupportsInviteSubject: "); __sb.Append(SupportsInviteSubject); } if (Properties != null && __isset.properties) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("Properties: "); __sb.Append(Properties == null ? "<null>" : Properties.ToString()); } if (InviteContent != null && __isset.inviteContent) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("InviteContent: "); __sb.Append(InviteContent == null ? "<null>" : InviteContent.ToString()); } if (__isset.supportsGif) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("SupportsGif: "); __sb.Append(SupportsGif); } if (__isset.supportsVideo) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("SupportsVideo: "); __sb.Append(SupportsVideo); } __sb.Append(")"); return(__sb.ToString()); }
public void Write(TProtocol oprot) { oprot.IncrementRecursionDepth(); try { TStruct struc = new TStruct("THInviteProvider"); oprot.WriteStructBegin(struc); TField field = new TField(); if (Name != null && __isset.name) { field.Name = "name"; field.Type = TType.Map; field.ID = 1; oprot.WriteFieldBegin(field); { oprot.WriteMapBegin(new TMap(TType.String, TType.String, Name.Count)); foreach (string _iter28 in Name.Keys) { oprot.WriteString(_iter28); oprot.WriteString(Name[_iter28]); } oprot.WriteMapEnd(); } oprot.WriteFieldEnd(); } if (ProviderId != null && __isset.providerId) { field.Name = "providerId"; field.Type = TType.String; field.ID = 2; oprot.WriteFieldBegin(field); oprot.WriteString(ProviderId); oprot.WriteFieldEnd(); } if (__isset.os) { field.Name = "os"; field.Type = TType.I32; field.ID = 3; oprot.WriteFieldBegin(field); oprot.WriteI32((int)Os); oprot.WriteFieldEnd(); } if (__isset.displayOrder) { field.Name = "displayOrder"; field.Type = TType.I32; field.ID = 4; oprot.WriteFieldBegin(field); oprot.WriteI32(DisplayOrder); oprot.WriteFieldEnd(); } if (IconUrl != null && __isset.iconUrl) { field.Name = "iconUrl"; field.Type = TType.String; field.ID = 5; oprot.WriteFieldBegin(field); oprot.WriteString(IconUrl); oprot.WriteFieldEnd(); } if (__isset.enabled) { field.Name = "enabled"; field.Type = TType.Bool; field.ID = 6; oprot.WriteFieldBegin(field); oprot.WriteBool(Enabled); oprot.WriteFieldEnd(); } if (__isset.supportsInviteText) { field.Name = "supportsInviteText"; field.Type = TType.Bool; field.ID = 7; oprot.WriteFieldBegin(field); oprot.WriteBool(SupportsInviteText); oprot.WriteFieldEnd(); } if (__isset.supportsInviteImageUrl) { field.Name = "supportsInviteImageUrl"; field.Type = TType.Bool; field.ID = 8; oprot.WriteFieldBegin(field); oprot.WriteBool(SupportsInviteImageUrl); oprot.WriteFieldEnd(); } if (__isset.supportsInviteSubject) { field.Name = "supportsInviteSubject"; field.Type = TType.Bool; field.ID = 9; oprot.WriteFieldBegin(field); oprot.WriteBool(SupportsInviteSubject); oprot.WriteFieldEnd(); } if (Properties != null && __isset.properties) { field.Name = "properties"; field.Type = TType.Struct; field.ID = 10; oprot.WriteFieldBegin(field); Properties.Write(oprot); oprot.WriteFieldEnd(); } if (InviteContent != null && __isset.inviteContent) { field.Name = "inviteContent"; field.Type = TType.Struct; field.ID = 11; oprot.WriteFieldBegin(field); InviteContent.Write(oprot); oprot.WriteFieldEnd(); } if (__isset.supportsGif) { field.Name = "supportsGif"; field.Type = TType.Bool; field.ID = 12; oprot.WriteFieldBegin(field); oprot.WriteBool(SupportsGif); oprot.WriteFieldEnd(); } if (__isset.supportsVideo) { field.Name = "supportsVideo"; field.Type = TType.Bool; field.ID = 13; oprot.WriteFieldBegin(field); oprot.WriteBool(SupportsVideo); oprot.WriteFieldEnd(); } oprot.WriteFieldStop(); oprot.WriteStructEnd(); } finally { oprot.DecrementRecursionDepth(); } }