Customize Personalization Options
There are multiple customizations for each personalization option. These methods will need to be called when you setup the CreateConfiguration
The Vouchr SDK comes with a robust set of PersonalizationOptions
that can be customized and themed.
The following options can be changed for each one:
new ImagePersonalizationOption()
.setImage(R.drawable.add_photo) // image that represent the option on the create screen
.setTitle(R.string.add_an_image_to_tour_gift) // text to represent the option on the create screen
.setTextColor(Color.WHITE) // color of the text on the create screen
.analyticsName("PhotoCustomizationOption") // name used in analytics events
.canAddMultiple(false); // determines if the user can add multiple or only one of this item in their Vouchr
ImagePersonalizationOption()
.setImage(R.drawable.add_photo) // image that represent the option on the create screen
.setTitle(R.string.add_an_image_to_tour_gift) // text to represent the option on the create screen
.setTextColor(Color.WHITE) // color of the text on the create screen
.analyticsName("PhotoCustomizationOption") // name used in analytics events
.canAddMultiple(false) // determines if the user can add multiple or only one of this item in their Vouchr
Additionally there are specific customizations for each of the built in PersonalizationItem
new ImagePersonalizationOption()
.setCameraEnabled(false) // Can the user add photos from the camera
.setGalleryEnabled(false) // Can the user add photos from there phone gallery
.setGoogleImagesEnabled(true) // Can the user grab photos from Google
.setCustomSearchEnabled(false) // Can the user input there own search terms within Google
.setEditingEnabled(true) // Can photos be edited before being added to a gift
.setImageEditOptions(ImageEditOptions.getDefaultOptions()) // Image Editing configuration
.setMaxGoogleImageResults(@IntRange(from=1, to=100)maxResults)
.setDefaultSearchTerm("default") // The default search term for Google image search
.setSuggestedSearchTerms(Arrays.asList("Dogs", "Cats", "Pigs")); // A list of suggested search terms for Google image search
ImagePersonalizationOption()
.setCameraEnabled(false) // Can the user add photos from the camera
.setGalleryEnabled(false) // Can the user add photos from there phone gallery
.setGoogleImagesEnabled(true) // Can the user grab photos from Google
.setCustomSearchEnabled(false) // Can the user input there own search terms within Google
.setEditingEnabled(true) // Can photos be edited before being added to a gift
.setImageEditOptions(ImageEditOptions.getDefaultOptions()) // Image Editing configuration
.setMaxGoogleImageResults(maxResults)
.setDefaultSearchTerm("default") // The default search term for Google image search
.setSuggestedSearchTerms(listOf("Dogs", "Cats", "Pigs")) // A list of suggested search terms for Google image search
Money Personalization
Challenge Personalization
Note Personalization
Wrapping Personalization
WrappingPaperPersonalizationOption
Recipient Personalization
Gif Personalization
In order to use this personalization you need to add a giphy key during setup.
Engine.Builder builder = new Engine.Builder(serverUrl, sdkId);
...
builder.setGiphyApiKey("API_KEY");
builder.build();
val builder = new Engine.Builder(serverUrl, sdkId)
...
builder.setGiphyApiKey("API_KEY")
builder.build()
Then add the GifPersonalizationOption
to the create configuration.
CreateConfiguration createConfiguration = new CreateConfiguration.Builder(context)
.setGiftItems(
...
new GifPersonalizationOption(),
...)
.build();
engineBuilder.setCreateConfig(createConfiguration);
val createConfiguration = CreateConfiguration.Builder(context)
.setGiftItems(
...
GifPersonalizationOption(),
...)
.build()
engineBuilder.setCreateConfig(createConfiguration)
Title Personalization
Image Personalization
Google Images
In order to use this personalization you need to add google keys during setup.
Engine.Builder builder = new Engine.Builder(serverUrl, sdkId);
...
builder.setGoogleImageSearchValues("GOOGLE_IMAGE_SEARCH_ID", "GOOGLE_IMAGE_SEARCH_API")
builder.build();
val builder = Engine.Builder(serverUrl, sdkId)
...
builder.setGoogleImageSearchValues("GOOGLE_IMAGE_SEARCH_ID", "GOOGLE_IMAGE_SEARCH_API")
builder.build()
Then add the ImagePersonalizationOption
to the create configuration.
CreateConfiguration createConfiguration = new CreateConfiguration.Builder(context)
.setGiftItems(
...
new ImagePersonalizationOption().setGoogleImagesEnabled(true),
...)
.build();
engineBuilder.setCreateConfig(createConfiguration);
val createConfiguration = CreateConfiguration.Builder(context)
.setGiftItems(
...
ImagePersonalizationOption().setGoogleImagesEnabled(true),
...)
.build()
engineBuilder.setCreateConfig(createConfiguration)
Video Personalization
Local
VideoPersonalizationOption
extends PersonalizationOption
and has methods to:
- Set the max length of a video (in milliseconds) that a user may record
videoPersonalizationOption.setMaxVideoLength(10000); // Time in milliseconds
videoPersonalizationOption.setMaxVideoLength(10000) // Time in milliseconds
- Set the max size of a video (in bytes) that a user may record
videoPersonalizationOption.setMaxVideoSize(1000000000); // Size in bytes
videoPersonalizationOption.setMaxVideoSize(1000000000) // Size in bytes
- Set the video quality that a user can record ( Default 720 )
videoPersonalizationOption.setVideoQuality(); // VideoQuality enum
videoPersonalizationOption.setVideoQuality() // VideoQuality enum
- You can enable/disable Youtube or User recorded videos
videoPersonalizationOption.enableYouTube(boolean enable);
videoPersonalizationOption.enableLocalVideo(boolean enable);
videoPersonalizationOption.enableYouTube(enable: Boolean)
videoPersonalizationOption.enableLocalVideo(enable: Boolean)
Youtube
In order to use youtube with this personalization you need to add a youtube api key during setup.
Engine.Builder builder = new Engine.Builder(serverUrl, sdkId);
...
builder.setYouTubeVideoSearchApiKey("YOUTUBE_SEARCH_API_KEY");
builder.build();
val builder = Engine.Builder(serverUrl, sdkId)
...
builder.setYouTubeVideoSearchApiKey("YOUTUBE_SEARCH_API_KEY")
builder.build()
Then add the VideoPersonalizationOption
to the create configuration.
CreateConfiguration createConfiguration = new CreateConfiguration.Builder(context)
.setGiftItems(
...
new VideoPersonalizationOption().enableYouTube(true),
...)
.build();
engineBuilder.setCreateConfig(createConfiguration);
val createConfiguration = CreateConfiguration.Builder(context)
.setGiftItems(
...
VideoPersonalizationOption().enableYouTube(true),
...)
.build()
engineBuilder.setCreateConfig(createConfiguration)
Audio Personalization
AudioPersonalizationOption
extends PersonalizationOption
and has methods to:
- Set the max length of a audio recording (in seconds)
audioPersonalizationOption.setMaxRecordLength(5); // Time in seconds
audioPersonalizationOption.setMaxRecordLength(5) // Time in seconds
- You can enable/disable the ability to record or browse prerecorded sounds
audioPersonalizationOption.enablePrerecorded(boolean enable);
audioPersonalizationOption.enableRecord(boolean enable);
audioPersonalizationOption.enablePrerecorded(enable: Boolean)
audioPersonalizationOption.enableRecord(enable: Boolean)