Skip to content

Instantly share code, notes, and snippets.

@shikto1
Last active July 5, 2018 04:15
Show Gist options
  • Save shikto1/cb64b78fd2e1e693aa6833d2b57a6cee to your computer and use it in GitHub Desktop.
Save shikto1/cb64b78fd2e1e693aa6833d2b57a6cee to your computer and use it in GitHub Desktop.
import com.crashlytics.android.Crashlytics;
import io.fabric.sdk.android.Fabric;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Fabric.with(this, new Crashlytics());
// TODO: Move this to where you establish a user session
logUser();
setContentView(R.layout.activity_main);
}
private void logUser() {
// TODO: Use the current user's information
// You can call any combination of these three methods
Crashlytics.setUserIdentifier("12345");
Crashlytics.setUserEmail("[email protected]");
Crashlytics.setUserName("Test User");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment