mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Notifications Configurations added for web
This commit is contained in:
@@ -18,6 +18,7 @@ import { ApproveEventModalPage } from '../pages/gabinete-digital/event-list/appr
|
||||
import { PublicationDetailPage } from '../pages/publications/view-publications/publication-detail/publication-detail.page';
|
||||
import { ToastService } from '../services/toast.service';
|
||||
import { SuccessMessagePage } from '../shared/popover/success-message/success-message.page';
|
||||
//import MFPPush from 'ibm-mfp-web-push';
|
||||
|
||||
/* const { PushNotifications, LocalNotifications, LocalNotificationAction } = Plugins; */
|
||||
|
||||
@@ -78,11 +79,7 @@ export class HomePage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (this.platform.is('desktop')) {
|
||||
console.log('Notifications not supported')
|
||||
} else {
|
||||
this.wlCommonInit();
|
||||
}
|
||||
this.wlCommonInit();
|
||||
this.count();
|
||||
|
||||
}
|
||||
@@ -120,34 +117,7 @@ export class HomePage implements OnInit {
|
||||
}
|
||||
|
||||
mobileFirstTest() {
|
||||
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");
|
||||
}); */
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
mobileFirstPush() {
|
||||
@@ -166,7 +136,7 @@ export class HomePage implements OnInit {
|
||||
);
|
||||
|
||||
MFPPush.registerDevice(null, function (successResponse) {
|
||||
console.log("Successfully registered: " + successResponse);
|
||||
console.log("Successfully registered: " + JSON.stringify(successResponse) );
|
||||
},
|
||||
function (failureResponse) {
|
||||
console.log("Successfully failue: " + failureResponse);
|
||||
|
||||
Reference in New Issue
Block a user