addStudyFromInvitation method
Adds a study based on an invitation, e.g. from a CARP server.
Same as addStudy, but the study is created from the invitation.
If the invitation has no device role name,
Smartphone.DEFAULT_ROLE_NAME is used.
Implementation
Future<SmartphoneStudy> addStudyFromInvitation(ActiveParticipationInvitation invitation) async => await addStudy(
SmartphoneStudy(
studyId: invitation.studyId,
studyDeploymentId: invitation.studyDeploymentId,
deviceRoleName: invitation.deviceRoleName ?? Smartphone.DEFAULT_ROLE_NAME,
participantId: invitation.participantId,
participantRoleName: invitation.participantRoleName,
),
);