So let's go ahead and remove the latter statement, and move it down here.Īnd now what we have to do is register a new variable so that we know when to present our GroupActivity sharing controller. Now, as you can see here, we have an ‘if’ statement that makes sure that we don't have a group session and that we're eligible for a group session. Let's go ahead and go to our ControlBar code. Let's go ahead and modify that behavior so that even when isEligibleForGroupSession is false, we show the button and, now, allow the user to start a SharePlay session.Īnd now we can go ahead and see it in action. Now that you've gone ahead and seen that, you'll remember there weren't any share buttons in our app, but we did have a SharePlay button when you were eligible for a GroupSession. It's the same app from our previous WWDC talk from 2021 "Build custom experiences with Group Activities," so if you haven't seen it already, I highly recommend checking it out. For now, let's see how we can adopt this in our DrawTogether app. Yes, I did! But let's hold onto that thought and dive deeper into that later when we're talking about best practices. And don't worry if you're saying to yourself "Wait, Adam, did you just say 'Staged GroupActivity'?" Why, yes. Once activated, your app will receive the GroupSession. ![]() Or what if you have a piece of content in your app that doesn't support SharePlay? Well, while we'd love for everything to support SharePlay, you can make SharePlay not show up in the share sheet by telling UIActivityViewController to exclude the SharePlay activity type.Īnd if you want to place a button directly within your app, then you can use our new API GroupActivitySharingController to create our UIViewController and then, just present it! Once someone presses your in-app experience and starts a FaceTime or SharePlay session, they'll then be presented with the ability to activate the staged GroupActivity. Just set allowsProminentActivity to false. You can tune the behavior with allowsProminentActivity on the UIActivityViewController. Want to still offer the SharePlay button but not display it as prominently? No problem. The answer is, it's as simple as registering your GroupActivity on NSItemProvider and then providing the ItemProvider to the share sheet. So let's see how you'd adopt our new APIs for your app. Well, the answer is that if your app is entitled for SharePlay then you get this button for free with our zero adoption flow, but this isn't the optimal user experience since the user won't be able to start the GroupActivity through system UI and will, instead, need to re-interact with your app to pick the content to SharePlay. ![]() Here we have the ability for users to start SharePlay from share sheet, and you may be wondering what you need to do for this to work. Well, I thought that was all pretty cool, but let's break that down into some more detail. So if Sue joins, we can go ahead and start, and we'll have group session. So we can select Sue and start a FaceTime call.Īnd, as you can see, we now have a pill here with the staged activity. So I'll go ahead and press that, and it brings up the people picker. Now in the contextual menu, you'll see that we now have a new SharePlay button. And we'll find a song that we want to SharePlay, like Viral Hits, and press and hold it. So now all we have to do is find our favorite SharePlay app. We heard your feedback and we delivered, As of iOS 15.4 you can now leverage new API to allow your app to start SharePlay without an existing FaceTime call. Finally, some best practices around implementing a SharePlay experience. Next, we'll get into some exciting GroupSessionMessenger updates. ![]() To start, we'll talk about some new APIs for starting SharePlay from your app. I'm excited to talk to you about what's new in SharePlay and how you can adopt it in your app. ♪ ♪ Adam: Hi, my name's Adam and I'm an engineer on the SharePlay team.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |