commit
28da62f874
|
@ -11602,9 +11602,9 @@
|
|||
}
|
||||
},
|
||||
"@moodlehq/phonegap-plugin-push": {
|
||||
"version": "4.0.0-moodle.3",
|
||||
"resolved": "https://registry.npmjs.org/@moodlehq/phonegap-plugin-push/-/phonegap-plugin-push-4.0.0-moodle.3.tgz",
|
||||
"integrity": "sha512-oJTmcVN6QBxo8+9uHEFTLCgNJkd7jeaT1MMM3ljDhR5EkFDkHwMMat/Km0tjm+9ToD0LYWHZfvLljpCZM5u3yg=="
|
||||
"version": "4.0.0-moodle.4",
|
||||
"resolved": "https://registry.npmjs.org/@moodlehq/phonegap-plugin-push/-/phonegap-plugin-push-4.0.0-moodle.4.tgz",
|
||||
"integrity": "sha512-2G9/VvCuSqwonBy92A8VoINgO3DTcSIpsxcefdGgOFyFM5ceijNm0fts2OOMfhWaRSLEnGMtZfPJ2h8u7P7qxg=="
|
||||
},
|
||||
"@mrmlnc/readdir-enhanced": {
|
||||
"version": "2.2.1",
|
||||
|
@ -26533,12 +26533,12 @@
|
|||
"bplist-parser": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.0.6.tgz",
|
||||
"integrity": "sha1-ONo0cYF9+dRKs4kuJ3B7u9daEbk="
|
||||
"integrity": "sha512-fGeghPEH4Eytvf+Mi446aKcDqvkA/+eh6r7QGiZWMQG6TzqrnsToLP379XFfqRSZ41+676hhGIm++maNST1Apw=="
|
||||
},
|
||||
"nopt": {
|
||||
"version": "1.0.9",
|
||||
"resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.9.tgz",
|
||||
"integrity": "sha1-O8DXy6e/sNWmdtvtfA6+SKT9RU4=",
|
||||
"integrity": "sha512-CmUZ3rzN0/4kRHum5pGRiGkhmBMzgtEDxrZVHqRJDSv8qK6s+wzaig/xeyB22Due5aZQeTiEZg/nrmMH2tapDQ==",
|
||||
"requires": {
|
||||
"abbrev": "1"
|
||||
}
|
||||
|
@ -38040,7 +38040,7 @@
|
|||
"tail": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/tail/-/tail-0.4.0.tgz",
|
||||
"integrity": "sha1-0p3nJ1DMmdseBTr/E8NZ7PtxMAI="
|
||||
"integrity": "sha512-i5rOhX0PwkFSbjID14mmuoqrLUIqpJeBwg0esugSbb+6Y+dzgN/O3YZXzzPL7dnQJGbQLs8cwM8Zsak5kFJGcA=="
|
||||
},
|
||||
"tapable": {
|
||||
"version": "1.1.3",
|
||||
|
@ -41001,7 +41001,7 @@
|
|||
"xml-escape": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/xml-escape/-/xml-escape-1.1.0.tgz",
|
||||
"integrity": "sha1-OQTBQ/qOs6ADDsZG0pAqLxtwbEQ="
|
||||
"integrity": "sha512-B/T4sDK8Z6aUh/qNr7mjKAwwncIljFuUP+DO/D5hloYFj+90O88z8Wf7oSucZTHxBAsC1/CTP4rtx/x1Uf72Mg=="
|
||||
},
|
||||
"xml-name-validator": {
|
||||
"version": "3.0.0",
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
"@moodlehq/cordova-plugin-qrscanner": "3.0.1-moodle.5",
|
||||
"@moodlehq/cordova-plugin-zip": "3.1.0-moodle.1",
|
||||
"@moodlehq/ionic-native-push": "5.36.0-moodle.2",
|
||||
"@moodlehq/phonegap-plugin-push": "4.0.0-moodle.3",
|
||||
"@moodlehq/phonegap-plugin-push": "4.0.0-moodle.4",
|
||||
"@ngx-translate/core": "13.0.0",
|
||||
"@ngx-translate/http-loader": "6.0.0",
|
||||
"@types/chart.js": "2.9.31",
|
||||
|
|
|
@ -2349,6 +2349,7 @@
|
|||
"core.settings.enablefirebaseanalyticsdescription": "local_moodlemobileapp",
|
||||
"core.settings.enablerichtexteditor": "local_moodlemobileapp",
|
||||
"core.settings.enablerichtexteditordescription": "local_moodlemobileapp",
|
||||
"core.settings.encryptedpushsupported": "local_moodlemobileapp",
|
||||
"core.settings.entriesincache": "local_moodlemobileapp",
|
||||
"core.settings.estimatedfreespace": "local_moodlemobileapp",
|
||||
"core.settings.filesystemroot": "local_moodlemobileapp",
|
||||
|
|
|
@ -726,7 +726,7 @@ export class CorePushNotificationsProvider {
|
|||
try {
|
||||
|
||||
const data = this.getRequiredRegisterData();
|
||||
data.publickey = await this.getPublicKey(site);
|
||||
data.publickey = await this.getPublicKeyForSite(site);
|
||||
|
||||
const neededActions = await this.getRegisterDeviceActions(data, site, forceUnregister);
|
||||
|
||||
|
@ -780,11 +780,24 @@ export class CorePushNotificationsProvider {
|
|||
* @param site Site to register
|
||||
* @returns Public key, undefined if the site or the device doesn't support encryption.
|
||||
*/
|
||||
protected async getPublicKey(site: CoreSite): Promise<string | undefined> {
|
||||
protected async getPublicKeyForSite(site: CoreSite): Promise<string | undefined> {
|
||||
if (!site.wsAvailable('core_user_update_user_device_public_key')) {
|
||||
return;
|
||||
}
|
||||
|
||||
return await this.getPublicKey();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the device public key.
|
||||
*
|
||||
* @returns Public key, undefined if the device doesn't support encryption.
|
||||
*/
|
||||
async getPublicKey(): Promise<string | undefined> {
|
||||
if (!CorePlatform.isMobile()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const publicKey = await Push.getPublicKey();
|
||||
|
||||
return publicKey ?? undefined;
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
"enablefirebaseanalyticsdescription": "If enabled, the app will collect anonymous data usage.",
|
||||
"enablerichtexteditor": "Enable text editor",
|
||||
"enablerichtexteditordescription": "If enabled, a text editor will be available when entering content.",
|
||||
"encryptedpushsupported": "Encrypted push notifications supported",
|
||||
"entriesincache": "{{$a}} entries in cache",
|
||||
"estimatedfreespace": "Estimated free space",
|
||||
"filesystemroot": "File system root",
|
||||
|
|
|
@ -148,6 +148,13 @@
|
|||
<p>{{ deviceInfo.pushId }}</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-item *ngIf="deviceInfo.pushId" (longPress)="copyItemInfo($event)">
|
||||
<ion-label class="ion-text-wrap">
|
||||
<p class="item-heading">{{ 'core.settings.encryptedpushsupported' | translate }}</p>
|
||||
<p *ngIf="!deviceInfo.encryptedPushSupported">{{ 'core.no' | translate }}</p>
|
||||
<p *ngIf="deviceInfo.encryptedPushSupported">{{ 'core.yes' | translate }}</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-item (longPress)="copyItemInfo($event)">
|
||||
<ion-label class="ion-text-wrap">
|
||||
<p class="item-heading">{{ 'core.settings.localnotifavailable' | translate }}</p>
|
||||
|
|
|
@ -58,6 +58,7 @@ interface CoreSettingsDeviceInfo {
|
|||
uuid?: string;
|
||||
pushId?: string;
|
||||
localNotifAvailable: string;
|
||||
encryptedPushSupported?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -210,6 +211,11 @@ export class CoreSettingsDeviceInfoPage implements OnDestroy {
|
|||
const showDevOptionsOnConfig = await CoreConfig.get('showDevOptions', 0);
|
||||
this.devOptionsForced = CoreConstants.BUILD.isDevelopment || CoreConstants.BUILD.isTesting;
|
||||
this.showDevOptions = this.devOptionsForced || showDevOptionsOnConfig == 1;
|
||||
|
||||
const publicKey = this.deviceInfo.pushId ?
|
||||
await CoreUtils.ignoreErrors(CorePushNotifications.getPublicKey()) :
|
||||
undefined;
|
||||
this.deviceInfo.encryptedPushSupported = publicKey !== undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue