FlipByBlink / PersonaChess

Chess app for Spatial SharePlay 【Apple Vision Pro】
36 stars 4 forks source link

How did you test sharePlay? #2

Open lulinxuan opened 4 months ago

lulinxuan commented 4 months ago

Hi thanks a lot for sharing this code! I'm also trying to develop a sharePlay game, but I'm a solo developer with only one vision pro. May I know how did you test this sharePlay during development? Can you play with simulator?

FlipByBlink commented 4 months ago

To debug Spatial SharePlay, two Apple Vision Pros are required. SharePlay does not work in simulator.

However, it is possible to debug "Non Spatial" SharePlay (normal SharePlay). By creating an iOS version, you can debug "Non Spatial" SharePlay between one Apple Vision Pro and one iPhone.

In fact, an iOS version was created for debugging PersonaChess. It is named "iOS for debug". This iOS version has not been released on App Store.

lulinxuan commented 4 months ago

That's a brillient idea! Thanks a lot, that really helps!

lulinxuan commented 3 months ago

Hi, I'm running this game in Vision and iPhone now, and make them having a facetime call. Then I'm able to start a shareplay session, and I can see in the iPhone the groupSession.state is joined. But all my actions are not synced, and I got error message saying: messageStream(for:messageType:):604 Explanation: Decoding message from data Error: Swift.DecodingError.valueNotFound(Any, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "message", intValue: nil), CodingKeys(stringValue: "t", intValue: nil)], debugDescription: "Decoder for value of iOS_for_debug.ActivityState.self not found.", underlyingError: nil))

Do you have any idea why this happened?

FlipByBlink commented 3 months ago

When I tried Vision Pro's SharePlay the first time, I also encountered the same problem. However, when I left it for a time and tried the next day, the problem stopped occurring.

I am not sure what caused the problem. Maybe it is caused by Apple's SharePlay server.

Anyway, please give it some time and try it.

lulinxuan commented 3 months ago

Thanks! I have found the issue here https://mitemmetim.medium.com/shareplay-tutorial-share-custom-data-between-ios-and-macos-a50bfecf6e64#e3c7, and it works after I change product name to same value!