-
Add SharePlay to your app
Discover how your app can take advantage of SharePlay to turn any activity into a shareable experience with friends! We'll share the latest updates to SharePlay, explore the benefits of creating shared activities, dive into some exciting use cases, and take you through best practices to create engaging and fun moments of connection in your app.
Chapitres
- 2:10 - New to SharePlay
- 5:43 - Use Cases
- 9:48 - Add SharePlay to your app
- 11:09 - Best Practices
Ressources
Vidéos connexes
WWDC23
-
Rechercher dans cette vidéo…
-
-
4:15 - Defining your GroupActivity type
var metadata: GroupActivityMetadata { var metadata = GroupActivityMetadata() metadata.title = “Order Tacos Together” metadata.type = .generic return metadata } -
9:50 - Add SharePlay
import GroupActivities struct OrderTogether: GroupActivity { // Define a unique activity identifier for system to reference static let activityIdentifier = "com.example.apple-samplecode.TacoTruck.OrderTogether" // App-specific data so your app can launch the activity on others' devices let orderUUID: UUID let truckName: String var metadata: GroupActivityMetadata { var metadata = GroupActivityMetadata() metadata.title = "Order Tacos Together" metadata.subtitle = truckName metadata.previewImage = UIImage(named: "ActivityImage")?.cgImage metadata.type = .shopTogether return metadata } }
-