can you send PrivateMessage by name?

Post here your questions about the Objective-C API for SFS2X

Moderators: Lapo, Bax

intomo
Posts: 51
Joined: 22 Nov 2010, 21:21
Location: Los Angeles

can you send PrivateMessage by name?

Postby intomo » 03 Dec 2021, 07:02

I see how to send by ID, is there a way of sending by name of the recipient?

Code: Select all

    func sendPrivateMessage(recipientID: Int, message: String) {
        smartFox.send(PrivateMessageRequest.request(withMessage:message, recipientId: recipientID) as? IRequest)
    }
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: can you send PrivateMessage by name?

Postby Lapo » 03 Dec 2021, 09:05

Hi,
no, it's by id, which you can obtain from the SFSUser object.
If you have the name you should also have the ID, since both these properties come from the SFSUser object.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
intomo
Posts: 51
Joined: 22 Nov 2010, 21:21
Location: Los Angeles

Re: can you send PrivateMessage by name?

Postby intomo » 03 Dec 2021, 15:57

Can you assign an ID during connection/log in as long as it is unique? Or are they always assigned by the server? I'm assuming they are always integers as well? Thanks.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: can you send PrivateMessage by name?

Postby Lapo » 04 Dec 2021, 05:47

Yes, they're auto-assigned.
Can you explain what are you trying to achieve?

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X iPhone / iPad / OSX API”

Who is online

Users browsing this forum: No registered users and 15 guests