Skip to content

Commit 5cac16d

Browse files
0.9.3
1 parent 1cd89cd commit 5cac16d

File tree

7 files changed

+61
-7
lines changed

7 files changed

+61
-7
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 0.9.3 (24/11/2021)
2+
3+
### Enhancements
4+
* Display complete name for messages created using API
5+
* Support for fetching unread count for a specific channel using tags
6+
* Resources path update and minor changes for other framework bundle (iOS)
7+
8+
### Bug Fix
9+
* FAQ contactUs tags filter (iOS)
10+
111
## 0.9.2 (08/11/2021)
212

313
### Bug Fix

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ android {
3535

3636
dependencies {
3737
implementation 'com.android.support:localbroadcastmanager:28.0.0'
38-
implementation 'com.github.freshdesk:freshchat-android:5.0.0'
38+
implementation 'com.github.freshdesk:freshchat-android:5.0.1'
3939
}
4040

4141

android/src/main/java/com/freshchat/consumer/sdk/flutter/FreshchatSdkPlugin.java

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,20 @@ public void onResult(FreshchatCallbackStatus status, int count) {
273273
Freshchat.getInstance(context).getUnreadCountAsync(unreadCountCallback);
274274
}
275275

276+
public void getUnreadCountAsyncForTags(MethodCall call, final Result result) {
277+
List<String> tags = call.argument("tags");
278+
UnreadCountCallback unreadCountCallback = new UnreadCountCallback() {
279+
@Override
280+
public void onResult(FreshchatCallbackStatus status, int count) {
281+
Map unreadCountStatus = new HashMap<>();
282+
unreadCountStatus.put("count", count);
283+
unreadCountStatus.put("status", status.name());
284+
result.success(unreadCountStatus);
285+
}
286+
};
287+
Freshchat.getInstance(context).getUnreadCountAsync(unreadCountCallback, tags);
288+
}
289+
276290
public void showConversationsWithOptions(MethodCall call) {
277291
try {
278292
List<String> tags = call.argument("tags");
@@ -467,13 +481,13 @@ public void openFreshchatDeeplink(MethodCall call) {
467481
Freshchat.openFreshchatDeeplink(context, link);
468482
}
469483

470-
public void linkifyWithPattern(MethodCall call){
484+
public void linkifyWithPattern(MethodCall call) {
471485
String regex = call.argument("regex");
472486
String defaultScheme = call.argument("defaultScheme");
473-
Freshchat.getInstance(context).linkifyWithPattern(regex,defaultScheme);
487+
Freshchat.getInstance(context).linkifyWithPattern(regex, defaultScheme);
474488
}
475489

476-
public void notifyAppLocaleChange(){
490+
public void notifyAppLocaleChange() {
477491
Freshchat.notifyAppLocaleChange(context);
478492
}
479493

@@ -536,6 +550,10 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
536550
getUnreadCountAsync(result);
537551
break;
538552

553+
case "getUnreadCountAsyncForTags":
554+
getUnreadCountAsyncForTags(call, result);
555+
break;
556+
539557
case "showConversationsWithOptions":
540558
showConversationsWithOptions(call);
541559
break;

ios/Classes/FreshchatSdkPlugin.m

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,23 @@ -(void)getUnreadCountAsync:(FlutterResult) result{
217217
}];
218218
}
219219

220+
-(void)getUnreadCountAsyncForTags:(FlutterMethodCall*)call result:(FlutterResult) result{
221+
NSArray *tags = call.arguments[@"tags"];
222+
[[Freshchat sharedInstance] unreadCountForTags:tags withCompletion:^(NSInteger unreadCount) {
223+
@try {
224+
NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
225+
[dic setValue:@"STATUS_SUCCESS" forKey:@"status"];
226+
[dic setValue:[NSNumber numberWithInteger:unreadCount] forKey:@"count"];
227+
result(dic);
228+
} @catch (NSException *exception) {
229+
NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
230+
[dic setValue:@"STATUS_ERROR" forKey:@"status"];
231+
[dic setValue:[NSNumber numberWithInteger:unreadCount] forKey:@"count"];
232+
result(dic);
233+
}
234+
}];
235+
}
236+
220237
-(void)setUserWithIdToken:(FlutterMethodCall *) call{
221238
@try {
222239
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
@@ -423,6 +440,8 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
423440
[instance sendMessage:call];
424441
}else if([@"getUnreadCountAsync" isEqualToString:call.method]){
425442
[instance getUnreadCountAsync:result];
443+
}else if([@"getUnreadCountAsyncForTags" isEqualToString:call.method]){
444+
[instance getUnreadCountAsyncForTags:call result:result];
426445
}else if([@"setUserWithIdToken" isEqualToString:call.method]){
427446
[instance setUserWithIdToken:call];
428447
}else if([@"restoreUserWithIdToken" isEqualToString:call.method]){

ios/freshchat_sdk.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ A new flutter plugin project.
1717
s.public_header_files = 'Classes/**/*.h'
1818
s.dependency 'Flutter'
1919
s.platform = :ios
20-
s.dependency "FreshchatSDK", '5.0.1'
20+
s.dependency "FreshchatSDK", '5.0.2'
2121

2222
# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
2323
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }

lib/freshchat_sdk.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ class Freshchat {
224224
final String sdkVersion = await _channel.invokeMethod('getSdkVersion');
225225
final String operatingSystem = Platform.operatingSystem;
226226
// As there is no simple way to get current freshchat flutter sdk version, we are hardcoding here.
227-
final String allSdkVersion = "flutter-0.9.2-$operatingSystem-$sdkVersion ";
227+
final String allSdkVersion = "flutter-0.9.3-$operatingSystem-$sdkVersion ";
228228
return allSdkVersion;
229229
}
230230

@@ -277,6 +277,13 @@ class Freshchat {
277277
return unreadCountStatus;
278278
}
279279

280+
/// Retrieve a count of unread messages for channels with tags.
281+
static Future<Map> getUnreadCountAsyncForTags(List<String> tags) async {
282+
final Map unreadCountStatus = await _channel.invokeMethod(
283+
'getUnreadCountAsyncForTags', <String, List<String>>{'tags': tags});
284+
return unreadCountStatus;
285+
}
286+
280287
/// Displays list of Support Channels (Channel List Activity) through which users can converse with you
281288
static void showConversations(
282289
{String? filteredViewTitle, List<String>? tags}) async {

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Freshchat is a modern messaging software for sales and customer eng
33
repository: https://github.com/freshworks/freshchat-flutter-sdk
44

55
# Whenever this version is updated, it must also be updated in Freshchat::getSdkVersion()
6-
version: 0.9.2
6+
version: 0.9.3
77
homepage: https://freshchat.com
88

99
environment:

0 commit comments

Comments
 (0)