mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
42 lines
1.2 KiB
JavaScript
42 lines
1.2 KiB
JavaScript
function wlCommonInit() {
|
|
|
|
if(window['WLAuthorizationManager']) {
|
|
if(window['WLAuthorizationManager'].obtainAccessToken) {
|
|
window['WLAuthorizationManager'].obtainAccessToken("").then(
|
|
(token) => {
|
|
console.log('MobileFirst Server connect: Success ' + token);
|
|
|
|
var resourceRequest = new WLResourceRequest("/adapters/javaAdapter/resource/greet/",
|
|
WLResourceRequest.GET
|
|
);
|
|
|
|
resourceRequest.setQueryParameter("name", "world");
|
|
resourceRequest.send().then(
|
|
(response) => {
|
|
// Will display "Hello world" in an alert dialog.
|
|
console.log("Connect with JavaAdapter Success: " + response.responseText);
|
|
//this.MFPushNotification();
|
|
},
|
|
(error) => {
|
|
alert("Connect with JavaAdapter Failure: " + JSON.stringify(error));
|
|
}
|
|
);
|
|
}, (error) => {
|
|
console.log('MobileFirst Server connect: failure ' + error.responseText);
|
|
console.log(JSON.stringify(error))
|
|
/* this.zone.run(() => {
|
|
alert("Bummer...");
|
|
alert("Failed to connect to MobileFirst Server");
|
|
}); */
|
|
}
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |