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