mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
shared image when app its close
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="image/*" />
|
||||
@@ -30,6 +30,7 @@
|
||||
<data android:mimeType="image/*" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<provider android:authorities="${applicationId}.fileprovider" android:exported="false"
|
||||
android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
|
||||
<meta-data android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
|
||||
@@ -87,6 +87,7 @@ import { CreateProcessPageModule } from './modals/create-process/create-process.
|
||||
import { CreateProcessPage } from './modals/create-process/create-process.page';
|
||||
import { LoggingInterceptorService } from './services/logging-interceptor.service';
|
||||
import { PopupQuestionPipe } from './modals/popup-question.pipe';
|
||||
import { SendIntentService } from './services/shareIntent';
|
||||
|
||||
|
||||
// import { ServiceWorkerModule } from '@angular/service-worker';
|
||||
@@ -213,6 +214,7 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
||||
FileOpener,
|
||||
DocumentViewer,
|
||||
{ provide: HTTP_INTERCEPTORS, useClass: LoggingInterceptorService, multi: true },
|
||||
SendIntentService
|
||||
|
||||
],
|
||||
bootstrap: [AppComponent],
|
||||
|
||||
@@ -152,7 +152,7 @@ export class HomePage implements OnInit {
|
||||
|
||||
|
||||
|
||||
async checkSendIntentReceived(result) {
|
||||
async checkSendIntentReceived() {
|
||||
|
||||
|
||||
SendIntent.checkSendIntentReceived().then((result: any) => {
|
||||
@@ -294,29 +294,9 @@ export class HomePage implements OnInit {
|
||||
if (!this.platform.is('desktop')) {
|
||||
App.addListener('appStateChange', ({ isActive }) => {
|
||||
if (isActive) {
|
||||
/* this.checkSendIntentReceived("value") */
|
||||
// The app is in the foreground.
|
||||
/* fetchData()
|
||||
.then((value) => {
|
||||
console.log('fetchData was successful in file2.ts', value);
|
||||
this.imageToBase64(value)
|
||||
.then((base64Data) => {s
|
||||
if (base64Data) {
|
||||
// Use the base64 data as needed
|
||||
console.log('Base64 data:', base64Data);
|
||||
} else {
|
||||
console.error('Base64 data is null');
|
||||
}
|
||||
});
|
||||
if (value)
|
||||
this.checkSendIntentReceived(value)
|
||||
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error in file2.ts:', error);
|
||||
}); */
|
||||
/* sendIntent.setRouteService(this.router) */
|
||||
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');
|
||||
|
||||
@@ -70,13 +70,12 @@ export class PublicationsPage implements OnInit {
|
||||
public ThemeService: ThemeService,
|
||||
public p: PermissionService,
|
||||
private storage: Storage,
|
||||
private navParams: NavParams,
|
||||
|
||||
) {
|
||||
this.months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||
this.days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
||||
|
||||
this.intent = this.navParams.get('intent');
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -91,6 +90,7 @@ export class PublicationsPage implements OnInit {
|
||||
});
|
||||
|
||||
this.hideRefreshButton();
|
||||
this.intent = window["sharedContent"]
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { SendIntent } from "send-intent";
|
||||
import { Router } from '@angular/router';
|
||||
import { CallbackScheduler } from './callbackScheduler';
|
||||
|
||||
class SendIntent {
|
||||
export class SendIntentService {
|
||||
|
||||
Router!: Router
|
||||
|
||||
@@ -20,6 +20,7 @@ class SendIntent {
|
||||
// event handler
|
||||
if (result.url) {
|
||||
this.onReceive(result)
|
||||
|
||||
}
|
||||
}).catch(err => console.error(err));
|
||||
}
|
||||
@@ -38,13 +39,12 @@ class SendIntent {
|
||||
let resultUrl = decodeURIComponent(result.url);
|
||||
Filesystem.readFile({path: resultUrl}).then(async (content) => {
|
||||
|
||||
this.Router.navigateByUrl("/home/publication");
|
||||
this.Router.navigateByUrl("/home/publications");
|
||||
|
||||
alert('shared')
|
||||
console.log(content.data);
|
||||
window["sharedContent"] = content.data;
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
export const sendIntent = new SendIntent()
|
||||
export const sendIntent = new SendIntentService()
|
||||
|
||||
Reference in New Issue
Block a user