Start a new topic
Answered

Add photo attribute to user collection in Kinvey

I wanted to add a profile photo to user collection when creating a user. I was thinking of doing [user setValue:imageData forAttribute:@"photo"] and then with help of KCSLinkedAppdataStore store it mybkexperience. But it fails with error JSON serialization not supported for NSConcreteMutableData.

[user setValue:imageData forAttribute:@"photo"];
KCSLinkedAppdataStore* store = [KCSLinkedAppdataStore storeWithCollection:[KCSCollection userCollection] options:nil];
[store saveObject:user withCompletionBlock:^(NSArray *objectsOrNil, NSError *errorOrNil) {
    if (errorOrNil ==  nil) {
        //was successful!
    } else {
         //failed
    }
} withProgressBlock:nil];


Uploading the file separately and then set its fileid to an attribute in user collection works. What is the best way of extending KCSUser? I am currently using class extension.


Best Answer

Hi Shirley,


Objective-C (1.x iOS SDK) is no longer a supported product by Kinvey. The Kinvey SDK only supports Swift (3.x iOS SDK). We strongly recommend that you migrate to a 3.x version of the SDK as soon as possible.


Thanks,

Pranav

Kinvey


Answer

Hi Shirley,


Objective-C (1.x iOS SDK) is no longer a supported product by Kinvey. The Kinvey SDK only supports Swift (3.x iOS SDK). We strongly recommend that you migrate to a 3.x version of the SDK as soon as possible.


Thanks,

Pranav

Kinvey


1 person likes this

migrating to different version just to add a profile photo seems too hectic.

Login or Signup to post a comment