My cordova app is not working in M1 a1 mobile

326 Views Asked by At

Our android cordova app is working file in all phones but in Mi A1 mobiles it's not working properly , any idea ?

1

There are 1 best solutions below

0
Thom On BEST ANSWER

The fix is below., This may help someone.

In Mi A1 mobile the browser name will show us OPR but sencha not having the name in list so change the below code in touch\src\env\Browser.js line No : 231

Old Code

    if (userAgent.match(/OPR/)) {
        browserMatch = userAgent.match(/OPR\/(\d+.\d+)/);
        browserName = 'Opera';           
        browserVersion = new Ext.Version(browserMatch[1]);
    }

New Code

browserMatch = userAgent.match(/OPR\/(\d+.\d+)/);
    if (userAgent.match(/OPR/)) {
          if (browserMatch) {
        browserName = 'Opera';           
        browserVersion = new Ext.Version(browserMatch[1]);
        }
    }