0

When ever i am trying to connect from device, always i am getting the below error

The connection to the server was unsuccessful

fille:///android_asset/www/index.html

In appcomponent added the below code.

   WLAuthorizationManager.obtainAccessToken()
        .then(function (accessToken) {
        alert("Connected to MobileFirst Server");
    }, function (error) {
        alert("Failed to connect to MobileFirst Server");
    });

I am using angular cordova.

Phani
  • 21
  • 2
  • The application flow never enters the failure call back? If it does, print the contents of the error object. alert("Failed to connect.. " + JSON.stringify(error)); – Vivin K Jan 02 '20 at 04:19
  • To be clear - it works for you in browser, but not in device? When you say "not in device", does it mean when you deploy the application to the device ? Or from device browser? – Vivin K Jan 02 '20 at 07:03
  • @VivinK, now i am getting , "{"responseHeaders":{},"status":200,"responseText":"undefined","errorCode":"UNRESPONSIVE_HOST","errorMsg":"unresponsive host"}", POST file:///mfp/api/registration/v1/self – Phani Jan 02 '20 at 07:27
  • Is the server end point reachable from the device? Find the hostname and port it is it trying to connect to, and see if it is reachable from the device. – Vivin K Jan 02 '20 at 07:29
  • @VivinK, actually server enpoint url will pick automatically from config.xml, in my case why it is not featching form device i am not getting, here my config.xml ( ) – Phani Jan 02 '20 at 07:34
  • @VivinK, endpoint url coming like it Request URL: file:///mfp/api/adapters/sampe/sampleProcedure (While trying from device) in angular 7 with cordova with out ionic framework – Phani Jan 02 '20 at 08:53
  • Can you please open a case with MFP support? We can debug in more detail with a case. – Vivin K Jan 02 '20 at 15:38

0 Answers0