This will even work when you build the app locally, but as soon as you upload the app to App Store Connect for example and download it via TestFlight, you will get the same error as above, just with the package name instead of the project name like SharePlayModelPackage.SharePlayModel.Īfter comparing the project.pbxproj file of a newly created multiplatform app (where it was working out of the box) and a newly created iOS app where the Mac target was added afterwards, I found the issue in the incorrect Product Name value. My first attempt for solving this issue was to create a custom package, move the type/model there and importing the package where the model is used. The type was somehow connected to the target’s name SharePlayTutorialMac. It seems like the type was defined in some kind of absolute way as the model’s type was defined as SharePlayTutorialMac.SharePlayModel in the error instead of just SharePlayModel. It was quite strange since nowhere an object with a value of message or t inside was used as mentioned in the error. SharePlayTutorialMac messageStream:108 Explanation: Decoding message from data Error: (Any, (codingPath:, debugDescription: “Decoder for value of not found.”, underlyingError: nil)) In a first attempt of creating a tutorial, where I created first an iOS app and added a Mac target afterwads, I got the following error as soon I tried to send some data: Add now for both targets the Group Activities capability by selecting each target, clicking on +Capability on the top left corner, searching for Group Activities and selecting it. Let’s start by selecting the project on the left side in the navigator where you should see two targets - SharePlayTutorial (iOS) and SharePlayTutorial (macOS). For copy-paste reasons I recommend to use the same naming as a first step. feel free to use a different naming and to extend/adapt the project at any time as you would like to. This tutorial will be kept as simple as possible, to make it easily understandable - therefore, a generic naming of “SharePlay” will be used for the project, models, etc. Download the initial tutorial project: Direct or on Github.Since this a cross-platform tutorial, I recommend the following setup, but in general it should also work if you use one of the following devices twice.Īdditionally you should also download an initial project which already covers the UI and game logic part for you as we won’t go into detail about that: Preconditionsįor testing the SharePlay functionality you need two physical devices because FaceTime is needed. Even though the overall usage of the Group Activities API is well set up and easy to use, it can still happen to get stuck at some points, therefore, we go through the setup step-by-step in this tutorial and sum up possible problems and solutions at the end of this post.įinal SharePlay demo application. In this tutorial we will especially focus on the last part and create a small simple tug of war game to showcase the functionality of SharePlay in a fun way. In general you can use the Group Activities API to easily share video and audio, but also custom data with each other. Recently, iOS 15.1 and the macOS 12.1 Beta were released, which both come with the functionality of SharePlay - a new way to share experiences of your app right inside FaceTime.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |