From 62f57797ab8dfd2d4b25138603a5e8670ca00dcb Mon Sep 17 00:00:00 2001 From: Vinesh Raju Date: Wed, 6 Sep 2023 21:26:32 +0100 Subject: [PATCH] Add `displayTickets` interface (#350) --- intercom_flutter_platform_interface/CHANGELOG.md | 4 ++++ .../lib/intercom_flutter_platform_interface.dart | 5 +++++ .../lib/method_channel_intercom_flutter.dart | 5 +++++ intercom_flutter_platform_interface/pubspec.yaml | 2 +- .../test/method_channel_intercom_flutter_test.dart | 8 ++++++++ 5 files changed, 23 insertions(+), 1 deletion(-) diff --git a/intercom_flutter_platform_interface/CHANGELOG.md b/intercom_flutter_platform_interface/CHANGELOG.md index 422dbf3..12e99ca 100755 --- a/intercom_flutter_platform_interface/CHANGELOG.md +++ b/intercom_flutter_platform_interface/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.3.2 + +* Added method `displayTickets` + ## 1.3.1 * Added method `displayConversation` diff --git a/intercom_flutter_platform_interface/lib/intercom_flutter_platform_interface.dart b/intercom_flutter_platform_interface/lib/intercom_flutter_platform_interface.dart index e9b9455..e5b92a9 100644 --- a/intercom_flutter_platform_interface/lib/intercom_flutter_platform_interface.dart +++ b/intercom_flutter_platform_interface/lib/intercom_flutter_platform_interface.dart @@ -278,4 +278,9 @@ abstract class IntercomFlutterPlatform extends PlatformInterface { Future displayConversation(String conversationId) { throw UnimplementedError('displayConversation() has not been implemented.'); } + + /// To display an activity with all your tickets. + Future displayTickets() { + throw UnimplementedError('displayTickets() has not been implemented.'); + } } diff --git a/intercom_flutter_platform_interface/lib/method_channel_intercom_flutter.dart b/intercom_flutter_platform_interface/lib/method_channel_intercom_flutter.dart index 4fcccc2..0fc01a2 100644 --- a/intercom_flutter_platform_interface/lib/method_channel_intercom_flutter.dart +++ b/intercom_flutter_platform_interface/lib/method_channel_intercom_flutter.dart @@ -243,6 +243,11 @@ class MethodChannelIntercomFlutter extends IntercomFlutterPlatform { 'displayConversation', {'conversationId': conversationId}); } + @override + Future displayTickets() async { + await _channel.invokeMethod('displayTickets'); + } + /// Convert the [PlatformException] details to [IntercomError]. /// From the Platform side if the intercom operation failed then error details /// will be sent as details in [PlatformException]. diff --git a/intercom_flutter_platform_interface/pubspec.yaml b/intercom_flutter_platform_interface/pubspec.yaml index 277ce99..116bf8d 100644 --- a/intercom_flutter_platform_interface/pubspec.yaml +++ b/intercom_flutter_platform_interface/pubspec.yaml @@ -1,6 +1,6 @@ name: intercom_flutter_platform_interface description: A common platform interface for the intercom_flutter plugin. -version: 1.3.1 +version: 1.3.2 homepage: https://github.com/v3rm0n/intercom_flutter dependencies: diff --git a/intercom_flutter_platform_interface/test/method_channel_intercom_flutter_test.dart b/intercom_flutter_platform_interface/test/method_channel_intercom_flutter_test.dart index 919b004..718c241 100644 --- a/intercom_flutter_platform_interface/test/method_channel_intercom_flutter_test.dart +++ b/intercom_flutter_platform_interface/test/method_channel_intercom_flutter_test.dart @@ -423,6 +423,14 @@ void main() { ], ); }); + + test('displayTickets', () async { + await intercom.displayTickets(); + expect( + log, + [isMethodCall('displayTickets', arguments: null)], + ); + }); }); }