function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
bdurettebdurette 

Like using iOS toolkit

I'm trying to enable 'Like' functionality in my app using the iOS toolkit. The code I'm using is as follows:

 

 

-(void) like:(NSString *)messageId {
    ZKSObject *like = [[[ZKSObject alloc] initWithType:@"FeedLike"] autorelease];
    [like setFieldValue:messageId field:@"FeedItemId"];
    
    FDCServerSwitchboard *switchboard = [FDCServerSwitchboard switchboard];
    NSArray *objects = [NSArray arrayWithObject:like];
    [switchboard create:objects target:self selector:@selector(likeCreated:error:context:) context:nil];
}

 The error message I'm getting is:

 

<__NSArrayM 0xd9454b0>(

INVALID_TYPE - sObject type 'FeedLike' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.

)

 

Is there something else I need to do to get "Likes" working?

 

SuperfellSuperfell

Make sure you're using a recent API version (v20 and up i think)

Thomas CookThomas Cook

If using the Chatter REST API is an option, try sending an HTTP POST request to https://na1.salesforce.com/services/data/v22.0/chatter/feed-items/{feedItemId}/likes and that should do it, assuming your instance is na1.salesforce.com -- adjust as necessary.