Direct update dialog melhorado

This commit is contained in:
Eudes Inácio
2021-04-08 11:27:53 +01:00
parent 1501090495
commit 65b51cf263
5 changed files with 58 additions and 85 deletions
+3
View File
@@ -29,6 +29,8 @@ import { adapterFactory } from 'angular-calendar/date-adapters/date-fns';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MessagesPage } from './pages/chat/messages/messages.page';
import { FCM } from '@ionic-native/fcm/ngx'
@NgModule({
declarations: [AppComponent,MessagesPage,],
@@ -55,6 +57,7 @@ import { MessagesPage } from './pages/chat/messages/messages.page';
//File,
WebView,
FilePath,
FCM
],
bootstrap: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
+15 -13
View File
@@ -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));
}
}