initialize static method
Initialize the VoIP plugin Call this once at app startup
Implementation
static Future<void> initialize() async {
if (_initialized) {
debugPrint('VoIP Plugin: Already initialized');
return;
}
try {
debugPrint('═══════════════════════════════════════');
debugPrint('🚀 INITIALIZING VoIP PLUGIN');
debugPrint('═══════════════════════════════════════');
// Initialize VoIP service (CallKit)
await VoipService.initialize();
// Initialize SIP service
await SipService.initialize();
// Set up callbacks
_setupCallbacks();
_initialized = true;
debugPrint('✅ VoIP Plugin initialized successfully');
debugPrint('═══════════════════════════════════════');
} catch (e, stackTrace) {
debugPrint('❌ Failed to initialize VoIP Plugin: $e');
debugPrint('Stack trace: $stackTrace');
rethrow;
}
}