User Identification

email_form_field_screenshot

There are two ways to attach a user identity to a bug report:

  1. Programmatically setting their userIdentifier or userEmail
  2. Email form field: You may request the user’s email address in the bug report form

Programmatic identification

If your application stores a user’s email address, then typically you should simply set the user’s email address shortly after initializing Buglife:

let email = // Current user's email
Buglife.shared().setUserEmail(email)

Alternatively, you may set a string representing the user’s name, database ID or other identifier:

let username = // Current username
Buglife.shared().setUserIdentifier(username)

Email form field

If your application doesn’t know the current user’s email address (or other unique identifier), you may enable the email address field in the bug report form:

Buglife.shared().userEmailField.isVisible = true

You can also make this a required field using the required property on the userEmailField. Doing so will prevent the bug report form from being submitted if the email field is blank.