Browse SDKs · iOS
SDKsiOS

Create a contact-card message

Create a user contact-card message with OpenIM iOS SDK.

Copy
OIMCardElem *card = [OIMCardElem new];
card.userID = @"user_b";
card.nickname = @"Alex";
card.faceURL = @"https://example.com/avatar.png";
card.ex = @"";
OIMMessageInfo *message = [OIMMessageInfo createCardMessage:card];

The card contains a snapshot of the profile at creation time and does not update automatically when that user's profile changes. The returned object must still be sent explicitly.