SOSDelegate
@protocol SOSDelegate <NSObject>
The SOSDelegate
protocol provides information about the SOS session.
-
Tells the delegate that an SOS session has started.
This method is executed once the SOS Session has begun to initialize a connection.
Declaration
Objective-C
- (void)sosDidStart:(SOSSessionManager *)sos;
Swift
optional func sosDidStart(_ sos: SOSSessionManager!)
Parameters
sos
SOSSessionManager
instance that invoked the delegate method. -
Tells the delegate that an SOS session is stopping.
This event is invoked when the session is entering its cleanup phase.
See
SOSStopReason
See
SOSErrorCode
Declaration
Objective-C
- (void)sos:(SOSSessionManager *)sos didStopWithReason:(SOSStopReason)reason error:(NSError *)error;
Swift
optional func sos(_ sos: SOSSessionManager!, didStopWith reason: SOSStopReason, error: Error!)
Parameters
sos
SOSSessionManager
instance that invoked the delegate method.reason
SOSStopReason
enum for why the session ended.error
NSError
instance returned if the session ended as the result of an error. Compare the error code toSOSErrorCode
for details about the error. Error isnil
if the session ended cleanly. -
Tells the delegate that an attempt is being made to reconnect to an SOS session.
This is executed if the SOS session needs to reconnect.
Declaration
Objective-C
- (void)sosWillReconnect:(SOSSessionManager *)sos;
Swift
optional func sosWillReconnect(_ sos: SOSSessionManager!)
Parameters
sos
SOSSessionManager
instance that invoked the delegate method. -
Calls the delegate when the SOS session has connected. The session is now fully active.
Declaration
Objective-C
- (void)sosDidConnect:(SOSSessionManager *)sos;
Swift
optional func sosDidConnect(_ sos: SOSSessionManager!)
Parameters
sos
SOSSessionManager
instance that invoked the delegate method. -
Calls the delegate when the SOS session has been created.
Declaration
Objective-C
- (void)sos:(SOSSessionManager *)sos didCreateSession:(NSString *)sessionId;
Swift
optional func sos(_ sos: SOSSessionManager!, didCreateSession sessionId: String!)
Parameters
sos
SOSSessionManager
instance that invoked the delegate method.sessionId
NSString
of the sessionId for the session that has just started. -
Tells the delegate that an error occurred during an active SOS session.
See
SOSErrorCode
Declaration
Objective-C
- (void)sos:(SOSSessionManager *)sos didError:(NSError *)error;
Swift
optional func sos(_ sos: SOSSessionManager!, didError error: Error!)
Parameters
sos
SOSSessionManager
instance that invoked the delegate method.error
NSError
instance describing the error. Compare the error code toSOSErrorCode
for details about the error. -
Declaration
Objective-C
- (void)sos:(SOSSessionManager *)sos stateDidChange:(SOSSessionState)current previous:(SOSSessionState)previous;
Swift
optional func sos(_ sos: SOSSessionManager!, stateDidChange current: SOSSessionState, previous: SOSSessionState)
Parameters
sos
SOSSessionManager
instance that executed the delegate.current
The new
SOSSessionState
that has been set on theSOSSessionManager
instance.previous
The previous
SOSSessionState
.