Box v2.2.0 Release Notes

Release Date: 2018-12-04 // over 5 years ago
  • For details about 'App User' inplementation, please reference 'Multi-Account Mode' found in /doc/Authentication.md

    🚀 Using this release, you will have to migrate any code that reference BOXUser properties directly from BOXContentClient. The BOXUser model now conforms to the UniqueSDKUser protocol. In cases where you only support a single user or [BOXContentClient defaultClient], you can reference the BOXUser properties simply by casting. Please see the multi-account mode reference for support of multi-user accounts.

    /*
    The Box user associated with this SDK client. This will be nil if no user has been authenticated yet.
    */
    @Property (nonatomic, readonly, strong) id user;

    0️⃣ For code that referenced the BOXUser model properties directly from the BOXContentClient instance (defaultClient), you can cast the results to a BOXUser and reference the user properties.

    You may have had:

    BOXContentClient.defaultClient.user.modelID 
    

    To migrate your code, check for type and then proceed to cast for use

    if ([(id)self.client.user isKindOfClass:[BOXUserMini class]]) {
        NSString *currentUserID =((BOXUserMini*)self.client.user).modelID;
    } 
    

    Although BOXUserMini suffices, you can also check for class type against BOXUser.