GithubHelp home page GithubHelp logo

zoho / salesiq-mobilisten-reactnative Goto Github PK

View Code? Open in Web Editor NEW
9.0 14.0 11.0 53.78 MB

Your mobile app's ideal live chat partner. Power up your mobile App with the SalesIQ Mobilisten SDK for React-Native.

Home Page: https://mobilisten.io/

Java 10.48% JavaScript 3.30% Objective-C 19.68% Ruby 0.51% TypeScript 5.86% Kotlin 0.36% Objective-C++ 14.60% C++ 45.21%
sdk react-native livechat mobilisten sdk-react-native salesiq-mobilisten-react-native chat-sdk chat-bot support-library chat-sdk-js

salesiq-mobilisten-reactnative's Introduction

SupportedLanguages Version Mobilisten NPM CD

React Native module for SalesIQ Mobilisten SDK

Connect with customers at every step of their journey. Give them the best in-app live chat experience with Mobilisten. Mobilisten enables customers to reach you from any screen on your app, get their questions answered, and make better purchase decisions.

Getting Started

Mobilisten is a support chat SDK that comes with a set of highly configurable APIs to suit your needs. Get started by generating an App and Access keys for your bundle ID from the SalesIQ console.

Requirements

iOS: Minimum deployment target should be set to iOS 12.

Android: Android API level 21 or above is required.

Installation

Follow the below steps given below to complete installation of Mobilisten in your React-Native app.

  1. Install the react-native-zohosalesiq-mobilisten package using NPM.
npm install react-native-zohosalesiq-mobilisten --save
  1. Link the module with the react native app
react-native link react-native-zohosalesiq-mobilisten

Installation steps for iOS

  1. Navigate to the ios folder in the project directory and open Podfile. Add the "/ios" to the path for the RNZohoSalesIQ pod as shown below.
- pod 'RNZohoSalesIQ', :path => '../node_modules/react-native-zohosalesiq-mobilisten'
+ pod 'RNZohoSalesIQ', :path => '../node_modules/react-native-zohosalesiq-mobilisten/ios'
  1. Run the pod repo update && pod install command from the ios directory.

Installation steps for Android

  1. If you're using React Native v0.60 or above, the dependency will be linked automatically without any steps being taken.

Android: Auto linking with React Native v0.59 and below

$ react-native link react-native-zohosalesiq-mobilisten

Android: Manual linking with React Native v0.59 and below

  • Add the below code to the android/settings.gradle
include ':react-native-zohosalesiq-mobilisten'
project(':react-native-zohosalesiq-mobilisten').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-zohosalesiq-mobilisten/android')
  • Implement the dependency in the android/app/build.gradle file inside dependencies
implementation project(':react-native-zohosalesiq-mobilisten')
  • Add the below snippet to android/app/src/main/java/com/module_name/MainApplication.java if the packages were not auto-generated.
private final ReactNativeHost mReactNativeHost=new ReactNativeHost(this){
// ...
@Override
protected List<ReactPackage> getPackages(){
        // Add new RNZohoSalesIQPackage() into the React packages list like below
        return new ArrayList<>(Arrays.<ReactPackage>asList(new RNZohoSalesIQPackage()));
        }
        // ...
        };

@Override
public ReactNativeHost getReactNativeHost(){
        return mReactNativeHost;
        }
  1. Navigate to the android folder within the project directory using Android Studio or any other platform of choice for Android development. Add the following maven repository to the build.gradle file.
allprojects {
      repositories {
        // ...
          maven { url 'https://maven.zohodl.com' }
      }
}
  1. Click Sync Now from the toolbar on the IDE.

Initializing Mobilisten

  1. Generate App and Access keys for iOS and Android platforms by providing your bundle id.
  2. Use the ZohoSalesIQ.initWithCallback API with keys for each platform as shown below.
import { ZohoSalesIQ } from 'react-native-zohosalesiq-mobilisten';

let appKey;
let accessKey;

if (Platform.OS === 'ios') {
    appKey = "ios_app_key";
    accessKey = "ios_access_key";
} else {
    appKey = "android_app_key";
    accessKey = "android_access_key";
}

ZohoSalesIQ.initWithCallback(appKey, accessKey, success => {
    // Your code
});
  1. If you want to show the default chat launcher, use the ZohoSalesIQ.Launcher.show() API (Optional).

API Documentation

You can find the list of all APIs and their documentation here under the API Reference section.

salesiq-mobilisten-reactnative's People

Contributors

anbarasu-v avatar anbarasu109 avatar angu-g avatar cloudnotify avatar rishabh-raghunath avatar rishabhraghunath avatar sivasankarpr avatar valliammai-sv avatar yeskay-zohocorp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

salesiq-mobilisten-reactnative's Issues

Crashlytics issues (ZohoLiveChat.java line 301, LiveChatUtil.java line 181)

"react-native-zohosalesiq-mobilisten": "^1.3.5"

ZohoLiveChat.java line 301
Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'android.content.SharedPreferences$Editor android.content.SharedPreferences.edit()' on a null object reference
at com.zoho.livechat.android.ZohoLiveChat$Chat.setVisibility(ZohoLiveChat.java:301)
at com.reactlibrary.RNZohoSalesIQ$40.run(RNZohoSalesIQ.java:742)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7710)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

LiveChatUtil.java line 181
Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String android.content.SharedPreferences.getString(java.lang.String, java.lang.String)' on a null object reference
at com.zoho.livechat.android.utils.LiveChatUtil.getCVUID(LiveChatUtil.java:181)
at com.zoho.livechat.android.utils.LiveChatUtil.setCVUID(LiveChatUtil.java:186)
at com.zoho.livechat.android.ZohoLiveChat.registerVisitor(ZohoLiveChat.java:1081)
at com.reactlibrary.RNZohoSalesIQ$33.run(RNZohoSalesIQ.java:655)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5938)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)

Android crash v.4.2.2 .registerVisitor

Environment

  • react-native-zohosalesiq-mobilisten 4.2.2
  • com.zoho.salesiq:mobilisten:4.2.1
  • observed on Android from 8 to 11, devices from multiple vendors
  • issue noticed in Crashlytics, no known reproduction steps

Stack trace

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String android.content.SharedPreferences.getString(java.lang.String, java.lang.String)' on a null object reference
       at com.zoho.livechat.android.utils.LiveChatUtil.getCVUID(SourceFile:211)
       at com.zoho.livechat.android.utils.LiveChatUtil.setCVUID(SourceFile:216)
       at com.zoho.livechat.android.ZohoLiveChat.registerVisitor(SourceFile:1265)
       at com.zohosalesiq.reactlibrary.RNZohoSalesIQ$34.run(SourceFile:696)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:246)
       at android.app.ActivityThread.main(ActivityThread.java:8633)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

Android notification not pushing when the app on the background.

Hi,

Few month ago I config and setup everything for SaleIQ and it's working.
Recently I saw the notification for android device no longer popup when I closed the app totally. It;s only working when I open my App and leave it. (IOS still works fine).

My notification from mainly function still works fine when I closed the app on the background. Only saleIQ is not.

I double checked all settings from url: https://www.zoho.com/salesiq/help/developer-guides/android-mobile-sdk-installation-2.0.html and I don't see any facing problem of that.

Screen Shot 2022-08-25 at 17 36 08

Any hints that I can make it working again?

got error on production environment "Attempt to invoke interface method 'boolean android.content.SharedPreferences.getBoolean(java.lang.String, boolean)' on a null object reference"

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{care.zoop.bewell/com.zoho.livechat.android.ui.activities.ChatActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.content.SharedPreferences.getBoolean(java.lang.String, boolean)' on a null object reference
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3827)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4003)
       at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
       at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2317)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:246)
       at android.app.ActivityThread.main(ActivityThread.java:8595)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

We got ‘we missed your chat request’

We can able to put one message and then we got 'we missed your chat request' and there is no text input anymore.
The problem occurs on iOS.
We call after initWithCallback() call.

image

Use of deprecated UIWebView in iOS

When uploading a project to Apple with this component, this warning is returned:

ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of new apps that use UIWebView APIs starting from April 2020. See https://developer.apple.com/documentation/uikit/uiwebview for more information.

After you’ve corrected the issues, you can upload a new binary to App Store Connect.

The use of UIWebView is deprecated and this project seems to be using it based on this search:
grep -r UIWebView node_modules/*

The problem is that it seems to be used in binary files, which there is no way of easily change. Is there any plan to update this? Otherwise every project using this will eventually face big problems.

More customization functionality needed.

I am using RN SDK for our Android app. Need some more customization functionality in SDK to make custom UI more consistent with App's UI, so adding a few pointers here with priorities so that you can check these things and prioritize your roadmap accordingly. And if any of these things are quick enough, I would request you to please provide that functionality sooner.

Version
"react-native-zohosalesiq-mobilisten": "4.2.10"

High Priority

  • To customize the background color of chat bubble for audio sent from Visitor side
  • To customize the background color of chat bubble for files sent from Visitor side
  • To customize the color of seekbar (amount played) for audio received from Operator side
    Refer to this screenshot for above 3 points

demo

Medium Priority

  • When the visitor receives a new msg from the operator and the visitor is not on active chat then a push notification is triggered. Functionality to customize that notification to add an app icon to make it consistent with the brand. And to add icon in floating notification as well that come on the app initially. Refer screenshots.

demo2

demo3

  • Sometimes on using search in the knowledgebase tab, if we search for some random name (I searched for raman my name) or category name, then the loader keeps on loading and doesn’t display empty search message. Please see, this can be a bug too. I can also share a screen recording if you need that.

Low Priority

  • Functionality to display article heading in the top navigation bar, empty navigation bar seems weird
  • Too much light and right padding/space in case of article.
    Refer screenshot

demo4

Bug: setThemeColorforiOS not working properly [fixed]

@Angu-G I want to report few bugs directly here:

`ZohoSalesIQ.setChatTitle("Support title");
ZohoSalesIQ.startChat("The invoice incorrectly");

// either ZohoSalesIQ.openChat();
ZohoSalesIQ.setConversationVisibility(true);`

  1. On react native, after I call the code above for set the title and the content, then after I end the chat, and I click Launcher button for make new conversation, it's always take old content "The invoice incorrectly" and the old title. How I can empty these content on new chat?

image

  1. I'm not found the customize background color for send button from the chat. I checked all page here but did not found https://www.zoho.com/salesiq/help/developer-section/android-mobile-sdk-theme-customization-chat-input.html

image

  1. Suggestion: For the React Native, it should be able to customize string and color directly, currently I must come to android/strings.xml and ios pod path for customize everything. Also for Android if should be have the function for set themeColor like from IOS, that we set the primary color only and everything on Chat should be change accordingly.

Visitor name not getting detected when it is added via RN SDK API

I am using RN SDK's API to set visitor name, email, phone number, etc.

Using like this:
ZohoSalesIQ.setVisitorName('Test user');

But when I initialize a chat, an operator bot asks for name and email, name is not getting auto-filled in the input box whereas for email it works fine.

And on the operator dashboard right side panel, name is shown as Visitor 89xxx means random allocated name and not the one I added via API, and the rest all user info is visible there as I entered.

Version
"react-native-zohosalesiq-mobilisten": "4.2.10"

Does not work React Native 0.62

System info

System:
OS: macOS 10.15.4
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 570.91 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 13.11.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.13.7 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 29
Build Tools: 29.0.3
Android NDK: Not Found
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6392135
Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild

Project info

react-native: 0.62

enabled:
image

pods installed according to 0.62 RN automatic-installation

Steps to reproduce

  1. npx react-native init somename
  2. yarn add react-native-zohosalesiq-mobilisten
  3. cd ios && pod install
  4. Yes - for embed swift
  5. yarn ios --device (--device because it does not build for simulators)

After these steps you can catch the error in xcode

dyld: Library not loaded: @rpath/Mobilisten.framework/Mobilisten
  Referenced from: /private/var/containers/Bundle/Application/02C28F75-CC97-4426-92C1-4F77CFC80AF3/BahamasEvac.app/BahamasEvac
  Reason: no suitable image found.  Did find:
	/private/var/containers/Bundle/Application/02C28F75-CC97-4426-92C1-4F77CFC80AF3/BahamasEvac.app/Frameworks/Mobilisten.framework/Mobilisten: code signature invalid for '/private/var/containers/Bundle/Application/02C28F75-CC97-4426-92C1-4F77CFC80AF3/BahamasEvac.app/Frameworks/Mobilisten.framework/Mobilisten'

	/private/var/containers/Bundle/Application/02C28F75-CC97-4426-92C1-4F77CFC80AF3/BahamasEvac.app/Frameworks/Mobilisten.framework/Mobilisten: code signature invalid for '/private/var/containers/Bundle/Application/02C28F75-CC97-4426-92C1-4F77CFC80AF3/BahamasEvac.app/Frameworks/Mobilisten.framework/Mobilisten'

	/private/var/containers/Bundle/Application/02C28F75-CC97-4426-92C1-4F77CFC80AF3/BahamasEvac.app/Frameworks/Mobilisten.framework/Mobilisten: stat() failed with errno=1
	/private/var/containers/Bundle/Application/02C28F75-CC97-4426-92C1-4F77CFC80AF3/BahamasEvac.app/Frameworks/Mobilisten.framework/Mobilisten: code signature invalid for '/private/var/containers/Bundle/Application/02C28F75-CC97-4426-92C1-4F77CFC80AF3/BahamasEvac.app/Frameworks/Mobilisten.framework/Mobilisten'

	/private/var/containers/Bundle/Application/02C28F75-CC97-4426-92C1-4F77CFC80AF3/BahamasEvac.app/Frameworks/Mobilisten.framework/Mobilisten: stat() failed with errno=1
(lldb) 

Message not sending

after sending a message it's says sending for long time and not able to send ,also when opening a message it's loading and no action

Directly open Knowledgebase tab instead of Conversations

I am using RN SDK for our Android app.

Version
"react-native-zohosalesiq-mobilisten": "4.2.10"

So wanted to know if there is a way out by which I can directly open the knowledgebase tab instead of conversations on click of a custom button from my App.

Any of these solutions work:

  • Opening knowledge base tab directly?
  • Reordering bottom tabs with knowledgebase first and then conversations

I am not able to find any such method in docs, can you please help me in knowing if this is possible?

Thanks.

Invalid Resource error when initializing the SDK.

Hello There,

I have been using the SDK for a few months now. and it was working great. but suddenly I find that the sdk no longer opens. debugging further it seems initializing the sdk no longer works even though I double check the app key & access key. and I have a deployed version where the sdk works. After going through the logs I found this error. so I assume it's from the backend but I can't figure out exactly what to change since I am just initializing the app nothing more.

❌ MOBILISTEN » INIT FAILED: CODE: 1019 MESSAGE: Invalid Resource

Thanks

ZohoSalesIQ.setThemeColorforiOS not updating the colour of SalesIQ chat launcher

Hi we are using the package with an expo app, we use eas custom config under the hood for the integration to work. We are using the latest version 4.2.10. Other functions work such as setChatTitle and initWithCallback.

I have attempted deleting and re-installing the app but I have not been able to alter the colour. I hope I am making a silly error.

Thanks

Could not resolve dependency while installing

I'm installing with the command:
npm install react-native-zohosalesiq-mobilisten --save

And npm gives me the error:

npm ERR! Could not resolve dependency:
npm ERR! peer react-native @ "^ 0.41.2" from [email protected]
npm ERR! node_modules / react-native-zohosalesiq-mobilisten
npm ERR! react-native-zohosalesiq-mobilisten @ "*" from the root project

Can someone guide me to install the library
Greetings,
Antonio

Got error "DeviceConfig.java line 678" on Firebase Crashlytics

Fatal Exception: java.lang.RuntimeException
Unable to start activity ComponentInfo{care.zoop.bewell/com.zoho.livechat.android.ui.activities.ChatActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.app.Application com.zoho.livechat.android.operation.SalesIQApplicationManager.getApplication()' on a null object reference

error

Sometime, ZohoSalesIQ.setLauncherVisibility(false) is not working

When play a while with open the chat and close multiple time, I saw this strange behaviour. I added an event with

ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_CHAT_CLOSED, () => {
console.log('chat closed');
        ZohoSalesIQ.setLauncherVisibility(false);
      });

and trigger when I closed the chat, the function is triggered with ZohoSalesIQ.setLauncherVisibility(false); , but the launcher still display.

But when I add the button with onclick() => {ZohoSalesIQ.setLauncherVisibility(false)} then it working.

I am using "react-native": "^0.67.2" and "react": "^17.0.2".
Many thanks

Android crash v 4.2.2 .isFormEnabled

Environment

  • react-native-zohosalesiq-mobilisten 4.2.2
  • com.zoho.salesiq:mobilisten:4.2.1
  • Android 11, Galaxy Note20 5G
    issue noticed once in Crashlytics, no known reproduction steps

Stack trace

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bossrevolution.money.production/com.zoho.livechat.android.ui.activities.ChatActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.content.SharedPreferences.getBoolean(java.lang.String, boolean)' on a null object reference
   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3835)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4011)
   at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
   at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
   at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2325)
   at android.os.Handler.dispatchMessage(Handler.java:106)
   at android.os.Looper.loop(Looper.java:246)
   at android.app.ActivityThread.main(ActivityThread.java:8633)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
Caused by java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.content.SharedPreferences.getBoolean(java.lang.String, boolean)' on a null object reference
   at com.zoho.livechat.android.utils.LiveChatUtil.isFormEnabled(SourceFile:3283)
   at com.zoho.livechat.android.ui.activities.ChatActivity.initChat(SourceFile:160)
   at com.zoho.livechat.android.ui.activities.ChatActivity.onCreate(SourceFile:96)
   at android.app.Activity.performCreate(Activity.java:8207)
   at android.app.Activity.performCreate(Activity.java:8191)
   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3808)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4011)
   at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
   at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
   at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2325)
   at android.os.Handler.dispatchMessage(Handler.java:106)
   at android.os.Looper.loop(Looper.java:246)
   at android.app.ActivityThread.main(ActivityThread.java:8633)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

The package name is very generic com.reactlibrary

Please change to your package like "com.zohosalesiq.mobilisten", the library com.reactlibrary was conflict on my application. I cannot make it works due to the "com.reactlibrary" is already declared by another module on "node_modules"

Could not find method compile()

Hello, i have an issue when i run my app
image
I'm ussing OpenJDK11 and gradle 7.3.3

If someone could fix it, I would appreciate if can tell me how

Query: Build errors on simulator (Xcode 11.7)

Hi,

I am having build errors in iOS in xcode 11.7 . I have tried solving them , solutions given by your team but all in vain .

I have attached screenshot of errors . Please solve this ASAP

Thanks
Screen Shot 2021-04-07 at 4 35 50 PM

StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation Warning on Google pre-launch report

Hello,

I am publishing my application to Google Console, before of that we're passing our application to Google pre-launch report, and we faced new warning: StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Ljava/net/Socket;->impl:Ljava/net/SocketImpl;

Details:

StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Ljava/net/Socket;->impl:Ljava/net/SocketImpl;
	at android.os.StrictMode.lambda$static$1(StrictMode.java:407)
	at android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
	at java.lang.Class.getDeclaredField(Native Method)
	at com.google.android.gms.org.conscrypt.Platform.getFileDescriptor(:com.google.android.gms@[email protected] (100400-395708125):1)
	at com.google.android.gms.org.conscrypt.ConscryptFileDescriptorSocket$SSLInputStream.read(:com.google.android.gms@[email protected] (100400-395708125):6)
	at com.android.okhttp.okio.Okio$2.read(Okio.java:145)
	at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:213)
	at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:317)
	at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:311)
	at com.android.okhttp.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:207)
	at com.android.okhttp.internal.http.Http1xStream.readResponse(Http1xStream.java:395)
	at com.android.okhttp.internal.http.Http1xStream.readResponseHeaders(Http1xStream.java:146)
	at com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:900)
	at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:772)
	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:493)
	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:429)
	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:560)
	at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:106)
	at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:30)
	at com.zoho.livechat.android.api.GetAndroidChannel.run(GetAndroidChannel.java:50)

I're currently using Android SDK 30.0.2. Do you know how to resolve it, Is new version available? I currently use react-native-zohosalesiq-mobilisten": "^4.0.1".

Regards,
Diep

Feature request: Display conversation on the page/screen

Hello again,

Thanks for the previous great support, I want to customize more flexible on our application, I will make the single page as a support live chat and it should be display the conversation/dashboard instead of showing the Launcher everywhere. Like the image below

image

Is there any function for that, ZohoSalesIQ.openChat(); and ZohoSalesIQ.setLauncherVisibility(); not helpful,

Thank you.

Remote notification registration on iOS (Notifee plugin)

SalesIQ blocks notifee to show notifications. If I remove all SalesIQ code in AppDelegate.m the application works well

Here is the code


#import "AppDelegate.h"

#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import "RNBootSplash.h" // react native bootsplash
#import <Firebase.h> // react native firebase
#import <React/RCTLinkingManager.h> // react native auth0
#import <AppCenterReactNative.h> // appcenter
#import <AppCenterReactNativeAnalytics.h> // appcenter
#import <AppCenterReactNativeCrashes.h> // appcenter
#import <AppCenterReactNative.h> // appcenter
#import <CodePush/CodePush.h> // codepush
#import "Bewell-Swift.h"
#import "RNFBMessagingModule.h"

#ifdef FB_SONARKIT_ENABLED
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>

static void InitializeFlipper(UIApplication *application) {
  FlipperClient *client = [FlipperClient sharedClient];
  SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
  [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
  [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
  [client addPlugin:[FlipperKitReactPlugin new]];
  [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
  [client start];
}
#endif

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
#ifdef FB_SONARKIT_ENABLED
  InitializeFlipper(application);
#endif
  if ([FIRApp defaultApp] == nil) { // rn firebase
      [FIRApp configure];
    }
  [AppCenterReactNative register]; // appcenter
  [AppCenterReactNativeAnalytics registerWithInitiallyEnabled:true]; // appcenter
  [AppCenterReactNativeCrashes registerWithAutomaticProcessing]; // appcenter

  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];

  // NSDictionary *appProperties = [RNFBMessagingModule addCustomPropsToUserProps:nil withLaunchOptions:launchOptions];
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                   moduleName:@"Bewell"
                                            initialProperties:nil];

  if (@available(iOS 13.0, *)) {
      rootView.backgroundColor = [UIColor systemBackgroundColor];
  } else {
      rootView.backgroundColor = [UIColor whiteColor];
  }

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [UIViewController new];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];
  
  [RNBootSplash initWithStoryboard:@"BootSplash" rootView:rootView]; // <- initialization using the storyboard file name
  LaunchScreen *t = [LaunchScreen new];
  UIView *animationView = [t createAnimationViewWithRootView:rootView lottieName:@"launch_screen_animation"];
  [rootView addSubview:animationView];
  [t playWithAnimationView:animationView];

  //Sales IQ Push notification
  if (@available(iOS 10.0, *)) {
        //  UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
        //  [center requestAuthorizationWithOptions:(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge) completionHandler:^(BOOL granted, NSError * _Nullable error) {
        //    center.delegate = self;
        //    if (granted){
        //     //  dispatch_async(dispatch_get_main_queue(), ^{
        //       // UNNotificationCategoryOptions categoryOptions = UNNotificationCategoryOptionNone;
        //       // UNTextInputNotificationAction *reply = [UNTextInputNotificationAction actionWithIdentifier:@"Reply" title:@"Reply" options:@[] textInputButtonTitle:@"Send" textInputPlaceholder:@"Message"];
        //       // UNNotificationCategory *chatGrpMsgCategory_10 = [UNNotificationCategory categoryWithIdentifier:@"GRPCHATMSG" actions:@[reply] intentIdentifiers:@[] options:categoryOptions];
        //       // [[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:[NSSet setWithObjects:chatGrpMsgCategory_10,chatGrpMsgCategory_10, nil]];
        //       // [application registerForRemoteNotifications];
        //     //  });
        //    }
        //  }];
    }
    else{
         UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound) categories:nil];
         [application registerUserNotificationSettings:settings];
    }
    if(launchOptions[@"UIApplicationLaunchOptionsRemoteNotificationKey"] != nil){
      NSDictionary *notificationData = launchOptions[@"UIApplicationLaunchOptionsRemoteNotificationKey"];
      if(notificationData != nil){
        [RNZohoSalesIQ processNotificationWithInfo:notificationData];
      }
    }
  return YES;
}


// - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
//   const char *data = [deviceToken bytes];
//   NSMutableString *token = [NSMutableString string];
//   for (NSUInteger i = 0; i < [deviceToken length]; i++) {
//     [token appendFormat:@"%02.2hhX", data[i]];
//   }
  
//   NSLog(@"----------didRegisterForRemoteNotificationsWithDeviceToken:%@",token);
//   #ifdef DEBUG
//     [RNZohoSalesIQ enablePush:token isTestDevice:YES isProductionMode:NO];
//   #else
//     [RNZohoSalesIQ enablePush:token isTestDevice:NO isProductionMode:YES];
//   #endif
// }

// - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler: (void (^)(UIBackgroundFetchResult))completionHandler {

//   if (application.applicationState == UIApplicationStateInactive) {

//     NSLog(@"----------Inactive - the user has tapped in the notification when app was closed or in background, %@",userInfo);
//     // do some tasks
//     [RNZohoSalesIQ processNotificationWithInfo:userInfo];
//     completionHandler(UIBackgroundFetchResultNewData);
//   } else if (application.applicationState == UIApplicationStateBackground) {

//     NSLog(@"------------application Background - notification has arrived when app was in background");
//     NSString *contentAvailable = [NSString
//         stringWithFormat:@"%@", [[userInfo valueForKey:@"aps"]
//                                     valueForKey:@"content-available"]];

//     if ([contentAvailable isEqualToString:@"1"]) {
//       // do tasks
//       [RNZohoSalesIQ processNotificationWithInfo:userInfo];
//       NSLog(@"-----------content-available is equal to 1");
//       completionHandler(UIBackgroundFetchResultNewData);
//     }
//   } else {
//     NSLog(@"-----------application Active - notication has arrived while app was opened");
//     // Show an in-app banner
//     // do tasks
//     [RNZohoSalesIQ processNotificationWithInfo:userInfo];
//     completionHandler(UIBackgroundFetchResultNewData);
//   }
// }

// - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
//   NSLog(@"-----------didReceiveLocalNotification");
//   [RNZohoSalesIQ processNotificationWithInfo:notification.userInfo];
// }

// - (void)didReceiveNotificationResponse:(UNNotificationResponse *)response {
//   NSLog(@"-----------didReceiveNotificationResponse");
//   if (@available(iOS 10.0, *)) {
//     NSLog(@"--------------------ios 10.0");
//     if ([RNZohoSalesIQ isMobilistenNotification:response.notification.request.content.userInfo]) {
//       NSLog(@"-----------------------------------isMobilistenNotification");
//       NSLog(@"-----------------------------------actionIdentifier:%@",response.actionIdentifier);
//        if ([response.actionIdentifier isEqualToString: @"Reply"]) {
//            [RNZohoSalesIQ handleNotificationAction:response.notification.request.content.userInfo response:((UNTextInputNotificationResponse *)response).userText];
//        }
//       else if([response.actionIdentifier isEqualToString: UNNotificationDefaultActionIdentifier]){
//            [RNZohoSalesIQ processNotificationWithInfo:response.notification.request.content.userInfo];
//       }
//     }
//   }
// }

// - (void)userNotificationCenter:(UNUserNotificationCenter *)center
//        willPresentNotification:(UNNotification *)notification
//          withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler{
//   [RNZohoSalesIQ processNotificationWithInfo:notification.request.content.userInfo];
// }

#ifdef __IPHONE_8_0
- (void)application:(UIApplication *)application
    didRegisterUserNotificationSettings:
        (UIUserNotificationSettings *)notificationSettings {
  // register to receive notifications
  [application registerForRemoteNotifications];
}

- (void)application:(UIApplication *)application
    handleActionWithIdentifier:(NSString *)identifier
         forRemoteNotification:(NSDictionary *)userInfo
             completionHandler:(void (^)())completionHandler {
  // handle the actions
  if ([identifier isEqualToString:@"declineAction"]) {
  } else if ([identifier isEqualToString:@"answerAction"]) {
  }
}
#endif


- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
  return [CodePush bundleURL];
#endif
}

// Auth0 signin open url
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url
            options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options
{
  return [RCTLinkingManager application:app openURL:url options:options];
}

@end

java.lang.NullPointerException

Hello Zoho team,
We are getting the below error stack trace via Firebase Crashlytics:

Non-fatal Exception: io.invertase.firebase.crashlytics.JavaScriptError: java.lang.NullPointerException: Attempt to invoke interface method 'android.content.SharedPreferences$Editor android.content.SharedPreferences.edit()' on a null object reference
	at com.zoho.salesiqembed.ZohoSalesIQ.syncThemeWithOS(ZohoSalesIQ.java:372)
	at com.reactlibrary.RNZohoSalesIQ$53.run(RNZohoSalesIQ.java:932)
	at android.os.Handler.handleCallback(Handler.java:938)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:257)
	at android.app.ActivityThread.main(ActivityThread.java:8183)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:626)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1015)

       at .<unknown>(com.zoho.salesiqembed.ZohoSalesIQ.syncThemeWithOSZohoSalesIQ.java:372:0)
       at .<unknown>(com.reactlibrary.RNZohoSalesIQ$53.runRNZohoSalesIQ.java:932:0)
       at .<unknown>(android.os.Handler.handleCallbackHandler.java:938:0)
       at .<unknown>(android.os.Handler.dispatchMessageHandler.java:99:0)
       at .<unknown>(android.os.Looper.loopLooper.java:257:0)
       at .<unknown>(android.app.ActivityThread.mainActivityThread.java:8183:0)
       at .<unknown>(com.android.internal.os.RuntimeInit$MethodAndArgsCaller.runRuntimeInit.java:626:0)
       at .<unknown>(com.android.internal.os.ZygoteInit.mainZygoteInit.java:1015:0)
       at .<unknown>(395.js:1:1453)
       at .c.value(28.js:1:3977)
       at .<unknown>(28.js:1:1147)
       at .c.value(28.js:1:2938)
       at .c.value(28.js:1:1126)

environment info

       OS - Android 11
       Device  - V2052
       React Native version - 0.61.5
       react-native-zohosalesiq-mobilisten version - 2.0.0

Looking forward to suggestions and next steps to pinpoint and fix the issue
Thank you

Unknown receiver 'ZohoSalesIQ'; did you mean 'RNZohoSalesIQ'?

Hey there.
I did all the steps described in the Readme.md and stucked with error: Unknown receiver 'ZohoSalesIQ'; did you mean 'RNZohoSalesIQ'?
in ..../node_modules/react-native-zohosalesiq-mobilisten/ios/RNZohoSalesIQ.m:18:10:

My system information:
MacBook Pro (13-inch, Early 2011)
Mac OS High Sierra 10.13.6
XCode 10.1

It there any chance to run it on my XCode 10.1 cause I haven't ability to upgrade it to 10.3?
Thank you in advance.

IOS push notification configuration issue

Today I got new issue for config the ZhoSalesIQ on the IOS for react native with Objective-C. Specifically it not found the function enablePush .

image

At the top, I imported already #import <Mobilisten/Mobilisten.h>

The documentation for React Native for IOS missing much information, please improve it.

[react-native][Android] App crashes on launch due to 'Attempt to invoke virtual method...'

in iOS its working fine but in android its throwing the below error on app launch.

Reason
java.lang.NullPointerException: Attempt to invoke virtual method 'android.graphics.drawable.Drawable com.zoho.commons.LauncherProperties.getIcon()' on a null object reference

Stacktrace

FATAL EXCEPTION: main
Process: com.careerlabs, PID: 23555
java.lang.NullPointerException: Attempt to invoke virtual method 'android.graphics.drawable.Drawable com.zoho.commons.LauncherProperties.getIcon()' on a null object reference
at com.zoho.livechat.android.operation.SalesIQApplicationManager$7$1.run(SalesIQApplicationManager.java:984)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

"react-native": "^0.64.0",

ZohoSalesIQ.initWithCallback not working in Android

var appKey;
var accessKey;

if (Platform.OS === 'ios') {
appKey = "xxxxxxxxx";
accessKey = "xxxxxxxxxx";
} else {
appKey = "xxxxxxxxx";
accessKey = "xxxxxxxxxx";
}

ZohoSalesIQ.initWithCallback(appKey, accessKey, (success) => {
if (success) {

} else {
// your code to handle initialization failure
Alert.alert('Error','Zoho init failed')
}
});

I am able to see my zoho chat floating icon in IOS and all are working fine for my iOS.
But Android i am getting in to else part.

Chat doesnt seems to be initializing.

Alert.alert('Error','Zoho init failed')

enableScreenshotOption() not working on Android

I have integrated Zoho SaleIQ SDK and versioning information as per below:

dependencies {
    implementation 'com.facebook.react:react-native:+'
    implementation 'com.zoho.salesiq:mobilisten:2.3.2'
}

"react-native": "0.63.2",
"react-native-zohosalesiq-mobilisten": "^1.4.0",

ZohoSalesIQ.enableScreenshotOption();

When I choose "Take a screenshot" option, the app will close the chat window and I am not able to choose that option.

Shared desktop not works (only tested on IOS)

In salesiq there is an option in the chat window that allows a connected user to request a shared desktop.
When I run it, I see in the customer's chat that a message arrives because the list scrolls, but it doesn't show any text.
Do I need to run any ZohoSalesIQ function for it to work?

Thanks!
shared

Unsupported modules detected: Android

When I open Android Studio the message appears in my Event Log

Unsupported Modules Detected: Compilation is not supported for following modules: react-native-zohosalesiq-mobilisten. Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project

custom localization in chat module

Hi can we support custom localization (vietnamese) or just custom text in any language. right now my app really really need to have localize cause it only serve for our people. So it would be nice if there is anyway to custom texts especially in chat module

NullPointerException - getMsgid() on a null object reference

Hello,

I have the sdk install in my app and so far no problem.
However, I have a bug that starts reporting from my bug tracking platform (Sentry).
It happens when the chatbot asked my user for this address mail and he types it and sends it.
You can see the details below:
Capture d’écran 2022-02-25 à 17 09 51

Version details:

    "react": "17.0.2",
    "react-native": "0.65.2",
    "react-native-zohosalesiq-mobilisten": "4.2.6",

Thanks in advance for your help

AAPT error on RN 0.63

Hello. Faced the error when trying to build on new RN version (current 0.63).

It could be fixed by adding safeExtGet. I have changed:

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
}

with this

def safeExtGet(prop, fallback) {
  rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

android {
  compileSdkVersion safeExtGet('compileSdkVersion', 28)
  buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')

  defaultConfig {
    minSdkVersion safeExtGet('minSdkVersion', 16)
    targetSdkVersion safeExtGet('targetSdkVersion', 28)
    versionCode 1
    versionName "1.0"
  }

}

App crashing leading from java.lang.NullPointerException

Hi again,

We got new issue sometime on Android, here is detail

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{vn.myapp/com.zoho.livechat.android.ui.activities.ChatActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.content.SharedPreferences.getBoolean(java.lang.String, boolean)' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3654) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3806) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2267) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:237) at android.app.ActivityThread.main(ActivityThread.java:8167) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)

Device Info

Brand:samsung
Model:Galaxy Note9
Orientation: Portrait
RAM free: 2.77 GB
Disk free: 38.35 GB
Operating System
Version:Android 10
Orientation: Portrait
Rooted:No

It will be great if you found something from the log.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.