mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Connected to mobilefirst
This commit is contained in:
+2
-3
@@ -23,7 +23,6 @@
|
||||
<platform name="android">
|
||||
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<application android:networkSecurityConfig="@xml/network_security_config" />
|
||||
<application android:requestLegacyExternalStorage="true" />
|
||||
</edit-config>
|
||||
<resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" />
|
||||
<allow-intent href="market:*" />
|
||||
@@ -102,14 +101,14 @@
|
||||
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
|
||||
<mfp:android>
|
||||
<mfp:sdkChecksum>1109370933</mfp:sdkChecksum>
|
||||
<mfp:appChecksum>4242109404</mfp:appChecksum>
|
||||
<mfp:appChecksum>3619450036</mfp:appChecksum>
|
||||
<mfp:security>
|
||||
<mfp:testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3" />
|
||||
</mfp:security>
|
||||
</mfp:android>
|
||||
<mfp:ios>
|
||||
<mfp:sdkChecksum>246097737</mfp:sdkChecksum>
|
||||
<mfp:appChecksum>3914937917</mfp:appChecksum>
|
||||
<mfp:appChecksum>1328564293</mfp:appChecksum>
|
||||
<mfp:security>
|
||||
<mfp:testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3" />
|
||||
</mfp:security>
|
||||
|
||||
Generated
+1537
-458
File diff suppressed because it is too large
Load Diff
+6
-10
@@ -45,6 +45,7 @@
|
||||
"@logisticinfotech/ionic4-datepicker": "^1.4.4",
|
||||
"angular-calendar": "^0.28.22",
|
||||
"angular-tag-cloud-module": "^5.2.2",
|
||||
"cordova": "^10.0.0",
|
||||
"cordova-plugin-camera": "^5.0.1",
|
||||
"cordova-plugin-filepath": "^1.5.8",
|
||||
"cordova-plugin-okhttp": "^2.0.0",
|
||||
@@ -80,7 +81,7 @@
|
||||
"@types/jasminewd2": "~2.0.3",
|
||||
"@types/node": "^12.11.1",
|
||||
"codelyzer": "^6.0.0",
|
||||
"cordova-android": "^9.1.0",
|
||||
"cordova-android": "^9.0.0",
|
||||
"cordova-browser": "^6.0.0",
|
||||
"cordova-ios": "^6.2.0",
|
||||
"cordova-plugin-androidx": "^3.0.0",
|
||||
@@ -88,7 +89,6 @@
|
||||
"cordova-plugin-compat": "^1.2.0",
|
||||
"cordova-plugin-device": "^2.0.2",
|
||||
"cordova-plugin-dialogs": "^2.0.2",
|
||||
"cordova-plugin-fcm-with-dependecy-updated": "^7.8.0",
|
||||
"cordova-plugin-file": "^6.0.2",
|
||||
"cordova-plugin-fingerprint-aio": "^4.0.2",
|
||||
"cordova-plugin-globalization": "^1.11.0",
|
||||
@@ -96,6 +96,7 @@
|
||||
"cordova-plugin-ionic-keyboard": "^2.2.0",
|
||||
"cordova-plugin-ionic-webview": "^4.2.1",
|
||||
"cordova-plugin-mfp": "^8.0.2021031007",
|
||||
"cordova-plugin-mfp-push": "^8.0.2020072705",
|
||||
"cordova-plugin-splashscreen": "^5.0.2",
|
||||
"cordova-plugin-statusbar": "^2.4.2",
|
||||
"cordova-plugin-whitelist": "^1.3.4",
|
||||
@@ -130,13 +131,8 @@
|
||||
"cordova-plugin-mfp": {},
|
||||
"cordova-plugin-androidx": {},
|
||||
"cordova-plugin-androidx-adapter": {},
|
||||
"cordova-plugin-fcm-with-dependecy-updated": {
|
||||
"ANDROID_FCM_VERSION": "19.0.0",
|
||||
"ANDROID_GRADLE_TOOLS_VERSION": "3.5.3",
|
||||
"ANDROID_GOOGLE_SERVICES_VERSION": "4.3.3",
|
||||
"ANDROID_DEFAULT_NOTIFICATION_ICON": "@mipmap/ic_launcher"
|
||||
},
|
||||
"cordova-plugin-fingerprint-aio": {}
|
||||
"cordova-plugin-fingerprint-aio": {},
|
||||
"cordova-plugin-mfp-push": {}
|
||||
},
|
||||
"platforms": [
|
||||
"browser",
|
||||
@@ -150,4 +146,4 @@
|
||||
"url": "git+https://Kayaya@bitbucket.org/equilibriumito/gabinete-digital.git"
|
||||
},
|
||||
"license": "ISC"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//<reference path="../../../plugins/cordova-plugin-mfp/typings/worklight.d.ts" />
|
||||
///<reference path="../../../plugins/cordova-plugin-mfp/typings/worklight.d.ts" />
|
||||
///<reference path="../../../plugins/cordova-plugin-mfp-push/typings/mfppush.d.ts" />
|
||||
import { Component, OnInit, NgZone } from '@angular/core';
|
||||
import { EventsService } from '../services/events.service';
|
||||
import { Event } from '../models/event.model';
|
||||
@@ -75,6 +76,7 @@ export class HomePage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.wlCommonInit();
|
||||
|
||||
//Add a test
|
||||
//this.pushCordova();
|
||||
@@ -102,6 +104,98 @@ export class HomePage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
wlCommonInit() {
|
||||
|
||||
this.mobileFirstTest();
|
||||
}
|
||||
|
||||
mobileFirstTest() {
|
||||
this.zone.run(() => {
|
||||
alert("Hello MobileFirst");
|
||||
alert("Connecting to Server...");
|
||||
});
|
||||
WLAuthorizationManager.obtainAccessToken("").then(
|
||||
(token) => {
|
||||
alert('--> pingMFP(): Success '+ token);
|
||||
this.zone.run(() => {
|
||||
alert("Yay!");
|
||||
alert("Connected to MobileFirst Server");
|
||||
});
|
||||
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.
|
||||
alert("Success: " + response.responseText);
|
||||
//this.MFPushNotification();
|
||||
},
|
||||
(error) => {
|
||||
alert("Failure: " + JSON.stringify(error));
|
||||
}
|
||||
);
|
||||
}, (error) => {
|
||||
alert('--> pingMFP(): failure '+ error.responseText);
|
||||
alert(JSON.stringify(error))
|
||||
this.zone.run(() => {
|
||||
alert("Bummer...");
|
||||
alert("Failed to connect to MobileFirst Server");
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
mobileFirstPush() {
|
||||
this.zone.run(() => {
|
||||
alert("Hello Push notification MobileFirst");
|
||||
alert("Connecting to Server...");
|
||||
});
|
||||
WLAuthorizationManager.obtainAccessToken("push.mobileclient").then(
|
||||
(token) => {
|
||||
alert('--> pingMFP(): Success '+ token);
|
||||
this.zone.run(() => {
|
||||
alert("Yay!");
|
||||
alert("Connected to MobileFirst Server");
|
||||
});
|
||||
|
||||
MFPPush.initialize (
|
||||
function(successResponse) {
|
||||
alert("Successfully intialized");
|
||||
//MFPPush.registerNotificationsCallback(notificationReceived);
|
||||
},
|
||||
function(failureResponse) {
|
||||
alert("Failed to initialize");
|
||||
}
|
||||
);
|
||||
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.
|
||||
alert("Success: " + response.responseText);
|
||||
//this.MFPushNotification();
|
||||
},
|
||||
(error) => {
|
||||
alert("Failure: " + JSON.stringify(error));
|
||||
}
|
||||
);
|
||||
}, (error) => {
|
||||
alert('--> pingMFP(): failure '+ error.responseText);
|
||||
alert(JSON.stringify(error))
|
||||
this.zone.run(() => {
|
||||
alert("Bummer...");
|
||||
alert("Failed to connect to MobileFirst Server");
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// pushCordova() {
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ function wlCommonInit(){
|
||||
// Override the default Direct Update interface.
|
||||
|
||||
//uncomment below function to get custom DU
|
||||
wl_directUpdateChallengeHandler.handleDirectUpdate = function(directUpdateData, directUpdateContext) {
|
||||
/* wl_directUpdateChallengeHandler.handleDirectUpdate = function(directUpdateData, directUpdateContext) {
|
||||
// Create a dialog.
|
||||
navigator.notification.confirm(
|
||||
'Actualização Disponivel',
|
||||
@@ -14,9 +14,9 @@ function wlCommonInit(){
|
||||
wl_directUpdateChallengeHandler.submitFailure();
|
||||
}
|
||||
},
|
||||
'ctualização Disponivel',
|
||||
'Actualização Disponivel',
|
||||
['Actualizar']
|
||||
);
|
||||
};
|
||||
}; */
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user