Customizing Smart Invites on Unity¶
To provide better user experience, you can customize Smart Invite message, an order of invite channels in Smart Invites view, Smart Link domain, and landing page.
Prerequisite¶
- Finished Getting Started with GetSocial Unity SDK guide.
- Finished Send and Receive Invites on Unity guide.
Content Customizations¶
Unfortunately not all invite channels allow the same level of customization, for instance, Twitter allows only custom message text and image, but not subject. Check the complete list of supported customizations.
To enable dynamic Smart Invite content generation GetSocial provide client side API for content customization.
-
The first step is to create
InviteContent
object:InviteContent inviteContent = InviteContent .CreateBuilder() .WithSubject("Hey mate, look what I've found") .WithText("Check this game [APP_INVITE_URL]. Itβs amazing!") .WithMediaAttachment(MediaAttachment.ImageUrl("https://api.adorable.io/avatars/250/documentation_app.png")) .Build();
-
Note, that you can use placeholder
[APP_INVITE_URL]
to customize position of the invite url inWithText(...)
method. All available placeholders are defined inInviteTextPlaceholders
class. -
Next, send customized invitation via GetSocial Data API:
GetSocial.SendInvite(InviteChannelIds.Email, inviteContent, onComplete: () => Debug.Log("Customized invitation via EMAIL was sent"), onCancel: () => Debug.Log("Customized invitation via EMAIL was cancelled"), onFailure: (error) => Debug.LogError("Customized invitation via EMAIL failed, error: " + error.Message) );
Or via GetSocial UI:
GetSocialUi.CreateInvitesView() .SetCustomInviteContent(inviteContent) .Show();
If you want to attach Texture2D
to the invitation on client side, you can use WithImage()
method instead of WithImageUrl()
method. Recommended resolution is 1200x1080px. Bigger images will be automatically downscaled on the backend:
Texture2D inviteImage = ...;// get your image here
InviteContent inviteContent = InviteContent
.CreateBuilder()
.WithSubject("Hey mate, look what I've found")
.WithText("Check this game [APP_INVITE_URL]. Itβs amazing!")
.WithMediaAttachment(MediaAttachment.Image(inviteImage))
.Build();
Invite Channels Order Customization¶
To improve organic user acquisition we recommend to adjust the order of Invite Channels according to your audience, e.g., if your app is mostly used in Asia, it makes sense to put Kik and Kakao on the top; on the other hand if your app is popular in the US - WhatsApp and Facebook Messenger provide better results.
Check how to customize the order of Invite Channels via Dashboard.
On the client side Invite Channel order property is available on InviteChannel
object:
var inviteChannels = GetSocial.InviteChannels;
foreach(var inviteChannel in inviteChannels) {
var channelId = inviteChannel.Id;
var displayOrder = inviteChannel.DisplayOrder;
Debug.Log("Channel " + channelId + " has display order: " + displayOrder);
}
Next Steps¶
- Understand GetSocial Analytics for Smart Invites.