Created
March 7, 2024 11:40
-
-
Save Ayush783/0171770941937a6c142a56eda1d5e159 to your computer and use it in GitHub Desktop.
Service class for FlutterCallingKit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CallingKitService { | |
static final CallingKitService _instance = CallingKitService._internal(); | |
factory CallingKitService() { | |
return _instance; | |
} | |
CallingKitService._internal() { | |
MethodChannel('YOUR_CHANNEL_NAME').setMethodCallHandler( | |
(call) async { | |
if (call.method == 'CALL_ACCEPTED_INTENT') { | |
final data = call.arguments; | |
if (data != null) { | |
// Handle data found | |
} else { | |
// Handle no data found | |
} | |
} | |
}, | |
); | |
} | |
static void showCallkitIncoming(...) async { | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment