- Print
userPreferences.promptSignUpEmail()
- Print
userPreferences.promptSignUpEmail()
Present an overlay allowing the user to choose one of their email addresses on file with Comcast, or to enter a new email address. It will fetch all emails for all the users in a household (primary and secondary) and present them in an overlay for the user to make a selection. This method differs from promptSignInEmail
only in the default text which shows up in the overlay.
Signature:
$badger.userPreferences().promptSignUpEmail(opts)
Parameters:
Parameter | Description | Data type | Required? |
---|---|---|---|
opts | Custom text to display in the overlay:
| Object | No |
Return Values:
Result will be returned via a success or failure callback with a status together one or more other returned values:
Callback | Scenario | Status | Data | signedData |
---|---|---|---|---|
success | The user selects an email for the list in the overlay | SUCCESS | ||
success | The account has no emails to display so the overlay is not shown | NO_EMAIL_FOUND | message | message |
success | The user dismisses the overlay without choosing any email. This is done via the LAST key | DISMISS | message | message |
success | The user selects enter new email | NEW_EMAIL | message | message |
failure | Failed to get the user email list from API | SERVICE_ERROR | message | message |
failure | Non-comcast user | UNSUPPORTED_PARTNER | message | message |
Usage Example:
When an X1 App calls the method below:
var promise = $badger.userPreferences().promptSignUpEmail();
The result will be an overlay with the default text for the Header and Select None sections of the overlay.
When an X1 App calls the method below:
var promise = $badger.userPreferences().promptSignUpEmail({
headerText: "Choose an email",
selectNoneText: "None of these"
});
The result will be an overlay which has "Choose an email" as the header text (instead of "Select preferred email or enter to sign up") and "None of these" instead of "Enter new email".
In either of the above options, when the user selects an email from the overlay, the results will be as follows (returned via the success callback):
{
status: "SUCCESS", data: {
email: "email@comcast.com"
},
signedData: "a1b2c3...etc"
}
Where :
data contains a field called "email"
signedData
NOTE: This method only handles emails of Comcast's customers. When invoked, with default settings, an overlay similar to the images below will be seen on screen (note that the text at the top of the overlay will read Sign Up if not overridden)