Package-level declarations

Family cloud management.

Family Cloud is a way to share media with the rest of your family. Having created a family cloud, you can share content with family members, add and manage new family members. Also, you can become a member of another family by joining by invitation.

Beginning Of Work

Working with a family varies depending on whether you are the owner of the family or a member another family. In any case, the first step is to obtain information about the existing family and its members.

import com.cloudike.sdk.photos.PhotoManager
import com.cloudike.sdk.photos.family.FamilyManager
import kotlinx.coroutines.CoroutineScope

val scope: CoroutineScope
val familyManager: FamilyManager = PhotoManager.familyManager

scope.launch {

// Obtaining information about the family and its members.
familyManager.fetch()
}

You can track your family's status using the following flows.

import com.cloudike.sdk.photos.PhotoManager
import com.cloudike.sdk.photos.family.FamilyManager
import kotlinx.coroutines.CoroutineScope

val scope: CoroutineScope
val familyManager: FamilyManager = PhotoManager.familyManager

scope.launch {

// Obtaining information about the family. If null comes instead of family, then there is no family.
familyManager.createFamilyFlow().collect { // it: Family?
// do something...
}
}

scope.launch {

// Obtaining information about family members.
familyManager.createFamilyMembersFlow().collect { // it: List<FamilyMember>
// do something...
}
}

Your Own Family

To work with your family, you need to create it.

import com.cloudike.sdk.photos.PhotoManager
import com.cloudike.sdk.photos.family.FamilyManager
import kotlinx.coroutines.CoroutineScope

val scope: CoroutineScope
val familyManager: FamilyManager = PhotoManager.familyManager

scope.launch {

// Creating a family.
familyManager.createFamily(
familyName = "My family name", // Family name.
isOpened = true // Is the family open
)
}

You can change some family settings.

import com.cloudike.sdk.photos.PhotoManager
import com.cloudike.sdk.photos.family.FamilyManager
import kotlinx.coroutines.CoroutineScope

val scope: CoroutineScope
val familyManager: FamilyManager = PhotoManager.familyManager

scope.launch {

// Editing a family.
familyManager.editFamily(
familyId = "familyId",
familyName = "New family name", // New family name.
isOpened = true // Is the family open
)
}

You can also delete a family. In this case, all data associated with the family will also be deleted.

import com.cloudike.sdk.photos.PhotoManager
import com.cloudike.sdk.photos.family.FamilyManager
import kotlinx.coroutines.CoroutineScope

val scope: CoroutineScope
val familyManager: FamilyManager = PhotoManager.familyManager

scope.launch {

// Deleting a family.
familyManager.deleteFamily(familyId = "familyId")
}

Family Member Management

If you are a family owner, then you can:

Send family invitations to other people.

import com.cloudike.sdk.photos.PhotoManager
import com.cloudike.sdk.photos.family.FamilyManager
import kotlinx.coroutines.CoroutineScope

val scope: CoroutineScope
val familyManager: FamilyManager = PhotoManager.familyManager

scope.launch {

// Sending an invitation to the family.
familyManager.inviteIntoFamily(
familyId = "familyId",
phoneOrEmail = "cloud@cloudike.com"
)
}

Edit usernames.

import com.cloudike.sdk.photos.PhotoManager
import com.cloudike.sdk.photos.family.FamilyManager
import kotlinx.coroutines.CoroutineScope

val scope: CoroutineScope
val familyManager: FamilyManager = PhotoManager.familyManager

scope.launch {

// Editing a family member.
familyManager.editFamilyMember(
familyId = "familyId",
memberId = "familyMemberId",
newMemberName = "New member name"
)
}

Exclude users from family.

import com.cloudike.sdk.photos.PhotoManager
import com.cloudike.sdk.photos.family.FamilyManager
import kotlinx.coroutines.CoroutineScope

val scope: CoroutineScope
val familyManager: FamilyManager = PhotoManager.familyManager

scope.launch {

// Excluding a user from a family.
familyManager.deleteFamilyMember(
familyId = "familyId",
memberId = "familyMemberId"
)
}

Joining Another Family

If you don't have a family, you can join another by invitation.

import com.cloudike.sdk.photos.PhotoManager
import com.cloudike.sdk.photos.family.FamilyManager
import kotlinx.coroutines.CoroutineScope

val scope: CoroutineScope
val familyManager: FamilyManager = PhotoManager.familyManager

scope.launch {

// To join the family, use a special invitation hash.
familyManager.joinToFamily(
inviteHash = "hash",
memberName = "My name in family"
)
}

You can also leave your family.

import com.cloudike.sdk.photos.PhotoManager
import com.cloudike.sdk.photos.family.FamilyManager
import kotlinx.coroutines.CoroutineScope

val scope: CoroutineScope
val familyManager: FamilyManager = PhotoManager.familyManager

scope.launch {

// To leave a family, use the family removal method.
familyManager.deleteFamily(familyId = "familyId")
}

Logging

A set of tags that family operations use.

FetchFamilyMeta : [CL] [Ph] [Family] - The operation of obtaining information about the family and its members.

CreateFamily : [CL] [Ph] [Family] - Family creation operation.

EditFamily : [CL] [Ph] [Family] - Family editing operation.

DeleteFamily : [CL] [Ph] [Family] - Family removal operation.

EditFamilyMember : [CL] [Ph] [Family] - Family member editing operation.

DeleteFamilyMember : [CL] [Ph] [Family] - Operation to remove a family member.

InviteIntoFamily : [CL] [Ph] [Family] - Family invitation operation.

JoinToFamily : [CL] [Ph] [Family] - Family joining operation.

A set of tags used by family utilities.

FeaturesController : [CL] [Ph] [Family] - A mechanism that interrupts operations with a family cloud
when a family is deleted.

FamilyWSHandler : [CL] [Ph] [Family] - Mechanism for processing websocket events.

Types

Link copied to clipboard
data class Family(val id: String, val idOwner: Int, val name: String, val createdAt: Long, val updatedAt: Long, val inviteHash: String?, val inviteExpiresAt: Long?, val sharedUserId: Int, val isOpened: Boolean) : Parcelable
Link copied to clipboard
interface FamilyManager
Link copied to clipboard
data class FamilyMember(val id: String, val idFamily: String, val idUser: Int, val name: String, val createdAt: String, val updatedAt: String, val phoneOrEmail: String, val role: FamilyMember.Role) : Parcelable