- Print
userPreferences.promptSignInEmail()
- Print
userPreferences.promptSignInEmail()
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 promptSignUpEmail
only in the default text which shows up in the overlay.
Signature:
$badger.userPreferences().promptSignInEmail(opts)
Parameters:
parameter | description | type | required? |
---|---|---|---|
opts | Custom text to display in the overlay: • headerText - Custom text that is displayed at the top of the prompt. If this is not given, then the default text will be displayed. The default text will have both English and Spanish depending on the user's guide menu language setting. If this parameter is supplied, then the X1 Application will need to have the Spanish translation given the Accept-Language header. • selectNoneText - Custom text that is the last option when selecting an email. If this option is selected, it means that the user has chosen to not select any of their emails and the X1 Application will need to handle that. Like header text, there is a default English and Spanish value given if this parameter is not specified. | 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().promptSignInEmail();
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().promptSignInEmail({
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 in") 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 called, with default settings, an overlay similar to the images below will be seen on screen: