mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
sharesd and video bug ios
This commit is contained in:
+19
-36
@@ -106,8 +106,8 @@ export class HomePage implements OnInit {
|
||||
private modalController: ModalController,
|
||||
private zone: NgZone
|
||||
|
||||
// private ChunkService: ChunkService,
|
||||
// private StreamService: StreamService
|
||||
// private ChunkService: ChunkService,
|
||||
// private StreamService: StreamService
|
||||
) {
|
||||
if (SessionStore.exist) {
|
||||
this.user = SessionStore.user;
|
||||
@@ -143,7 +143,6 @@ export class HomePage implements OnInit {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sendIntent.setRouteService(this.router)
|
||||
|
||||
}
|
||||
@@ -162,47 +161,26 @@ export class HomePage implements OnInit {
|
||||
SendIntent.checkSendIntentReceived().then((result: any) => {
|
||||
alert('shared')
|
||||
if (result) {
|
||||
console.log('SendIntent received');
|
||||
console.log(JSON.stringify(result));
|
||||
console.log('SendIntent received');
|
||||
console.log(JSON.stringify(result));
|
||||
}
|
||||
if (result.url) {
|
||||
let resultUrl = decodeURIComponent(result.url);
|
||||
Filesystem.readFile({path: resultUrl})
|
||||
|
||||
.then(async (content) => {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: PublicationsPage,
|
||||
componentProps: {
|
||||
item: "item",
|
||||
intent: content.data
|
||||
},
|
||||
cssClass: 'new-action modal modal-desktop',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
modal.onDidDismiss().then(() => {
|
||||
SendIntent.finish();
|
||||
});
|
||||
await modal.present();
|
||||
|
||||
|
||||
console.log(content.data);
|
||||
})
|
||||
.catch((err) => console.error(err));
|
||||
window["sharedContent"] = result;
|
||||
this.zone.run(() => this.router.navigateByUrl("/home/publications"));
|
||||
}
|
||||
}).catch(err => console.error(err));
|
||||
}).catch(err => console.error(err));
|
||||
|
||||
}
|
||||
ngOnInit() {
|
||||
|
||||
if(window["sharedintend"]) {
|
||||
/* if (window["sharedintend"]) {
|
||||
this.router.navigateByUrl("/home/publication");
|
||||
}
|
||||
} */
|
||||
|
||||
window["this.router"] = this.router
|
||||
|
||||
/* this.checkSendIntentReceived() */
|
||||
if (this.platform.is('ios'))
|
||||
this.checkSendIntentReceived()
|
||||
|
||||
if ("serviceWorker" in navigator) {
|
||||
navigator.serviceWorker.onmessage = (event) => {
|
||||
@@ -298,10 +276,15 @@ export class HomePage implements OnInit {
|
||||
if (!this.platform.is('desktop')) {
|
||||
App.addListener('appStateChange', ({ isActive }) => {
|
||||
if (isActive) {
|
||||
sendIntent.setRouteService(this.router)
|
||||
this.checkSendIntentReceived();
|
||||
if (this.platform.is('ios')) {
|
||||
this.checkSendIntentReceived();
|
||||
} else if (this.platform.is('android')) {
|
||||
sendIntent.setRouteService(this.router)
|
||||
} else {
|
||||
}
|
||||
|
||||
console.log('App is in the foreground');
|
||||
this.checkSendIntentReceived()
|
||||
/* this.checkSendIntentReceived() */
|
||||
} else {
|
||||
// The app is in the background.
|
||||
console.log('App is in the background');
|
||||
|
||||
Reference in New Issue
Block a user