Trouble with websocket closing down on first subscribe, Swift on Mac Sonoma

I have some sample code in Python that works fine to open a websocket to stream BTC-USD tickers for example, but when I send the exact same subscribe message (verified JSON is the same) to a socket opened in Swift, the socket just shuts down (read-side closed) and I get a Code 57, “Socket is not connected”. My socket code in Swift works fine in Coinbase Pro, but I just can’t get it to work with wss:// I know this is vague, but any thoughts on how to troubleshoot?

Here’s a sample message sent out: {“timestamp”:“1700336427”,“signature”:“c26f448e604651ed7e642771d19afe2f2b6180aa638a08da736f94ccf5b1baf4”,“type”:“subscribe”,“channel”:“heartbeat”,“api_key”:“—redacted—”,“product_ids”:[“BTC-USD”]}

Starter project for Advanced Trading websocket in Swift is on GitHub (shows failure to subscribe): GitHub - dcostin/ATsocket: Coinbase Advanced Trading Socket starter project

OK, solved it. This websocket requires .string messages, does not accept .data messages. GitHub project updated.

Hey @GeeDan welcome to the forum! Thank you for sharing your project with the community, we really appreciate it. Glad to hear that you were able to solve it on your own.
Please share feedbacks related to Advaced Trade APIs here. Thank you for using our APIs again. Have a good one!