DyKnow / SignalR-ObjC

Objective-C Client for the SignalR Project works with iOS and Mac
MIT License
442 stars 213 forks source link

Regarding ConnectionID #292

Open raghubb4444 opened 7 years ago

raghubb4444 commented 7 years ago

I am not able to get my connectionId..How to achieve? I want to send connectionID to my server....Please help out

joeldart commented 7 years ago

connectionid becomes available/valid on the SRConnection object after the started callback.

    __weak __typeof(&*_connection)weakConnection = _connection;

    self.connection.started = ^{
        __weak __typeof(&*weakConnection)strongConnection = weakConnection;

        id parameters = @{
            @"connection_id" : (strongConnection.connectionId) ? strongConnection.connectionId : @""
        };
    };