GitHub 저장소istornz/flutter_shareplay

flutter_shareplay

FaceTime 통화 중에 iOS 실시간 연결 SharePlay 📡 를 사용하는 Flutter 플러그인 🎥

flutter_shareplay 프로젝트 이미지
스타
23
포크
3
최근 푸시(UTC)
2025. 4. 27.
프로젝트 상태
활성

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

flutter ios 15 shareplay logo



A Flutter plugin to use iOS 15.0+ real-time connection SharePlay on a FaceTime call 🎥.

🧐 What is it ?

This plugin use official iOS GroupActivities API.

share_play can be used to communicate data over devices in a Flutter apps using iOS SharePlay features.

Why using iOS SharePlay?

  • ⚡️ It's fast.
  • 🍀 Reliable (using Apple server).
  • 💰 It's "free" (including in your paid Apple Developer subscription).
  • 😌 Very easy to implement (in 3 lines of code you can share data!).
  • 🙌 Works accros iOS, macOS & tvOS.

⚠️ share_play is only intended to use with iOS 15.0+! It will simply do nothing on other platform & < iOS 15.0


flutter ios 15 shareplay group activities preview

👻 Getting started

ℹ️ You can check into the example repository for a full example.

  • Open the Xcode workspace project ios/Runner.xcworkspace.
  • Enable "Group Activities" capabilities on the main Runner app.
enable group activities capabilities xcode
  • Import share_play & create an instance of the Plugin.
import 'package:shareplay/shareplay.dart';

// [...]

final _shareplayPlugin = SharePlay();

ℹ️ Quick start

  • Add listener when a new message is received (in initState() method for ex).
@override
void initState() {
  super.initState();
  
  // [...]

  _shareplayPlugin.dataStream().listen((data) {
    // do what you want here :)
  });
}
  • Start a new activity 🏁.
_shareplayPlugin.start(title: 'My Activity');
  • Join activity from another device 📲.
_shareplayPlugin.join();

ℹ️ By tapping on the SharePlay banner on top of the screen, you don't need to call join() method!

  • Send your first message.
_shareplayPlugin.send('Hello from Flutter');

ℹ️ For more, check documentation below or example.

📘 Documentation

Name Description Returned value
.start() Create an activity when a FaceTime call is active Future<bool> State of the new activity is created or not
.join() Starts the shared activity on the current device, not necessary if user tap on the SharePlay banner Future When a new activity was joined
.localParticipant() Use this property to differentiate the participant on the current device from participants on other devices Future<SPParticipant?> The participant on the current device including participant id
.end() Ends the activity for the entire group Future When the activity was stopped
.leave() Leaves the current activity Future When the activity was leaved
.send() Send a message to all other participants Future When the message was sent
.currentSession() Get the current session on the device Future<SPSession?> Current session including session id & activity title
.dataStream() The stream of messages received from other participants Stream<SPDataModel> Source participant & message data
.newSessionStream() A stream of all created sessions Stream<SPSession> Created session including session id & activity title
.participantsStream() A stream of all active participants in the current session Stream<List<SPParticipant>> All active participants in the activity
.sessionStateStream() A stream of the current session state. Stream<SPSessionState> Session state (SPSessionState.waiting, SPSessionState.joined or SPSessionState.invalidated)

👥 Contributions

Contributions are welcome. Contribute by creating a PR or create an issue 🎉.

🎯 Roadmap

  • [ ] Add method to check if SharePlay is available.
  • [ ] Display a custom error when SharePlay is not available on older iOS version.
  • [ ] Implement prepareForActivation() method.
  • [x] Create stream to handle message data & new session created.
  • [x] Get local data like participant & session state.
  • [x] Leave & end activity.
  • [x] Send a message accros SharePlay.
  • [x] Join an activity.
  • [x] Start a new activity.
Dimitri Dessus GitHub avatar
GitHub 작성자

Dimitri Dessus ↗

Mobile and web developer 👨‍💻

언어DartSwiftRubyObjective-C

분류

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 4 개

  • flutter{"sdk":"flutter"}
  • plugin_platform_interface^2.1.8
  • flutter_test개발 의존성{"sdk":"flutter"}
  • flutter_lints개발 의존성^5.0.0

프로젝트에 맞는 저장소를 선택하려면?

사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.

  1. 이름, 작성자 또는 설명으로 검색하고 기술 주제로 범위를 좁힙니다.
  2. 스타, 포크, 최근 푸시를 함께 비교하세요. 스타는 관심의 지표이며 품질을 보장하지 않습니다.
  3. 사용하기 전에 GitHub에서 README, 라이선스, Issues를 확인하세요.

출처 및 관리

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗