本文にスキップする
Version: 1.1

リリースノート

Flutter向けPlanetKit 1.1のリリースノートです。

v1.1

リリース日:2025-12-16

バックグラウンド通話の検証と受け入れ

  • PlanetKit Flutter SDKは現在バックグラウンドアイソレート(例:Firebase Cloud Messagingハンドラー)で受信通話を検証して処理した後、フォアグラウンドUIアイソレートへシームレスに切り替える機能をサポートします。
  • この機能により、アプリがバックグラウンド状態または終了状態であっても、受信通話を適切に処理できます。

API

追加
  • PlanetKitManager class 1-to-1 call
    • Future<PlanetKitVerifyBackgroundCallResult> verifyBackgroundCall(PlanetKitVerifyCallParam param, PlanetKitBackgroundCallEventHandler handler)
    • Future<PlanetKitCall?> adoptBackgroundCall(String backgroundCallId, PlanetKitCallEventHandler handler)
  • PlanetKitVerifyBackgroundCallResult class 1-to-1 call
  • PlanetKitBackgroundCall class 1-to-1 call
  • PlanetKitBackgroundCallEventHandler class 1-to-1 call

使用例

// In background isolate (FCM handler)
('vm:entry-point')
Future<void> firebaseMessagingBackgroundHandler(RemoteMessage message) async {
final result = await PlanetKitManager.instance.verifyBackgroundCall(
param,
PlanetKitBackgroundCallEventHandler(
onVerified: (bgCall, peerUseResponderPrep) {
// Show notification to user
print('Background call verified: ${bgCall.backgroundCallId}');
},
onDisconnected: (bgCall, reason, source, userCode, byRemote) {
// Handle background disconnection
print('Call ended before adoption');
},
onError: (bgCall) => print('Error'),
onBackgroundCallAdopted: (bgCall) => print('Adopted to foreground'),
),
);

if (result.reason == PlanetKitStartFailReason.none) {
final bgCallId = result.call!.backgroundCallId;
// Store bgCallId for foreground adoption
}
}

// Later in foreground/UI isolate
final call = await PlanetKitManager.instance.adoptBackgroundCall(
bgCallId,
PlanetKitCallEventHandler(
onConnected: (_) => print('Call connected'),
onDisconnected: (_, reason, source, userCode, byRemote) {
print('Call ended in foreground');
},
),
);