Instabug helps you better identify the bug reports or feedback you get by associating the user's identity to them.
By default, we ask the user to enter their email in any report. You can set the email as a required or optional field as explained here. In both cases, the email text area will be visible as shown below.
However, you can set the email as well as the username yourself and the email field will be prefilled with the one you already provided. Ideally, this API should be called as soon as a user logs into your app.
//iOS Instabug.IdentifyUserWithEmail("user_email", "user_name"); //Android Instabug.IdentifyUser("user_email", "user_name");
You can assign custom attributes to your users and they will show up on your Instabug dashboard with each report. Those attributes can later be used to filter the reports on the dashboard.
User Attributes - Dashboard
To add a new user attribute use the following method.
//iOS Instabug.SetUserAttribute("18", "Age"); Instabug.SetUserAttribute("True", "LoggedIn"); //Android Instabug.SetUserAttribute("Age", "18"); Instabug.SetUserAttribute("LoggedIn", "True");
You can also retrieve or remove the current value of a certain user attribute, or retrieve all user attributes.
//iOS //Remove a user attribute Instabug.RemoveUserAttributeForKey("Age"); //Android //Remove a user attribute Instabug.RemoveUserAttribute("Age"); //Remote all user attributes Instabug.ClearAllUserAttributes();
//iOS //Get all the created user attributes Instabug.UserAttributes(); //Get the value of a ceratin user attribute Instabug.UserAttributeForKey("Age"); //Android //Get the value of a ceratin user attribute String value = Instabug.GetUserAttribute("Age");
You can add additional data about users that would help you better assist them. This API is best used for dumping large amounts of data.
//iOS Instabug.SetUserData("user_data"); //Android Instabug.UserData = "User data";
Each call to this method overrides the user data to be attached. The maximum size of the string is 1,000 characters.
When a user logs out, the following API should be called.
//iOS Instabug.LogOut(); //Android Instabug.LogoutUser();
LogOut will reset the value of the email and name previously set. It will also remove any currently set user attributes, user events, user chats, and user data.