mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Direct update dialog melhorado
This commit is contained in:
+15
-13
@@ -9,6 +9,8 @@ import { ModalController, AlertController } from '@ionic/angular';
|
||||
/* import { Plugins, PushNotification, PushNotificationToken, PushNotificationActionPerformed, Modals } from '@capacitor/core'; */
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
import { FCM } from '@ionic-native/fcm/ngx';
|
||||
|
||||
/* const { PushNotifications, LocalNotifications, LocalNotificationAction } = Plugins; */
|
||||
|
||||
@Component({
|
||||
@@ -116,15 +118,15 @@ export class HomePage implements OnInit {
|
||||
|
||||
mobileFirstTest() {
|
||||
this.zone.run(() => {
|
||||
alert("Hello MobileFirst");
|
||||
alert("Connecting to Server...");
|
||||
console.log("Hello MobileFirst");
|
||||
console.log("Connecting to Server...");
|
||||
});
|
||||
WLAuthorizationManager.obtainAccessToken("").then(
|
||||
(token) => {
|
||||
console.log('--> pingMFP(): Success ', token);
|
||||
this.zone.run(() => {
|
||||
alert("Yay!");
|
||||
alert("Connected to MobileFirst Server");
|
||||
console.log("Yay!");
|
||||
console.log("Connected to MobileFirst Server");
|
||||
});
|
||||
var resourceRequest = new WLResourceRequest("/adapters/javaAdapter/resource/greet/",
|
||||
WLResourceRequest.GET
|
||||
@@ -134,19 +136,19 @@ export class HomePage implements OnInit {
|
||||
resourceRequest.send().then(
|
||||
(response) => {
|
||||
// Will display "Hello world" in an alert dialog.
|
||||
alert("Success: " + response.responseText);
|
||||
console.log("Success: " + response.responseText);
|
||||
|
||||
this.MFPushNotification()
|
||||
},
|
||||
(error) => {
|
||||
alert("Failure: " + JSON.stringify(error));
|
||||
console.log("Failure: " + JSON.stringify(error));
|
||||
}
|
||||
);
|
||||
}, (error) => {
|
||||
alert(JSON.stringify(error))
|
||||
console.log(JSON.stringify(error))
|
||||
this.zone.run(() => {
|
||||
alert("Bummer...");
|
||||
alert("Failed to connect to MobileFirst Server");
|
||||
console.log("Bummer...");
|
||||
console.log("Failed to connect to MobileFirst Server");
|
||||
});
|
||||
}
|
||||
);
|
||||
@@ -155,7 +157,7 @@ export class HomePage implements OnInit {
|
||||
MFPushNotification() {
|
||||
|
||||
var pushNotificationReceived = function (message) {
|
||||
alert(JSON.stringify(message));
|
||||
console.log(JSON.stringify(message));
|
||||
}
|
||||
|
||||
MFPPush.initialize (
|
||||
@@ -177,14 +179,14 @@ export class HomePage implements OnInit {
|
||||
);
|
||||
MFPPush.registerDevice(
|
||||
null,function(successResponse) {
|
||||
alert("Successfully registered: "+ successResponse);
|
||||
console.log("Successfully registered: "+ successResponse);
|
||||
},
|
||||
function(failureResponse) {
|
||||
alert("Successfully registered: "+ failureResponse);
|
||||
console.log("Successfully registered: "+ failureResponse);
|
||||
}
|
||||
);
|
||||
function notificationReceived(message) {
|
||||
alert(JSON.stringify(message.alert));
|
||||
console.log(JSON.stringify(message.alert));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user