diff --git a/refilc/lib/api/providers/liveactivity/platform_channel.dart b/refilc/lib/api/providers/liveactivity/platform_channel.dart index 8b782da4..c6f7ba2f 100644 --- a/refilc/lib/api/providers/liveactivity/platform_channel.dart +++ b/refilc/lib/api/providers/liveactivity/platform_channel.dart @@ -4,18 +4,23 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/services.dart'; class PlatformChannel { - static const MethodChannel _channel = MethodChannel('hu.refilc/liveactivity'); + static const MethodChannel _channel = MethodChannel('app.firka/liveactivity'); - static Future createLiveActivity( + /// Létrehozza a Live Activity-t és visszaadja az APNs push tokent (ha elérhető). + static Future createLiveActivity( Map activityData) async { if (Platform.isIOS) { try { debugPrint("creating..."); - await _channel.invokeMethod('createLiveActivity', activityData); + final String? pushToken = await _channel.invokeMethod( + 'createLiveActivity', activityData); + debugPrint("Live Activity push token: $pushToken"); + return pushToken; } on PlatformException catch (e) { debugPrint("Hiba történt a Live Activity létrehozásakor: ${e.message}"); } } + return null; } static Future updateLiveActivity(