User profile
If you know the user's gender and/or birthday, you can share them with us so that we can suggest better matching apps to the user.
// set the gender
AdjoeGender gender;
switch(getUserGender()) {
case "male":
gender = AdjoeGender.MALE;
break;
case "female":
gender = AdjoeGender.FEMALE;
break;
default:
gender = AdjoeGender.UNKNOWN;
break;
}
// set the birthday
Date birthday = getUserBirthday();
// if you don't know the exact birthday, the year is already enough
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, getYearOfBirth());
calendar.set(Calendar.MONTH, 0);
calendar.set(Calendar.DAY_OF_MONTH, 0);
birthday = calendar.getTime();
String source = ""; // where did you get the user's profile information from? "facebook", "google", ...
try {
// send the profile information to adjoe
Adjoe.setProfile(context, source, gender, birthday);
} catch(AdjoeNotInitializedException e) {
// make sure to initialize the adjoe SDK first
}
// set the gender
val gender: AdjoeGender
when (getUserGender()) {
"male" -> gender = AdjoeGender.MALE
"female" -> gender = AdjoeGender.FEMALE
else -> gender = AdjoeGender.UNKNOWN
}
// set the birthday
Date birthday = getUserBirthday();
// if you don't know the exact birthday, the year is already enough
Calendar calendar = Calendar.getInstance()
calendar.set(Calendar.YEAR, getYearOfBirth())
calendar.set(Calendar.MONTH, 0)
calendar.set(Calendar.DAY_OF_MONTH, 0)
birthday = calendar.time
val source = "" // where did you get the user's profile information from? "facebook", "google", ...
try {
// send the profile information to adjoe
Adjoe.setProfile(context, source, gender, birthday)
} catch(e: AdjoeNotInitializedException) {
// make sure to initialize the adjoe SDK first
}
This method call has no effect if the user has not accepted the adjoe Terms of Service or is blocked by the adjoe services.
Adjoe Parameters
You can pass additional UA and placement parameters when you send the user profile:
AdjoeParams adjoeParams = new AdjoeParams.Builder()
.setUaNetwork("network")
.setUaChannel("channel")
.setUaSubPublisherCleartext("SubPublisherCleartext")
.setUaSubPublisherEncrypted("SubPublisherEncrypted")
.setPlacement("placement")
.build();
AdjoeUserProfile adjoeUserProfile = new AdjoeUserProfile(gender, birthday);
Adjoe.setProfile(context, source, adjoeUserProfile, adjoeParams, listener);
val adjoeParams = AdjoeParams.Builder()
.setUaNetwork("network")
.setUaChannel("channel")
.setUaSubPublisherCleartext("SubPublisherCleartext")
.setUaSubPublisherEncrypted("SubPublisherEncrypted")
.setPlacement("placement")
.build()
val adjoeUserProfile = AdjoeUserProfile(gender, birthday)
Adjoe.setProfile(context, source, adjoeUserProfile, adjoeParams, listener)
Last updated