Before using Sign or Auth SDK, it is necessary to configure a shared Networking Client instance. Set a project ID generated when starting a project on Reown Dashboard and SocketFactory instance.WalletConnect Swift SDK does not depend on any websocket library. SocketFactory parameter allows you to pass your own implementation of websocket connection.Here’s an example of WebSocketFactory implementation using Starscream v3Please note that if you have made changes to the list of Allowed Domains in the Reown Dashboard, then you may encounter an error with the connection if you use Starscream or any other socket client. For example, the native implementation of Starscream will use the
relay.walletconnect.com
as an Origin
parameter if not provided, which will be missing from the list of Allowed Domains. The solution to this could be the inclusion of the relay.walletconnect.com
in the Allowed Domains, corresponding changes in the socket client implementation, or following changes in the WebSocketFactory
.Create and register App Group Identifier in Apple Developer Center if needed and provide it during Networking client configuration.Networking client configuration
groupIdentifier
- App group identifier, created on Apple Developer Center. Enables to share keychain items between the Notify SDK and a UNNotificationServiceExtension to receive and decrypt push notifications.Web Socket Connection
By default web socket connection is handled internally by the SDK. That means that Web socket will be safely disconnected when apps go to background and it will connect back when app reaches foreground. But if it is not expected for your app and you want to handle socket connection manually you can do it as follows:- set socketConnectionType for manual
- control socket connection: