MOBILE-3401 ws: Add platform ready to override user agent
parent
0db91392a4
commit
b8cc0e4f57
|
@ -13,6 +13,7 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Platform } from 'ionic-angular';
|
||||||
import { HttpClient, HttpResponse } from '@angular/common/http';
|
import { HttpClient, HttpResponse } from '@angular/common/http';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { FileTransfer, FileUploadOptions } from '@ionic-native/file-transfer';
|
import { FileTransfer, FileUploadOptions } from '@ionic-native/file-transfer';
|
||||||
|
@ -156,12 +157,15 @@ export class CoreWSProvider {
|
||||||
protected fileProvider: CoreFileProvider,
|
protected fileProvider: CoreFileProvider,
|
||||||
protected fileTransfer: FileTransfer,
|
protected fileTransfer: FileTransfer,
|
||||||
protected mimeUtils: CoreMimetypeUtilsProvider,
|
protected mimeUtils: CoreMimetypeUtilsProvider,
|
||||||
logger: CoreLoggerProvider) {
|
logger: CoreLoggerProvider,
|
||||||
|
platform: Platform) {
|
||||||
this.logger = logger.getInstance('CoreWSProvider');
|
this.logger = logger.getInstance('CoreWSProvider');
|
||||||
|
|
||||||
if (this.appProvider.isMobile()) {
|
platform.ready().then(() => {
|
||||||
(<any> cordova).plugin.http.setHeader('User-Agent', navigator.userAgent);
|
if (this.appProvider.isMobile()) {
|
||||||
}
|
(<any> cordova).plugin.http.setHeader('User-Agent', navigator.userAgent);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue