Get started
Last updated
Was this helpful?
Before starting DriveKit Group module integration, make sure that you have initialized DriveKit, especially if you have disable the SDK auto-initialization.
If you use DriveKit Group without having initialized DriveKit, the SDK may not work properly in your application.
To add the Group module to your app using Swift Package Manager, add DriveKitGroup from repository: https://github.com/DriveQuantPublic/drivekit-sdk-spm.git as dependency.
When you need to use the module, just import it in your Swift files:
import DriveKitGroupModuleTo obtain the list of groups that belong to your organisation, call the following method:
DriveKitGroup.shared.getGroups(synchronizationType: .defaultSync, completionHandler: { (status, groups) in
// Callback
})DKGroupsSyncStatus can have 4 values:
.success: synchronization has been successfully performed.
.cacheDataOnly: synchronizationType has been set to cache.
.failedToSyncGroupsCacheOnly: synchronization has failed, only groups previously synchronized are returned.
.syncAlreadyInProgress: synchronization is already in progress.
DKGroupType can have 3 values:
.all: Get all groups related to user team.
.joined: Get already joined groups.
.notJoined: Get not joined groups related to user team.
To assign the driver to a group, call the following method:
DKJoinGroupStatus can have 4 values:
.success: group joined successfully.
.alreadyJoined: group already joined.
.groupNotFound: wrong groupId.
.failedToJoin: failed to join the group.
To remove the driver from a group to which it has been assigned, call the following method:
DKLeaveGroupStatus can have 4 values:
.success: left group successfully.
.notInGroup: user is not in the group.
.groupNotFound: wrong groupId.
.failedToLeave: failed to leave the group.
Last updated
Was this helpful?
Was this helpful?
DriveKitGroup.shared.joinGroup(groupId: "groupId",
completionHandler: { status in
// Callback
})DriveKitGroup.shared.leaveGroup(groupId: "groupId", completionHandler: { status in
// Callback
})
