1"use strict";(self.webpackChunkcloudike_docs=self.webpackChunkcloudike_docs||[]).push([[2379],{4274:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>r,contentTitle:()=>s,default:()=>m,frontMatter:()=>t,metadata:()=>o,toc:()=>d});const o=JSON.parse('{"id":"photos/android/family","title":"Family Cloud","description":"The family cloud is a shared storage for photos and videos among family members. This guide describes the functionality of Family Cloud.","source":"@site/docs/photos/android/family.md","sourceDirName":"photos/android","slug":"/photos/android/family","permalink":"/docs/photos/android/family","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Family Cloud","sidebar_label":"Family Cloud"},"sidebar":"photos_android","previous":{"title":"Working With Albums","permalink":"/docs/photos/android/albums"},"next":{"title":"Photo Search","permalink":"/docs/photos/android/search"}}');var l=i(4848),a=i(8453);const t={title:"Family Cloud",sidebar_label:"Family Cloud"},s=void 0,r={},d=[{value:"Read Family From Cloud Storage",id:"read-family-from-cloud-storage",level:2},{value:"Get Information About The Current Family Cloud",id:"get-information-about-the-current-family-cloud",level:2},{value:"Create Family Cloud",id:"create-family-cloud",level:2},{value:"Edit Family Cloud",id:"edit-family-cloud",level:2},{value:"Delete Family Cloud",id:"delete-family-cloud",level:2},{value:"Work With Media",id:"work-with-media",level:2},{value:"Copy To Family Cloud",id:"copy-to-family-cloud",level:3},{value:"Copy To Personal Cloud",id:"copy-to-personal-cloud",level:3},{value:"Family Cloud Member Management",id:"family-cloud-member-management",level:2},{value:"Get List of Family Members",id:"get-list-of-family-members",level:3},{value:"Invite Family Members",id:"invite-family-members",level:3},{value:"Edit Family Members",id:"edit-family-members",level:3},{value:"Delete users from the family cloud",id:"delete-users-from-the-family-cloud",level:3}];function c(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",strong:"strong",...(0,a.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.p,{children:"The family cloud is a shared storage for photos and videos among family members. This guide describes the functionality of Family Cloud."}),"\n",(0,l.jsx)(n.h2,{id:"read-family-from-cloud-storage",children:"Read Family From Cloud Storage"}),"\n",(0,l.jsxs)(n.p,{children:["To get started with the family cloud, first of all get actual family and members information from the backend. Use the ",(0,l.jsx)(n.code,{children:"PhotoManager.familyManager.fetch()"})," method to get the family cloud information. This is suspended function, so you can call it from a coroutine."]}),"\n",(0,l.jsx)(n.admonition,{type:"important",children:(0,l.jsx)(n.p,{children:"Since the download procedure takes some time (and, on the other hand, does not require permission from the user), it should be started as soon as the user is logged into the application."})}),"\n",(0,l.jsx)(n.p,{children:"Use the following code example."}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-kotlin",children:"// ...\nphotosScope.launch {\n try {\n photoManager.familyManager.fetch()\n } catch (t: Throwable) {\n // Possible exceptions:\n // SessionIsNotInitializedException When session is not active.\n // IllegalArgumentException Session error. Profile ID not found.\n // UnauthorizedException Unauthorized access.\n // IllegalStateException Forbidden access.\n // IOException Other problems.\n }\n}\n// ...\n"})}),"\n",(0,l.jsx)(n.h2,{id:"get-information-about-the-current-family-cloud",children:"Get Information About The Current Family Cloud"}),"\n",(0,l.jsx)(n.p,{children:"After retrieving information about the family cloud from the backend, use the following code to retrieve the downloaded information about the family cloud."}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-kotlin",children:"// ...\nphotosScope.launch {\n photoManager.familyManager.createFamilyFlow().collect { family ->\n // if family is null, then there is no family\n }\n}\n// ...\n"})}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"Links"})," - ",(0,l.jsx)(n.a,{href:"#",children:"Family"}),"."]}),"\n",(0,l.jsx)(n.h2,{id:"create-family-cloud",children:"Create Family Cloud"}),"\n",(0,l.jsx)(n.p,{children:"If you don't have a family cloud, you can create one using the following example. This is a suspended function, so you can call it from a coroutine."}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-kotlin",children:'// ...\nval familyName = "familyName" // Family name. Maximum name length - 250 characters.\nval isOpened = true // Family is opened, boolean. Default true.\n\nphotosScope.launch {\n try {\n photoManager.familyManager.createFamily(familyName, isOpened)\n } catch (t: Throwable) {\n // Possible exceptions:\n // SessionIsNotInitializedException When session is not active.\n // IllegalArgumentException Illegal family name.\n // UnauthorizedException Unauthorized access.\n // IllegalStateException Forbidden access.\n // UserMemberOfOtherFamilyException The user is already a family member.\n // IOException Other problems.\n }\n}\n// ...\n'})}),"\n",(0,l.jsx)(n.h2,{id:"edit-family-cloud",children:"Edit Family Cloud"}),"\n",(0,l.jsx)(n.p,{children:"To edit the family cloud, use the following example. This is a suspended function, so you can call it from a coroutine."}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-kotlin",children:'// ...\nval familyId = "familyId" // Family identification\nval familyName = "familyName" // Family name. Maximum name length - 250 characters.\nval isOpened = true // Family is opened, boolean. Default true.\n\nphotosScope.launch {\n try {\n photoManager.familyManager.editFamily(familyId, familyName, isOpened)\n } catch (t: Throwable) {\n // Possible exceptions:\n // SessionIsNotInitializedException When session is not active.\n // IllegalArgumentException Illegal family name.\n // UnauthorizedException Unauthorized access.\n // IllegalStateException Forbidden access.\n // IOException Other problems.\n }\n} \n// ...\n'})}),"\n",(0,l.jsx)(n.h2,{id:"delete-family-cloud",children:"Delete Family Cloud"}),"\n",(0,l.jsx)(n.p,{children:"To delete the family cloud, use the following example. This is a suspended function, so you can call it from a coroutine."}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-kotlin",children:'// ...\nval familyId = "familyId" // Family identification\n\nphotosScope.launch {\n try {\n photoManager.familyManager.deleteFamily(familyId)\n } catch (t: Throwable) {\n // Possible exceptions:\n // SessionIsNotInitializedException When session is not active.\n // UnauthorizedException Unauthorized access.\n // IllegalStateException Forbidden access.\n // IOException Other problems.\n }\n}\n// ...\n'})}),"\n",(0,l.jsx)(n.h2,{id:"work-with-media",children:"Work With Media"}),"\n",(0,l.jsx)(n.h3,{id:"copy-to-family-cloud",children:"Copy To Family Cloud"}),"\n",(0,l.jsx)(n.p,{children:"To copy media to family cloud, use the following code example."}),"\n",(0,l.jsx)(n.admonition,{type:"important",children:(0,l.jsx)(n.p,{children:"Can be called only on the personal timeline instance."})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-kotlin",children:"var disposable: Disposable? = null\n\nvar photoList: List<PhotoItem> = listOf()\n\n// ...\n\n// Can be called only on personal timeline instance.\ndisposable = photoManager.timline.copyToAnotherCloud(photoList).single.subscribeBy(\n onSuccess = {\n // Handle it\n },\n onError = {\n // Handle it\n }\n)\n\n// ...\n\n// You must call dispose() on disposable that returned by subscribe() method,\n// when it is no longer needed, for example in your fragment\u2019s onStop() or onPause().\ndisposable?.dispose()\n"})}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"Link"})," - ",(0,l.jsx)(n.a,{href:"#",children:"OperationCopyToAnotherCloud"}),"."]}),"\n",(0,l.jsx)(n.h3,{id:"copy-to-personal-cloud",children:"Copy To Personal Cloud"}),"\n",(0,l.jsx)(n.p,{children:"To copy media to personal, use the following code example."}),"\n",(0,l.jsx)(n.admonition,{type:"important",children:(0,l.jsx)(n.p,{children:"Can be called only on the family timeline instance."})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-kotlin",children:"var disposable: Disposable? = null\n\nvar photoList: List<PhotoList> = listOf()\n\n// ...\n\n// Can be called only on family timeline instance\ndisposable = photoManager.familyTimeline.copyToAnotherCloud(photoList).single.subscribeBy(\n onSuccess = {\n // Handle it\n },\n onError = {\n // Handle it\n }\n)\n\n// ...\n\n// You must call dispose() on disposable that returned by subscribe() method,\n// when it is no longer needed, for example in your fragment\u2019s onStop() or onPause().\ndisposable?.dispose()\n"})}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"Link"})," - ",(0,l.jsx)(n.a,{href:"#",children:"OperationCopyToAnotherCloud"}),"."]}),"\n",(0,l.jsx)(n.h2,{id:"family-cloud-member-management",children:"Family Cloud Member Management"}),"\n",(0,l.jsx)(n.h3,{id:"get-list-of-family-members",children:"Get List of Family Members"}),"\n",(0,l.jsx)(n.p,{children:"To get a list of family cloud members, use the following example."}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-kotlin",children:"// ...\nphotosScope.launch {\n photoManager.familyManager.createFamilyMembersFlow().collect { familyMember ->\n // Handle it\n }\n}\n// ...\n"})}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"Links"})," - ",(0,l.jsx)(n.a,{href:"#",children:"FamilyMember"}),"."]}),"\n",(0,l.jsx)(n.h3,{id:"invite-family-members",children:"Invite Family Members"}),"\n",(0,l.jsx)(n.p,{children:"Invitation of users is performed through the web-frontend."}),"\n",(0,l.jsxs)(n.p,{children:["The ",(0,l.jsx)(n.code,{children:"Family"})," object has the ",(0,l.jsx)(n.code,{children:"inviteHash"})," field. A user who wants to join the family must use the web client by following the link:"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-html",children:"<you-frontend>/invite?fchash=<invite-hash>\n"})}),"\n",(0,l.jsx)(n.p,{children:"For example, for Cloudike, this link might look like the link below:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-html",children:"https://saas.cloudike.com/invite?fchash=txWRNGneQtyEBgmq\n"})}),"\n",(0,l.jsx)(n.p,{children:"Use the following example to join the family cloud."}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-kotlin",children:'// ...\nval inviteHash = "txWRNGneQtyEBgmq"\nval memberName = "someMemberName"\n\nphotosScope.launch {\n try {\n photoManager.familyManager.joinFamily(inviteHash, memberName)\n } catch (t: Throwable) {\n // Possible exceptions:\n // SessionIsNotInitializedException When session is not active.\n // IllegalArgumentException Bad invite hash.\n // UnauthorizedException Unauthorized access.\n // UserAlreadyMemberOfFamilyException When the user is already a member of a family.\n // UserMemberOfOtherFamilyException When the user is a member of an other family.\n // IOException Other problems.\n }\n}\n// ...\n'})}),"\n",(0,l.jsxs)(n.p,{children:["To invite a user to the family cloud, You will need to provide the ",(0,l.jsx)(n.code,{children:"familyId"})," and the email or phone number of the user you want to invite. Use the following example to invite a user to the family cloud."]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-kotlin",children:'// ...\nval familyId = "familyId"\nval emailOrPhone = "someEmailOrPhone"\n\nphotosScope.launch {\n try {\n photoManager.familyManager.inviteIntoFamily(familyId, emailOrPhone)\n } catch (t: Throwable) {\n // Possible exceptions:\n // SessionIsNotInitializedException When session is not initialized.\n // UserAlreadyMemberOfFamilyException When the user is already a member of a family.\n // IncorrectPhoneOrEmailException When the phone or email is not in the correct format.\n // IllegalArgumentException Another argument problems.\n // UnauthorizedException Unauthorized access.\n // IllegalStateException Access was denied.\n // IOException Another problems.\n }\n}\n// ...\n'})}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"Links"})," - ",(0,l.jsx)(n.a,{href:"#",children:"FamilyMember"}),"."]}),"\n",(0,l.jsx)(n.h3,{id:"edit-family-members",children:"Edit Family Members"}),"\n",(0,l.jsx)(n.p,{children:"The following method will allow you to change the name of a family cloud member."}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-kotlin",children:'// ...\nval familyId = "familyId"\nval memberId = "memberId"\n// New family member name. Maximum name length - 250 characters.\nval newMemberName = "newMemberName"\n\nphotosScope.launch {\n try {\n photoManager.familyManager.editFamilyMember(familyId, memberId, newMemberName)\n } catch (t: Throwable) {\n // Possible exceptions:\n // SessionIsNotInitializedException Session is not active.\n // IllegalArgumentException Illegal family name.\n // UnauthorizedException Forbidden access.\n // IOException Other problems.\n }\n}\n// ...\n'})}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"Links"})," - ",(0,l.jsx)(n.a,{href:"#",children:"FamilyMember"}),"."]}),"\n",(0,l.jsx)(n.h3,{id:"delete-users-from-the-family-cloud",children:"Delete users from the family cloud"}),"\n",(0,l.jsx)(n.p,{children:"Use the following example to remove members from the family cloud."}),"\n",(0,l.jsx)(n.admonition,{type:"important",children:(0,l.jsx)(n.p,{children:"Only the family owner can remove family members. The family owner cannot delete himself."})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-kotlin",children:'// ...\nval familyId = "familyId"\nval memberId = "memberId"\n\nphotosScope.launch {\n try {\n photoManager.familyManager.deleteFamilyMember(familyId, memberId)\n } catch (t: Throwable) {\n // Possible exceptions:\n // SessionIsNotInitializedException When session is not active.\n // UnauthorizedException Unauthorized access.\n // IllegalStateException Forbidden access.\n // DeletingOwnerNotAllowedException An attempt was made to remove the family owner.\n // IOException Other problems.\n }\n}\n// ...\n'})}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"Links"})," - ",(0,l.jsx)(n.a,{href:"#",children:"FamilyMember"}),"."]})]})}function m(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(c,{...e})}):c(e)}},8453:(e,n,i)=>{i.d(n,{R:()=>t,x:()=>s});var o=i(6540);const l={},a=o.createContext(l);function t(e){const n=o.useContext(a);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:t(e.components),o.createElement(a.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.