Skip to content

Commit

Permalink
Release v8.1.2
Browse files Browse the repository at this point in the history
Release v8.1.2
  • Loading branch information
yeskay-zohocorp committed Apr 16, 2024
1 parent 5bec999 commit c887171
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![SupportedLanguages](https://img.shields.io/badge/Platforms-iOS%20%7C%20%20Android-green.svg)](https://www.zoho.com/salesiq/help/developer-section/react-native-sdk-installation.html) [![Version](https://img.shields.io/badge/version-8.1.1-blue.svg)](https://mobilisten.io/) [![Mobilisten NPM CD](https://github.com/zoho/SalesIQ-Mobilisten-ReactNative/workflows/Mobilisten%20NPM%20CD/badge.svg)](https://github.com/zoho/SalesIQ-Mobilisten-ReactNative/actions)
[![SupportedLanguages](https://img.shields.io/badge/Platforms-iOS%20%7C%20%20Android-green.svg)](https://www.zoho.com/salesiq/help/developer-section/react-native-sdk-installation.html) [![Version](https://img.shields.io/badge/version-8.1.2-blue.svg)](https://mobilisten.io/) [![Mobilisten NPM CD](https://github.com/zoho/SalesIQ-Mobilisten-ReactNative/workflows/Mobilisten%20NPM%20CD/badge.svg)](https://github.com/zoho/SalesIQ-Mobilisten-ReactNative/actions)

# React Native module for SalesIQ Mobilisten SDK

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,17 @@
import com.zoho.livechat.android.constants.ConversationType;
import com.zoho.livechat.android.constants.SalesIQConstants;
import com.zoho.livechat.android.exception.InvalidEmailException;
import com.zoho.livechat.android.exception.InvalidVisitorIDException;
import com.zoho.livechat.android.listeners.ConversationListener;
import com.zoho.livechat.android.listeners.DepartmentListener;
import com.zoho.livechat.android.listeners.FAQCategoryListener;
import com.zoho.livechat.android.listeners.FAQListener;
import com.zoho.livechat.android.listeners.OperatorImageListener;
import com.zoho.livechat.android.listeners.RegisterListener;
import com.zoho.livechat.android.listeners.SalesIQActionListener;
import com.zoho.livechat.android.listeners.SalesIQChatListener;
import com.zoho.livechat.android.listeners.SalesIQCustomActionListener;
import com.zoho.livechat.android.listeners.SalesIQListener;
import com.zoho.livechat.android.listeners.UnRegisterListener;
import com.zoho.livechat.android.models.SalesIQArticle;
import com.zoho.livechat.android.models.SalesIQArticleCategory;
import com.zoho.livechat.android.modules.common.DataModule;
Expand Down Expand Up @@ -751,19 +752,35 @@ public void setFAQVisibility(final Boolean visible) {
}

@ReactMethod
public void registerVisitor(final String uniqueid) {
public void registerVisitor(final String uniqueid, final Callback callback) {
HANDLER.post(() -> {
try {
ZohoSalesIQ.registerVisitor(uniqueid);
} catch (InvalidVisitorIDException e) {
LiveChatUtil.log(e);
}
ZohoSalesIQ.registerVisitor(uniqueid, new RegisterListener() {
@Override
public void onSuccess() {
callback.invoke(null, Boolean.TRUE);
}

@Override
public void onFailure(int code, String message) {
callback.invoke(getErrorMap(code, message), Boolean.FALSE);
}
});
});
}

@ReactMethod
public void unregisterVisitor() {
HANDLER.post(() -> ZohoSalesIQ.unregisterVisitor(getCurrentActivity()));
public void unregisterVisitor(final Callback callback) {
HANDLER.post(() -> ZohoSalesIQ.unregisterVisitor(getCurrentActivity(), new UnRegisterListener() {
@Override
public void onSuccess() {
callback.invoke(null, Boolean.TRUE);
}

@Override
public void onFailure(int code, String message) {
callback.invoke(getErrorMap(code, message), Boolean.FALSE);
}
}));
}

@ReactMethod
Expand Down
8 changes: 4 additions & 4 deletions components/zohosalesiqJSWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ module.exports = {
fetchAttenderImage: function (atttenderId, fetchDefaultImage, callback) {
RNZohoSalesIQ.fetchAttenderImage(atttenderId, fetchDefaultImage, callback);
},
registerVisitor: function (visitorId) {
RNZohoSalesIQ.registerVisitor(visitorId);
registerVisitor: function (visitorId, callback) {
RNZohoSalesIQ.registerVisitor(visitorId, callback ? callback : () => {});
},
setThemeColorforAndroid: function (attribute, colorCode) {
RNZohoSalesIQ.setThemeColorforAndroid(attribute, colorCode);
Expand Down Expand Up @@ -205,8 +205,8 @@ module.exports = {
disableInAppNotification: function () {
RNZohoSalesIQ.disableInAppNotification();
},
unregisterVisitor: function () {
RNZohoSalesIQ.unregisterVisitor();
unregisterVisitor: function (callback) {
RNZohoSalesIQ.unregisterVisitor(callback ? callback : () => {});
},
setPageTitle: function (title) {
RNZohoSalesIQ.setPageTitle(title);
Expand Down
14 changes: 10 additions & 4 deletions ios/RNZohoSalesIQ.m
Original file line number Diff line number Diff line change
Expand Up @@ -1134,11 +1134,17 @@ + (void)handleNotificationAction: (NSDictionary *) info response:(NSString *) re
RCT_EXPORT_METHOD(startChat: (NSString *)message){
[[ZohoSalesIQ Chat] startChatWithQuestion:(message)];
}
RCT_EXPORT_METHOD(registerVisitor: (NSString *)uniqueid){
[ZohoSalesIQ registerVisitor:uniqueid completion:nil];
RCT_EXPORT_METHOD(registerVisitor: (NSString *)uniqueid callback:(RCTResponseSenderBlock)callback){
[ZohoSalesIQ registerVisitor:uniqueid completion:^(BOOL success) {
NSNumber *result = [NSNumber numberWithBool:success];
callback(@[[NSNull null], result]);
}];
}
RCT_EXPORT_METHOD(unregisterVisitor){
[ZohoSalesIQ unregisterVisitorWithCompletion:nil];
RCT_EXPORT_METHOD(unregisterVisitor: (RCTResponseSenderBlock)callback){
[ZohoSalesIQ unregisterVisitorWithCompletion:^(BOOL success) {
NSNumber *result = [NSNumber numberWithBool:success];
callback(@[[NSNull null], result]);
}];
}
RCT_EXPORT_METHOD(setPageTitle: (NSString *)pagetitle){
[[ZohoSalesIQ Tracking] setPageTitle:pagetitle];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-zohosalesiq-mobilisten",
"version": "8.1.1",
"version": "8.1.2",
"description": "A React Native module for the ZohoSalesIQ Mobilisten SDK",
"bugs": {
"email": "[email protected]"
Expand Down

0 comments on commit c887171

Please sign in to comment.