How to add the js files in Ionic3


#1

Hi

I downloaded MCS Cordova SDK from Oracle MCS and I extracted it and used the files in my Ionic3 application.While I am using the oracle_config fille I am getting that mcs name is not present.

var mcs_config = {
  "logLevel": mcs.LOG_LEVEL.INFO,
  "logHTTP": true,
  "mobileBackends": {
    "YOUR_BACKEND_NAME": {
      "default": true,
      "baseUrl": "YOUR_BACKEND_BASE_URL",
      "applicationKey": "YOUR_BACKEND_APPLICATION_KEY",
      "analytics": {
        "location": true
      },
      "authorization": {
        "basicAuth": {
          "backendId": "YOUR_BACKEND_ID",
          "anonymousToken": "YOUR_BACKEND_ANONYMOUS_TOKEN"
        },
        "oAuth": {
          "clientId": "YOUR_CLIENT_ID",
          "clientSecret": "YOUR_ClIENT_SECRET",
          "tokenEndpoint": "YOUR_TOKEN_ENDPOINT"
        },
        "facebookAuth":{
          "facebookAppId": "YOUR_FACEBOOK_APP_ID",
          "backendId": "YOUR_BACKEND_ID",
          "anonymousToken": "YOUR_BACKEND_ANONYMOUS_TOKEN"
        },
        "ssoAuth":{
          "clientId": "YOUR_CLIENT_ID",
          "clientSecret": "YOUR_ClIENT_SECRET",
          "tokenEndpoint": "YOUR_TOKEN_ENDPOINT"
        },
        "tokenAuth":{
          "backendId": "YOUR_BACKEND_ID"
        }
      }
    }
  }
};

Here I amgetting that mcs is not present.I followed the steps which are present for ionic1 but there I got it but in ionic3 I am unable to get it.This is the structure i used but I am unable get the mcs.So could you please help me out for this.

This is the folder structure that i used but is it correct or any other structure to get eork.Please help me out for this.


#2

(I changed your post to format your code or error message correctly. Please use the </> button above the post input field to format your code or error message or wrap it in ``` (“code fences”) manually. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.)

What exact are you getting?
What code is causing the error?


#3

Here i got the variable from mcs sdk and i kept in provider but its showing mcs name was not present.I need to keep some JS files in app which we got through mcs sdk.So i need to place the files and I placed as they given in www folder.Is it correct to place the mcs.js files in which i mentioned above,Please let me knoe if any answer.


#4

No. The www folder should be treated as the property of the build system, which can and will blow away any changes you make there. Look into the options for customizing how app-scripts works.