userPreferences.promptSignInEmail()

    userPreferences.promptSignInEmail()


    Article summary

    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:

    parameterdescriptiontyperequired?
    optsCustom 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.
    ObjectNo

    Return Values:

    Result will be returned via a success or failure callback with a status together one or more other returned values:

    callbackscenariostatusdatasignedData
    successThe user selects an email for the list in the overlaySUCCESSemailemail
    successThe account has no emails to display so the overlay is not shownNO_EMAIL_FOUNDmessagemessage
    successThe user dismisses the overlay without choosing any email. This is done via the LAST keyDISMISSmessagemessage
    successThe user selects enter new emailNEW_EMAILmessagemessage
    failureFailed to get the user email list from APISERVICE_ERRORmessagemessage
    failureNon-comcast userUNSUPPORTED_PARTNERmessagemessage

    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:


    Was this article helpful?