infobip / mobile-messaging-react-native-plugin

Mobile Messaging SDK plugin for React Native projects
24 stars 4 forks source link

Unable to connect to the chat. - TypeError: Cannot read property 'init' of null #38

Closed vokecodes closed 2 years ago

vokecodes commented 2 years ago

Unable to connect to the chat. I get this error on initialization.

 ERROR  TypeError: Cannot read property 'init' of null, js engine: hermes

 ERROR  TypeError: Cannot read property 'messageStorage' of undefined, js engine: hermes

Here's the function call

const openChat = () => {
        mobileMessaging.init(
            {
                applicationCode: infobipCode,
                inAppChatEnabled: true,
            },
            () => {
                console.log('MobileMessaging started');
                mobileMessaging.saveUser(
                    user,
                    (error) => {
                        errorHandler(error, 35);
                    }
                );
                mobileMessaging.showChat();
            },
            (error) => {
                errorHandler(error, 35);
                console.log('MobileMessaging error: ', error);

            },
        );
    };
kostap13 commented 2 years ago

Hi @vokecodes

Seems that there is no enough information. And I don't know why mobileMessaging is null.

How it was imported? Is it available (not null) after import? Here could be too much reasons for this case.

Best regards

vokecodes commented 2 years ago

Imported this way import { mobileMessaging } from 'infobip-mobile-messaging-react-native-plugin';

vokecodes commented 2 years ago

Here is the crash logs


java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.Context.getApplicationContext()' on a null object reference
03-11 23:48:18.662  9899  9999 E AndroidRuntime:    at androidx.localbroadcastmanager.content.LocalBroadcastManager.getInstance(SourceFile:107)
03-11 23:48:18.662  9899  9999 E AndroidRuntime:    at org.infobip.reactlibrary.mobilemessaging.ReactNativeMobileMessagingModule.registerBroadcastReceiver(SourceFile:386)
03-11 23:48:18.662  9899  9999 E AndroidRuntime:    at org.infobip.reactlibrary.mobilemessaging.ReactNativeMobileMessagingModule.initialize(SourceFile:74)
03-11 23:48:18.662  9899  9999 E AndroidRuntime:    at com.facebook.react.bridge.ModuleHolder.doInitialize(SourceFile:236)
03-11 23:48:18.662  9899  9999 E AndroidRuntime:    at com.facebook.react.bridge.ModuleHolder.markInitializable(SourceFile:100)
03-11 23:48:18.662  9899  9999 E AndroidRuntime:    at com.facebook.react.bridge.NativeModuleRegistry.notifyJSInstanceInitialized(SourceFile:103)
03-11 23:48:18.662  9899  9999 E AndroidRuntime:    at com.facebook.react.bridge.CatalystInstanceImpl$2.run(SourceFile:438)
03-11 23:48:18.662  9899  9999 E AndroidRuntime:    at android.os.Handler.handleCallback(Handler.java:883)
03-11 23:48:18.662  9899  9999 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:100)
03-11 23:48:18.662  9899  9999 E AndroidRuntime:    at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(SourceFile:27)
03-11 23:48:18.662  9899  9999 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:264)
03-11 23:48:18.662  9899  9999 E AndroidRuntime:    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(SourceFile:226)
03-11 23:48:18.662  9899  9999 E AndroidRuntime:    at java.lang.Thread.run(Thread.java:9
```19)
riskpp commented 2 years ago

He @vokecodes as I see in provided code snippet, you are initializing mobileMessaging every time when you need to open chat. Best approach is to initialize mobileMessaging once, when application started, then call mobileMessaging.showChat(); when you need to open chat. Could you please explain when/how are you calling openChat? We've tried to implement example application with your code-snippet and it's also working well. react-native 0.66.3, mobile-messaging plugin - 5.0.1, Android API version - 29/30

App.js

import React from 'react';
import {
  View,
} from 'react-native';

import {
  Colors,
} from 'react-native/Libraries/NewAppScreen';

import {
  mobileMessaging,
} from 'infobip-mobile-messaging-react-native-plugin';

const openChat = () => {
  mobileMessaging.init(
      {
        applicationCode: appCode,
        inAppChatEnabled: true,
      },
      () => {
        console.log('MobileMessaging started');
        mobileMessaging.showChat();
      },
      (error) => {
        console.log('MobileMessaging error: ', error);

      },
  );
};

export default class App extends React.Component {

  constructor() {
    super();
    openChat();
  }

  render() {
    return (
        <View
                style={{
                  backgroundColor:  Colors.black,
                }}>
        </View>
    );
  }
}
vokecodes commented 2 years ago

I will change the initialization implementation, thanks.

I call the openChat function on the click of a button.

vokecodes commented 2 years ago

I just finished the react-native upgrade and when I install the plugin. I got this error below in VS Code

module "/Users/voke/Documents/wen/node_modules/infobip-mobile-messaging-react-native-plugin/index"
Could not find a declaration file for module 'infobip-mobile-messaging-react-native-plugin'. '/Users/voke/Documents/wen/node_modules/infobip-mobile-messaging-react-native-plugin/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/infobip-mobile-messaging-react-native-plugin` if it exists or add a new declaration (.d.ts) file containing `declare module 'infobip-mobile-messaging-react-native-plugin';`ts(7016)
riskpp commented 2 years ago

Hi @vokecodes, looks like you are trying to use type script, unfortunately it's not supported in the plugin yet. But we have it on the feature list.

vokecodes commented 2 years ago

Hi @riskpp, not sure why it's looking for TypeScript. I've been able to have the chat display but it keeps loading displaying an unending activity indicator.

const openChat = () => {
        mobileMessaging.saveUser(
            user,
            (user) => {
                console.log('dkdk', user);
            },
            (error) => {
                console.log('errf', error);
                errorHandler(error, 35);
            }
        );
        mobileMessaging.showChat();
    };

The error I got for saveUser

Error undefined
 LOG  {"description": "There is no valid registration"}
riskpp commented 2 years ago

Hi @vokecodes,

  1. we have an example with button which opens in-app chat, you can setup it for your credentials by going step by step - How to start Example app.
  2. would be great to see full log from android application run (if you could run it via android studio it'll be available)
  3. Please check that on Infobip Portal you've linked application to in-app chat - check Mobile in-app Chat section here https://www.infobip.com/docs/live-chat/getting-started
vokecodes commented 2 years ago

Hi @riskpp,

  1. I tried it and it worked.

  2. 03-25 15:48:40.087 25693 25861 I ReactNativeJS: 'Native android viewId: ', 1257
    03-25 15:48:40.167  1184  1197 D MtkConnectivityService: requestNetwork for uid/pid:10279/25693 NetworkRequest [ TRACK_DEFAULT id=5122, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10279] ]
    03-25 15:48:40.168  1184  1342 D Ethernet: got request NetworkRequest [ TRACK_DEFAULT id=5122, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10279] ] with score 60 and serial -1
    03-25 15:48:40.168  1184  1308 D UntrustedWifiNetworkFactory: got request NetworkRequest [ TRACK_DEFAULT id=5122, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10279] ] with score 60 and serial -1
    03-25 15:48:40.171  1184  1308 D WifiNetworkFactory: got request NetworkRequest [ TRACK_DEFAULT id=5122, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10279] ] with score 60 and serial -1
    03-25 15:48:40.171  1530  1530 D PhoneSwitcherNetworkRequstListener: got request NetworkRequest [ TRACK_DEFAULT id=5122, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10279] ] with score 60 and serial -1
    03-25 15:48:40.303  1184  1184 I DeviceIdleController: updateChargingLocked: charging=true
    03-25 15:48:40.304  1184  1184 I DeviceIdleController: becomeActiveLocked, reason=charging, changeLightIdle=true
    03-25 15:48:40.307  2453  2453 I Hoffnung: onReceive Intent { act=android.intent.action.BATTERY_CHANGED flg=0x60000010 (has extras) }
    03-25 15:48:40.311  4787  4787 D XPC_BatteryChangedRcv: level: 100, remindValue: 15, status: 2
    03-25 15:48:40.312  4787  4787 D XPC_BatteryChangedRcv: isGameMode: false
    03-25 15:48:40.312  4787  4787 D XPC_BatteryChangedRcv: onReceive: false
    03-25 15:48:40.312  4787  4787 D XPC_BatteryChangedRcv: isGameMode: false
    03-25 15:48:40.313  4787  4787 D XPC_NotificationUtils: cancelNotification: 
    03-25 15:48:40.314  4787  4787 D XPC_BatteryChangedRcv: onReceive: battary on charge
    03-25 15:48:40.355   551   619 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:14.827474,dur:1011.64,max:466.38,min:13.20  
    03-25 15:48:40.444   579  1099 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7de64a1800,id:2360,api:1,p:25693,c:579) queueBuffer: fps=18.98 dur=1000.96 max=472.48 min=6.35
    03-25 15:48:40.505  1184  1308 E WifiVendorHal: getWifiLinkLayerStats_1_3_Internal(l.927) failed {.code = ERROR_NOT_SUPPORTED, .description = }
    03-25 15:48:41.305   536  1002 I netd    : trafficSwapActiveStatsMap() <1.45ms>
    03-25 15:48:41.329  4787  4787 D XPC_PowerSaveUtils: isUltraPowerOn(context) isOn=false
    03-25 15:48:41.331  4787  4787 D XPC_PowerSaveUtils: getConfigCurrent isUltraModeOn:false
    03-25 15:48:41.331  4787  4787 D XPC_PowerSaveUtils: config details is : bright->11wifiEnable-> truewifiApEnable->falsebtEnable->falsedataEnable->falsegpsEnable->truethreeGEnable->trueautoSyncEnable->trueisScreenModeOn->falseisUltraModeOn->falseisBatterySaverOn->false
    03-25 15:48:41.331  4787  4787 D XPC_PowerSaveUtils: getConfigCurrent current:20.3
    03-25 15:48:41.333  4787  4787 D XPC_PowerSaveUtils: hours:17,min:36
    03-25 15:48:41.355   551   619 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:59.971439,dur:1000.48,max:17.63,min:15.51  
    03-25 15:48:41.448   579  1099 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7de64a1800,id:2360,api:1,p:25693,c:579) queueBuffer: fps=59.78 dur=1003.70 max=18.86 min=14.86
    03-25 15:48:41.528   738   830 D AAL     : 03-25 03:48:40.128 BL=  35,ESS= 256, 03-25 03:48:40.377 BL=  36,ESS= 256, 03-25 03:48:40.761 BL=  37,ESS= 256, 03-25 03:48:41.145 BL=  38,ESS= 256, 03-25 03:48:41.528 BL=  39,ESS= 256, 
    03-25 15:48:42.331   579  1099 I BufferQueueProducer: [StatusBar#0](this:0x7de64f9800,id:6,api:1,p:1359,c:579) queueBuffer: fps=1.00 dur=2997.49 max=2005.51 min=17.95
    03-25 15:48:42.356   551   619 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:59.935577,dur:1001.07,max:17.63,min:15.68  
    03-25 15:48:42.465   579   646 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7de64a1800,id:2360,api:1,p:25693,c:579) queueBuffer: fps=59.02 dur=1016.61 max=33.75 min=14.00
    03-25 15:48:42.780  2046  2054 D IOManager: wl = 1,rt_time = 0,rt_data = 0,wt_time = 0,wt_data = 0,pid = 0,data = 0
    03-25 15:48:43.372   551   619 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:60.032337,dur:1016.12,max:18.12,min:15.60  
    03-25 15:48:43.428   738   830 D AAL     : 03-25 03:48:41.911 BL=  40,ESS= 256, 03-25 03:48:42.295 BL=  41,ESS= 256, 03-25 03:48:42.678 BL=  42,ESS= 256, 03-25 03:48:43.061 BL=  43,ESS= 256, 03-25 03:48:43.428 BL=  44,ESS= 256, 
    03-25 15:48:43.481   579   646 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7de64a1800,id:2360,api:1,p:25693,c:579) queueBuffer: fps=59.99 dur=1016.79 max=19.05 min=14.56
    03-25 15:48:43.520  1184  1308 E WifiVendorHal: getWifiLinkLayerStats_1_3_Internal(l.927) failed {.code = ERROR_NOT_SUPPORTED, .description = }
    03-25 15:48:44.098   730   730 I thermal_repeater: [recvMdThermalInfo] ret=33, strLen=127,  2, 32767, -127, 113, 32767, 3996
    03-25 15:48:44.372   551   619 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:59.997448,dur:1000.04,max:17.54,min:15.90  
    03-25 15:48:44.497   579   637 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7de64a1800,id:2360,api:1,p:25693,c:579) queueBuffer: fps=60.04 dur=1015.96 max=19.21 min=14.03
    03-25 15:48:44.778  1530  1530 D ServiceStateProvider: subId=-1
    03-25 15:48:45.332   579   646 I BufferQueueProducer: [StatusBar#0](this:0x7de64f9800,id:6,api:1,p:1359,c:579) queueBuffer: fps=0.67 dur=3001.17 max=2984.59 min=16.58
    03-25 15:48:45.389   551   619 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:60.021412,dur:1016.30,max:17.76,min:15.66  
    03-25 15:48:45.516   579   637 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7de64a1800,id:2360,api:1,p:25693,c:579) queueBuffer: fps=59.88 dur=1018.79 max=18.85 min=14.84
    03-25 15:48:45.850  2046  2054 D IOManager: wl = 1,rt_time = 0,rt_data = 0,wt_time = 0,wt_data = 0,pid = 0,data = 0
    03-25 15:48:45.851  2046  2054 E IOManager: open /sys/module/filemap/parameters/set_pid fail, errno:2
    03-25 15:48:46.406   551   619 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:59.966965,dur:1017.23,max:17.52,min:15.38  
    03-25 15:48:46.531   579   637 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7de64a1800,id:2360,api:1,p:25693,c:579) queueBuffer: fps=60.11 dur=1014.83 max=18.72 min=14.49
    03-25 15:48:46.540  1184  1308 E WifiVendorHal: getWifiLinkLayerStats_1_3_Internal(l.927) failed {.code = ERROR_NOT_SUPPORTED, .description = }
    03-25 15:48:46.755  1184  1205 D AES     : AEEIOCTL_GET/SET_SF_STATE IOCTL,cmd= 1074294797, lParam=0. 
    03-25 15:48:46.755  1184  1205 D AES     : AEEIOCTL_RT_MON_Kick IOCTL,cmd= 2147774474, lParam=300. 
    03-25 15:48:47.423   551   619 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:59.997234,dur:1016.71,max:17.67,min:15.66  
    03-25 15:48:47.532   579   637 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7de64a1800,id:2360,api:1,p:25693,c:579) queueBuffer: fps=59.96 dur=1000.64 max=19.66 min=12.84
    03-25 15:48:48.332   579   637 I BufferQueueProducer: [StatusBar#0](this:0x7de64f9800,id:6,api:1,p:1359,c:579) queueBuffer: fps=0.67 dur=2999.90 max=2981.30 min=18.60
    03-25 15:48:48.423   551   619 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:59.980270,dur:1000.33,max:17.91,min:15.61  
    03-25 15:48:48.548   579   637 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7de64a1800,id:2360,api:1,p:25693,c:579) queueBuffer: fps=60.03 dur=1016.15 max=19.78 min=13.90
    03-25 15:48:48.922  2046  2054 D IOManager: wl = 1,rt_time = 0,rt_data = 0,wt_time = 0,wt_data = 0,pid = 0,data = 0
    03-25 15:48:49.440   551   619 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:59.992592,dur:1016.79,max:17.69,min:15.57  
    03-25 15:48:49.548   579   646 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7de64a1800,id:2360,api:1,p:25693,c:579) queueBuffer: fps=59.99 dur=1000.10 max=18.77 min=14.86
    03-25 15:48:49.556  1184  1308 E WifiVendorHal: getWifiLinkLayerStats_1_3_Internal(l.927) failed {.code = ERROR_NOT_SUPPORTED, .description = }
    03-25 15:48:50.456   551   619 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:60.030643,dur:1016.15,max:17.60,min:15.49  
    03-25 15:48:50.548   579   637 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7de64a1800,id:2360,api:1,p:25693,c:579) queueBuffer: fps=59.99 dur=1000.19 max=20.25 min=14.26
    03-25 15:48:51.310   536  1002 I netd    : trafficSwapActiveStatsMap() <4.61ms>
    03-25 15:48:51.332   579   646 I BufferQueueProducer: [StatusBar#0](this:0x7de64f9800,id:6,api:1,p:1359,c:579) queueBuffer: fps=0.67 dur=2999.92 max=2982.80 min=17.12
    03-25 15:48:51.457   551   619 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:59.959900,dur:1000.67,max:17.56,min:15.68  
    03-25 15:48:51.549   579   646 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7de64a1800,id:2360,api:1,p:25693,c:579) queueBuffer: fps=59.96 dur=1000.62 max=20.00 min=14.44
    03-25 15:48:51.994  2046  2054 D IOManager: wl = 1,rt_time = 0,rt_data = 0,wt_time = 0,wt_data = 0,pid = 0,data = 0
    03-25 15:48:52.473   551   619 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:60.008427,dur:1016.52,max:17.54,min:15.93  
    03-25 15:48:52.565   579   646 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7de64a1800,id:2360,api:1,p:25693,c:579) queueBuffer: fps=60.03 dur=1016.24 max=19.03 min=14.15
    03-25 15:48:52.579  1184  1308 E WifiVendorHal: getWifiLinkLayerStats_1_3_Internal(l.927) failed {.code = ERROR_NOT_SUPPORTED, .description = }
    03-25 15:48:53.490   551   619 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:59.991901,dur:1016.80,max:17.59,min:15.96  
    03-25 15:48:53.567   579   646 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7de64a1800,id:2360,api:1,p:25693,c:579) queueBuffer: fps=59.88 dur=1001.92 max=19.09 min=14.21
    03-25 15:48:54.118   730   730 I thermal_repeater: [recvMdThermalInfo] ret=33, strLen=127,  2, 32767, -127, 113, 32767, 3996
    03-25 15:48:54.332   579  1099 I BufferQueueProducer: [StatusBar#0](this:0x7de64f9800,id:6,api:1,p:1359,c:579) queueBuffer: fps=0.67 dur=2999.99 max=2984.54 min=15.46
    03-25 15:48:54.506   551   619 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:60.008251,dur:1016.53,max:17.99,min:15.32  
    03-25 15:48:54.582   579  1099 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7de64a1800,id:2360,api:1,p:25693,c:579) queueBuffer: fps=60.12 dur=1014.66 max=19.35 min=14.59
    03-25 15:48:55.070  2046  2054 D IOManager: wl = 1,rt_time = 0,rt_data = 0,wt_time = 0,wt_data = 0,pid = 0,data = 0
    03-25 15:48:55.506   551   619 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:59.991966,dur:1000.13,max:17.84,min:15.76  
    03-25 15:48:55.592  1184  1308 E WifiVendorHal: getWifiLinkLayerStats_1_3_Internal(l.927) failed {.code = ERROR_NOT_SUPPORTED, .description = }
    03-25 15:48:55.598   579  1099 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7de64a1800,id:2360,api:1,p:25693,c:579) queueBuffer: fps=60.02 dur=1016.28 max=19.10 min=14.49
    03-25 15:48:56.523   551   619 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:60.002125,dur:1016.63,max:18.18,min:14.89  
    03-25 15:48:56.599   579   637 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7de64a1800,id:2360,api:1,p:25693,c:579) queueBuffer: fps=59.96 dur=1000.72 max=19.46 min=14.47
    03-25 15:48:57.331   579   646 I BufferQueueProducer: [StatusBar#0](this:0x7de64f9800,id:6,api:1,p:1359,c:579) queueBuffer: fps=0.67 dur=2998.78 max=2982.42 min=16.36
    03-25 15:48:57.523   551   619 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:59.987793,dur:1000.20,max:17.68,min:15.77  
    03-25 15:48:57.599   579  1099 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7de64a1800,id:2360,api:1,p:25693,c:579) queueBuffer: fps=59.98 dur=1000.38 max=19.06 min=14.56
    03-25 15:48:57.628  2046  2054 D IOManager: wl = 1,rt_time = 0,rt_data = 0,wt_time = 0,wt_data = 0,pid = 0,data = 0
    03-25 15:48:57.628  2046  2054 E IOManager: open /sys/module/filemap/parameters/set_pid fail, errno:2
    03-25 15:48:58.523   551   619 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:59.989567,dur:1000.17,max:17.57,min:15.72  
    03-25 15:48:58.610  1184  1308 E WifiVendorHal: getWifiLinkLayerStats_1_3_Internal(l.927) failed {.code = ERROR_NOT_SUPPORTED, .description = }
    03-25 15:48:58.614   579   646 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7de64a1800,id:2360,api:1,p:25693,c:579) queueBuffer: fps=60.09 dur=1015.13 max=18.78 min=14.45
    03-25 15:48:59.540   551   619 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:60.017990,dur:1016.36,max:17.93,min:15.05  
    03-25 15:48:59.615   579  1099 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7de64a1800,id:2360,api:1,p:25693,c:579) queueBuffer: fps=59.96 dur=1000.68 max=18.60 min=14.29
    03-25 15:49:00.000  1359  1359 D KeyguardUpdateMonitor: send updateTime msg
    03-25 15:49:00.008  1359  1359 D TrClockView: onTimeChanged
    03-25 15:49:00.008  1359  1359 W TrClockView: Keyguard is not showing,so we do not update time.
    03-25 15:49:00.036   579   646 I BufferQueueProducer: [StatusBar#0](this:0x7de64f9800,id:6,api:1,p:1359,c:579) queueBuffer: fps=0.74 dur=2704.86 max=2687.62 min=17.24
    03-25 15:49:00.541   551   619 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:59.948200,dur:1000.86,max:17.62,min:15.57  
    03-25 15:49:00.616   579   646 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7de64a1800,id:2360,api:1,p:25693,c:579) queueBuffer: fps=59.92 dur=1001.27 max=18.40 min=14.87
    03-25 15:49:01.210  2046  2054 D IOManager: wl = 1,rt_time = 0,rt_data = 0,wt_time = 0,wt_data = 0,pid = 0,data = 0
    03-25 15:49:01.308   536  1002 I netd    : trafficSwapActiveStatsMap() <1.19ms>
    03-25 15:49:01.556   551   619 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:60.056004,dur:1015.72,max:18.02,min:15.61  
  3. Yes

vokecodes commented 2 years ago
03-25 16:09:11.815 27002 27145 I ReactNativeJS: 'Native android viewId: ', 1019
03-25 16:09:11.919  1184  1308 E WifiVendorHal: getWifiLinkLayerStats_1_3_Internal(l.927) failed {.code = ERROR_NOT_SUPPORTED, .description = }
03-25 16:09:12.037  1516  1516 D Zygote  : Forked child process 27246
03-25 16:09:12.051  1184  1214 I ActivityManager: Start proc 27246:com.google.android.webview:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:0/u0i219 for  {za.co.nedbank.mpos/org.chromium.content.app.SandboxedProcessService0:0}
03-25 16:09:12.089 27246 27246 E ocessService0:: Not starting debugger since process cannot load the jdwp agent.
03-25 16:09:12.105   536  1002 I netd    : trafficSwapActiveStatsMap() <1.20ms>
03-25 16:09:12.113  1184  5363 V ActivityManager: New death recipient com.android.server.am.ActivityManagerService$AppDeathRecipient@929a5e1 for thread android.os.BinderProxy@44c5f06, pid:27246,mApp:null
03-25 16:09:12.120 27246 27246 W ocessService0:0: type=1400 audit(0.0:68322): avc: denied { getattr } for path="/dev/__properties__/u:object_r:persist_transsion_os_typeface_support_prop:s0" dev="tmpfs" ino=8072 scontext=u:r:isolated_app:s0:c512,c768 tcontext=u:object_r:persist_transsion_os_typeface_support_prop:s0 tclass=file permissive=0
03-25 16:09:12.123 27246 27246 E libc    : Access denied finding property "persist.vendor.sys.os.typeface.defaultfont.hash"
03-25 16:09:12.128 27246 27246 E libc    : Access denied finding property "persist.vendor.sys.os.typeface.defaultfont.hash"
03-25 16:09:12.124 27246 27246 W ocessService0:0: type=1400 audit(0.0:68323): avc: denied { getattr } for path="/dev/__properties__/u:object_r:persist_transsion_os_typeface_support_prop:s0" dev="tmpfs" ino=8072 scontext=u:r:isolated_app:s0:c512,c768 tcontext=u:object_r:persist_transsion_os_typeface_support_prop:s0 tclass=file permissive=0
03-25 16:09:12.139 27246 27246 E libc    : Access denied finding property "persist.vendor.sys.os.typeface.defaultfont.hash"
03-25 16:09:12.136 27246 27246 W ocessService0:0: type=1400 audit(0.0:68324): avc: denied { getattr } for path="/dev/__properties__/u:object_r:persist_transsion_os_typeface_support_prop:s0" dev="tmpfs" ino=8072 scontext=u:r:isolated_app:s0:c512,c768 tcontext=u:object_r:persist_transsion_os_typeface_support_prop:s0 tclass=file permissive=0
03-25 16:09:12.146 27246 27246 I cr_WebViewApkApp: Launched version=96.0.4664.45 minSdkVersion=29 isBundle=true processName=com.google.android.webview:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:0
03-25 16:09:12.150 27246 27246 I LoadedApk: No resource references to update in package com.transsion.theme.icon
03-25 16:09:12.153 27246 27246 I cr_ChildProcessService: Creating new ChildProcessService pid=27246
03-25 16:09:12.153  1184  5363 D MtkConnectivityService: requestNetwork for uid/pid:10279/27002 NetworkRequest [ TRACK_DEFAULT id=5126, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10279] ]
03-25 16:09:12.154  1184  1342 D Ethernet: got request NetworkRequest [ TRACK_DEFAULT id=5126, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10279] ] with score 60 and serial -1
03-25 16:09:12.155  1184  1308 D UntrustedWifiNetworkFactory: got request NetworkRequest [ TRACK_DEFAULT id=5126, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10279] ] with score 60 and serial -1
03-25 16:09:12.155  1184  1308 D WifiNetworkFactory: got request NetworkRequest [ TRACK_DEFAULT id=5126, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10279] ] with score 60 and serial -1
03-25 16:09:12.156  1530  1530 D PhoneSwitcherNetworkRequstListener: got request NetworkRequest [ TRACK_DEFAULT id=5126, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10279] ] with score 60 and serial -1
03-25 16:09:12.331   579  1711 I BufferQueueProducer: [StatusBar#0](this:0x7de64f9800,id:6,api:1,p:1359,c:579) queueBuffer: fps=0.67 dur=2999.93 max=2981.58 min=18.35
03-25 16:09:12.341   551   551 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:9.133113,dur:1204.41,max:516.42,min:14.37  
03-25 16:09:12.351   579   637 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7ddaa56000,id:2370,api:1,p:27002,c:579) queueBuffer: fps=8.99 dur=1223.06 max=504.42 min=6.86
03-25 16:09:12.454  2046  2054 D IOManager: wl = 1,rt_time = 0,rt_data = 0,wt_time = 0,wt_data = 0,pid = 0,data = 0
03-25 16:09:13.051  1184  1199 E AppOps  : checkOperation
03-25 16:09:13.051  1184  1199 E AppOps  : java.lang.SecurityException: Specified package com.google.uid.shared:10142 under uid 10142 but it is really -1
03-25 16:09:13.051  1184  1199 E AppOps  :  at com.android.server.appop.AppOpsService.verifyAndGetIsPrivileged(AppOpsService.java:2739)
03-25 16:09:13.051  1184  1199 E AppOps  :  at com.android.server.appop.AppOpsService.checkOperationUnchecked(AppOpsService.java:1910)
03-25 16:09:13.051  1184  1199 E AppOps  :  at com.android.server.appop.AppOpsService.checkOperationImpl(AppOpsService.java:1886)
03-25 16:09:13.051  1184  1199 E AppOps  :  at com.android.server.appop.AppOpsService.checkOperationInternal(AppOpsService.java:1872)
03-25 16:09:13.051  1184  1199 E AppOps  :  at com.android.server.appop.AppOpsService.checkOperation(AppOpsService.java:1863)
03-25 16:09:13.051  1184  1199 E AppOps  :  at com.android.server.AppStateTracker.isBackgroundRestrictedNoCheck(AppStateTracker.java:471)
03-25 16:09:13.051  1184  1199 E AppOps  :  at com.android.server.AppStateTracker.NotAllowedBackgroundRun(AppStateTracker.java:420)
03-25 16:09:13.051  1184  1199 E AppOps  :  at com.android.server.AppStateTracker.access$2100(AppStateTracker.java:83)
03-25 16:09:13.051  1184  1199 E AppOps  :  at com.android.server.AppStateTracker$MyHandler$1.run(AppStateTracker.java:1026)
03-25 16:09:13.051  1184  1199 E AppOps  :  at android.os.Handler.handleCallback(Handler.java:883)
03-25 16:09:13.051  1184  1199 E AppOps  :  at android.os.Handler.dispatchMessage(Handler.java:100)
03-25 16:09:13.051  1184  1199 E AppOps  :  at android.os.Looper.loop(Looper.java:264)
03-25 16:09:13.051  1184  1199 E AppOps  :  at android.os.HandlerThread.run(HandlerThread.java:67)
03-25 16:09:13.051  1184  1199 E AppOps  :  at com.android.server.ServiceThread.run(ServiceThread.java:44)
03-25 16:09:13.291   738   830 D AAL     : 03-25 04:09:11.857 BL=  35,ESS= 256, 03-25 04:09:12.191 BL=  36,ESS= 256, 03-25 04:09:12.524 BL=  37,ESS= 256, 03-25 04:09:12.908 BL=  38,ESS= 256, 03-25 04:09:13.291 BL=  39,ESS= 256, 
03-25 16:09:13.352   551   551 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:55.412464,dur:1010.60,max:90.66,min:6.93  
03-25 16:09:13.361   579   637 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7ddaa56000,id:2370,api:1,p:27002,c:579) queueBuffer: fps=56.40 dur=1010.72 max=91.99 min=7.47
03-25 16:09:14.352   551   551 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:59.949615,dur:1000.84,max:18.02,min:15.48  
03-25 16:09:14.362   579   646 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7ddaa56000,id:2370,api:1,p:27002,c:579) queueBuffer: fps=58.95 dur=1000.80 max=32.26 min=13.68
03-25 16:09:14.936  1184  1308 E WifiVendorHal: getWifiLinkLayerStats_1_3_Internal(l.927) failed {.code = ERROR_NOT_SUPPORTED, .description = }
03-25 16:09:15.191   738   830 D AAL     : 03-25 04:09:13.674 BL=  40,ESS= 256, 03-25 04:09:14.058 BL=  41,ESS= 256, 03-25 04:09:14.441 BL=  42,ESS= 256, 03-25 04:09:14.824 BL=  43,ESS= 256, 03-25 04:09:15.191 BL=  44,ESS= 256, 
03-25 16:09:15.327   579   646 I BufferQueueProducer: [StatusBar#0](this:0x7de64f9800,id:6,api:1,p:1359,c:579) queueBuffer: fps=0.67 dur=2996.55 max=2977.19 min=19.36
03-25 16:09:15.363   579   646 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7ddaa56000,id:2370,api:1,p:27002,c:579) queueBuffer: fps=59.97 dur=1000.42 max=19.26 min=14.58
03-25 16:09:15.368   551   551 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:60.050518,dur:1015.81,max:17.53,min:15.70  
03-25 16:09:15.768  1184  1355 D Griffin/ResourceTracker: Cat meminfo coast time: 19ms
03-25 16:09:16.377   579  1711 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7ddaa56000,id:2370,api:1,p:27002,c:579) queueBuffer: fps=60.16 dur=1013.98 max=18.65 min=14.93
03-25 16:09:16.386   551   551 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:59.949337,dur:1017.53,max:17.61,min:15.45  
03-25 16:09:16.675   730   730 I thermal_repeater: [recvMdThermalInfo] ret=33, strLen=127,  2, 32767, -127, 113, 32767, 3996
03-25 16:09:16.859  1184  1205 D AES     : AEEIOCTL_GET/SET_SF_STATE IOCTL,cmd= 1074294797, lParam=0. 
03-25 16:09:16.859  1184  1205 D AES     : AEEIOCTL_RT_MON_Kick IOCTL,cmd= 2147774474, lParam=300. 
03-25 16:09:16.956  2046  2054 D IOManager: wl = 1,rt_time = 0,rt_data = 0,wt_time = 0,wt_data = 0,pid = 0,data = 0
03-25 16:09:16.957  2046  2054 E IOManager: open /sys/module/filemap/parameters/set_pid fail, errno:2
03-25 16:09:17.377   579   646 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7ddaa56000,id:2370,api:1,p:27002,c:579) queueBuffer: fps=59.95 dur=1000.79 max=18.38 min=14.24
03-25 16:09:17.386   551   551 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:59.959633,dur:1000.67,max:17.57,min:15.53  
03-25 16:09:17.952  1184  1308 E WifiVendorHal: getWifiLinkLayerStats_1_3_Internal(l.927) failed {.code = ERROR_NOT_SUPPORTED, .description = }
03-25 16:09:18.333   579   646 I BufferQueueProducer: [StatusBar#0](this:0x7de64f9800,id:6,api:1,p:1359,c:579) queueBuffer: fps=0.67 dur=3005.48 max=2988.67 min=16.81
03-25 16:09:18.378   579  1711 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7ddaa56000,id:2370,api:1,p:27002,c:579) queueBuffer: fps=59.97 dur=1000.47 max=18.75 min=14.14
03-25 16:09:18.403   551   551 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:60.027664,dur:1016.20,max:17.89,min:14.83  
03-25 16:09:19.394   579   646 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7ddaa56000,id:2370,api:1,p:27002,c:579) queueBuffer: fps=60.02 dur=1016.29 max=19.80 min=13.63
03-25 16:09:19.403   551   551 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:59.994194,dur:1000.10,max:17.58,min:15.75  
03-25 16:09:20.026  2046  2054 D IOManager: wl = 1,rt_time = 0,rt_data = 0,wt_time = 0,wt_data = 0,pid = 0,data = 0
03-25 16:09:20.396   579  1711 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7ddaa56000,id:2370,api:1,p:27002,c:579) queueBuffer: fps=59.88 dur=1002.05 max=18.10 min=15.63
03-25 16:09:20.420   551   551 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:59.973869,dur:1017.11,max:17.62,min:15.67  
03-25 16:09:20.969  1184  1308 E WifiVendorHal: getWifiLinkLayerStats_1_3_Internal(l.927) failed {.code = ERROR_NOT_SUPPORTED, .description = }
03-25 16:09:21.327   579  1711 I BufferQueueProducer: [StatusBar#0](this:0x7de64f9800,id:6,api:1,p:1359,c:579) queueBuffer: fps=0.67 dur=2994.44 max=2981.99 min=12.45
03-25 16:09:21.411   579   637 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7ddaa56000,id:2370,api:1,p:27002,c:579) queueBuffer: fps=60.12 dur=1014.56 max=17.83 min=13.68
03-25 16:09:21.436   551   551 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:60.021141,dur:1016.31,max:17.51,min:15.65  
03-25 16:09:22.102  1184  1308 D WifiConnectivityManager: periodicScanTimerHandler
03-25 16:09:22.103  1184  1308 D WifiConnectivityManager: schedulePeriodicScanTimer, intervalMs: 160000
03-25 16:09:22.104  1184  1310 D WifiScanningService: addSingleScanRequest: ClientInfo[uid=1000,android.os.Messenger@f32ec81],Id=1757,WorkSource{1010}, ScanSettings {  type:HIGH ACCURACY band:24Ghz & 5Ghz (DFS incl) ignoreLocationSettings:false period:0 reportEvents:3 numBssidsPerScan:0 maxScansToCache:0 channels:[  ]  hiddenNetworks:[  ]  } 
03-25 16:09:22.126   536  1002 I netd    : trafficSwapActiveStatsMap() <2.74ms>
03-25 16:09:22.146   725   725 I Accelerometer: batch: handle:0, flag:0,samplingPeriodNs:20000000 maxBatchReportLatencyNs:0
03-25 16:09:22.148   725   725 I Accelerometer: flush, flushCnt:1
03-25 16:09:22.150   725   804 I Accelerometer: flush complete, flushCnt:0
03-25 16:09:22.411   579   646 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7ddaa56000,id:2370,api:1,p:27002,c:579) queueBuffer: fps=59.98 dur=1000.26 max=19.02 min=13.76
03-25 16:09:22.453   551   551 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:60.010960,dur:1016.48,max:17.45,min:15.12  
03-25 16:09:22.672   725   725 I Accelerometer: batch: handle:0, flag:0,samplingPeriodNs:66667000 maxBatchReportLatencyNs:0
03-25 16:09:22.696  1184  1509 W AppOps  : Noting op not finished: uid 10142 pkg com.google.android.gms code 79 time=1648220952047 duration=-1
03-25 16:09:22.714  1184  7206 W AppOps  : Noting op not finished: uid 10142 pkg com.google.android.gms code 79 time=1648220962696 duration=0
03-25 16:09:22.731  1184  7206 W AppOps  : Noting op not finished: uid 10142 pkg com.google.android.gms code 79 time=1648220962714 duration=0
03-25 16:09:23.099  2046  2054 D IOManager: wl = 1,rt_time = 0,rt_data = 0,wt_time = 0,wt_data = 0,pid = 0,data = 0
03-25 16:09:23.412   579   646 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7ddaa56000,id:2370,api:1,p:27002,c:579) queueBuffer: fps=59.94 dur=1001.04 max=18.47 min=15.35
03-25 16:09:23.453   551   551 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:59.982983,dur:1000.28,max:17.83,min:15.88  
03-25 16:09:23.989  1184  1308 E WifiVendorHal: getWifiLinkLayerStats_1_3_Internal(l.927) failed {.code = ERROR_NOT_SUPPORTED, .description = }
03-25 16:09:24.327   579   637 I BufferQueueProducer: [StatusBar#0](this:0x7de64f9800,id:6,api:1,p:1359,c:579) queueBuffer: fps=0.67 dur=2999.43 max=2983.74 min=15.69
03-25 16:09:24.427   579  1711 I BufferQueueProducer: [za.co.nedbank.mpos/za.co.nedbank.mpos.MainActivity#1](this:0x7ddaa56000,id:2370,api:1,p:27002,c:579) queueBuffer: fps=60.12 dur=1014.64 max=18.86 min=14.24
03-25 16:09:24.469   551   551 I hwcomposer: [HWCDisplay] [Display_0 (type:1)] fps:60.035656,dur:1016.06,max:18.22,min:15.21  
03-25 16:09:24.654   911   917 D VoLTE IMSM: send CTRL_CMD_GET_SCAN (module/mdagent/volte_imsm_93/src/wireless.c:574)
03-25 16:09:24.654   911   917 D VoLTE IMSM: monitor_wifi_tech: mutex lock (module/mdagent/volte_imsm_93/src/wireless.c:589)
03-25 16:09:24.656  1184  5363 D WificondControl: Scan result ready event
03-25 16:09:24.657   909   927 I [BIP]   :  [BIP NL] event newlink match dev 0, interface index 53
03-25 16:09:24.657   909   927 I [BIP]   :  [BIP NL] the link status of interface(index:0) changes to 1
03-25 16:09:24.660  1184  1199 I EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true
03-25 16:09:24.663   911   917 D VoLTE IMSM: monitor_wifi_tech: mutex unlock (module/mdagent/volte_imsm_93/src/wireless.c:597)
riskpp commented 2 years ago

Great that Example is working, then you could probably check what's the difference between approach within your app and the example. Unfortunately logs aren't helpful, I thought to see there some logs from our MobileMessaging SDK, unfortunately - nothing is there. If your logs contains sensitive information better to send it to support@infobip.com with link to the github issue.

vokecodes commented 2 years ago

Hi @riskpp, here's my code to initialize the SDK which is not different from the example app

const initializeInfofib = (infobipCode) => {
        mobileMessaging.init(
            {
                applicationCode: infobipCode,
                inAppChatEnabled: true,
            },
            () => {
                console.log(('MobileMessaging started'));
            },
            (error) => {
                console.log(('MobileMessaging error'));
            },
        );
    };
riskpp commented 2 years ago

Hi @vokecodes, we already checked your code snippet and can't reproduce your issue. Could you please provide minimal example, better to the support@infobip.com with link to this github issue for reference, it'll help us to reproduce your issue and investigate it faster.

BR, Olga

batcodegen commented 2 years ago

@vokecodes You need to first initialize mobilemessage at root level const App = () =>{ useState(()=>{ initializeInfofib(infobipCode) ); }) }

then use your code else where const openChat = () => { mobileMessaging.showChat(); };