Package apple.watchconnectivity.protocol
Interface WCSessionDelegate
-
public interface WCSessionDelegate----------------------------- WCSessionDelegate ----------------------------- The session calls the delegate methods when content is received and session state changes. All delegate methods will be called on the same queue. The delegate queue is a non-main serial queue. It is the client's responsibility to dispatch to another queue if neccessary.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceWCSessionDelegate.Block_sessionDidReceiveMessageDataReplyHandlerstatic interfaceWCSessionDelegate.Block_sessionDidReceiveMessageReplyHandler
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidsessionActivationDidCompleteWithStateError(@NotNull WCSession session, long activationState, @Nullable NSError error)Called when the session has completed activation.voidsessionDidBecomeInactive(@NotNull WCSession session)Called when the session can no longer be used to modify or add any new transfers and, all interactive messages will be cancelled, but delegate callbacks for background transfers can still occur.voidsessionDidDeactivate(@NotNull WCSession session)Called when all delegate callbacks for the previously selected watch has occurred.default voidsessionDidFinishFileTransferError(@NotNull WCSession session, @NotNull WCSessionFileTransfer fileTransfer, @Nullable NSError error)Called on the sending side after the file transfer has successfully completed or failed with an error.default voidsessionDidFinishUserInfoTransferError(@NotNull WCSession session, @NotNull WCSessionUserInfoTransfer userInfoTransfer, @Nullable NSError error)Called on the sending side after the user info transfer has successfully completed or failed with an error.default voidsessionDidReceiveApplicationContext(@NotNull WCSession session, @NotNull NSDictionary<java.lang.String,?> applicationContext)Called on the delegate of the receiver.default voidsessionDidReceiveFile(@NotNull WCSession session, @NotNull WCSessionFile file)Called on the delegate of the receiver.default voidsessionDidReceiveMessage(@NotNull WCSession session, @NotNull NSDictionary<java.lang.String,?> message)Called on the delegate of the receiver.default voidsessionDidReceiveMessageData(@NotNull WCSession session, @NotNull NSData messageData)Called on the delegate of the receiver.default voidsessionDidReceiveMessageDataReplyHandler(@NotNull WCSession session, @NotNull NSData messageData, @NotNull WCSessionDelegate.Block_sessionDidReceiveMessageDataReplyHandler replyHandler)Called on the delegate of the receiver when the sender sends message data that expects a reply.default voidsessionDidReceiveMessageReplyHandler(@NotNull WCSession session, @NotNull NSDictionary<java.lang.String,?> message, @NotNull WCSessionDelegate.Block_sessionDidReceiveMessageReplyHandler replyHandler)Called on the delegate of the receiver when the sender sends a message that expects a reply.default voidsessionDidReceiveUserInfo(@NotNull WCSession session, @NotNull NSDictionary<java.lang.String,?> userInfo)Called on the delegate of the receiver.default voidsessionReachabilityDidChange(@NotNull WCSession session)Called when the reachable state of the counterpart app changes.default voidsessionWatchStateDidChange(@NotNull WCSession session)Called when any of the Watch state properties change.
-
-
-
Method Detail
-
sessionActivationDidCompleteWithStateError
void sessionActivationDidCompleteWithStateError(@NotNull @NotNull WCSession session, long activationState, @Nullable @Nullable NSError error)Called when the session has completed activation. If session state is WCSessionActivationStateNotActivated there will be an error with more details. API-Since: 9.3
-
sessionDidFinishFileTransferError
default void sessionDidFinishFileTransferError(@NotNull @NotNull WCSession session, @NotNull @NotNull WCSessionFileTransfer fileTransfer, @Nullable @Nullable NSError error)Called on the sending side after the file transfer has successfully completed or failed with an error. Will be called on next launch if the sender was not running when the transfer finished.
-
sessionDidFinishUserInfoTransferError
default void sessionDidFinishUserInfoTransferError(@NotNull @NotNull WCSession session, @NotNull @NotNull WCSessionUserInfoTransfer userInfoTransfer, @Nullable @Nullable NSError error)Called on the sending side after the user info transfer has successfully completed or failed with an error. Will be called on next launch if the sender was not running when the user info finished.
-
sessionDidReceiveApplicationContext
default void sessionDidReceiveApplicationContext(@NotNull @NotNull WCSession session, @NotNull @NotNull NSDictionary<java.lang.String,?> applicationContext)Called on the delegate of the receiver. Will be called on startup if an applicationContext is available.
-
sessionDidReceiveFile
default void sessionDidReceiveFile(@NotNull @NotNull WCSession session, @NotNull @NotNull WCSessionFile file)Called on the delegate of the receiver. Will be called on startup if the file finished transferring when the receiver was not running. The incoming file will be located in the Documents/Inbox/ folder when being delivered. The receiver must take ownership of the file by moving it to another location. The system will remove any content that has not been moved when this delegate method returns.
-
sessionDidReceiveMessage
default void sessionDidReceiveMessage(@NotNull @NotNull WCSession session, @NotNull @NotNull NSDictionary<java.lang.String,?> message)Called on the delegate of the receiver. Will be called on startup if the incoming message caused the receiver to launch.
-
sessionDidReceiveMessageReplyHandler
default void sessionDidReceiveMessageReplyHandler(@NotNull @NotNull WCSession session, @NotNull @NotNull NSDictionary<java.lang.String,?> message, @NotNull @NotNull WCSessionDelegate.Block_sessionDidReceiveMessageReplyHandler replyHandler)Called on the delegate of the receiver when the sender sends a message that expects a reply. Will be called on startup if the incoming message caused the receiver to launch.
-
sessionDidReceiveMessageData
default void sessionDidReceiveMessageData(@NotNull @NotNull WCSession session, @NotNull @NotNull NSData messageData)Called on the delegate of the receiver. Will be called on startup if the incoming message data caused the receiver to launch.
-
sessionDidReceiveMessageDataReplyHandler
default void sessionDidReceiveMessageDataReplyHandler(@NotNull @NotNull WCSession session, @NotNull @NotNull NSData messageData, @NotNull @NotNull WCSessionDelegate.Block_sessionDidReceiveMessageDataReplyHandler replyHandler)Called on the delegate of the receiver when the sender sends message data that expects a reply. Will be called on startup if the incoming message data caused the receiver to launch.
-
sessionDidReceiveUserInfo
default void sessionDidReceiveUserInfo(@NotNull @NotNull WCSession session, @NotNull @NotNull NSDictionary<java.lang.String,?> userInfo)Called on the delegate of the receiver. Will be called on startup if the user info finished transferring when the receiver was not running.
-
sessionDidBecomeInactive
void sessionDidBecomeInactive(@NotNull @NotNull WCSession session)Called when the session can no longer be used to modify or add any new transfers and, all interactive messages will be cancelled, but delegate callbacks for background transfers can still occur. This will happen when the selected watch is being changed. API-Since: 9.3
-
sessionDidDeactivate
void sessionDidDeactivate(@NotNull @NotNull WCSession session)Called when all delegate callbacks for the previously selected watch has occurred. The session can be re-activated for the now selected watch using activateSession. API-Since: 9.3
-
sessionReachabilityDidChange
default void sessionReachabilityDidChange(@NotNull @NotNull WCSession session)Called when the reachable state of the counterpart app changes. The receiver should check the reachable property on receiving this delegate callback.
-
sessionWatchStateDidChange
default void sessionWatchStateDidChange(@NotNull @NotNull WCSession session)Called when any of the Watch state properties change.
-
-