Posts

Showing posts from April, 2020

ionic5 push notifications

ionic cordova plugin add phonegap-plugin-push --variable SENDER_ID="*********" npm install @ionic-native/push in config.xml <resource-file src = "google-services.json" target = "app/google-services.json" /> in app.module.ts import { Push } from '@ionic-native/push/ngx' ; in providers add-->push in app.component.ts import { Push , PushObject , PushOptions } from '@ionic-native/push/ngx' ; private push : Push ,-->in constructor ngOnInit(){ this.pushnotification (); } pushnotification (){ this . push . hasPermission () . then (( res : any ) => { if ( res . isEnabled ) { console . log ( 'We have permission to send push notifications' ); this . sendmsg (); } else { console . log ( 'We do not have permission to send push notifications' ); } }); } sendmsg (){ const options : PushOptions = { android ...

send data in navigation using ionic5

https://ionicacademy.com/pass-data-angular-router-ionic-4/ send page: import { Router , NavigationExtras } from '@angular/router' ; let paymentDetails = { amount : this . ElectricityForm . value . Amount , provider_code : this . providercode , connection_provider : this . ElectricityForm . value . SelectBoard , account_number : this . ElectricityForm . value . ConsumerNO , bill_type : "payment" , type : "electric" , selectstate : this . ElectricityForm . value . SelectState , statecode : this . statecode } let navigationExtras : NavigationExtras = { queryParams : { special : JSON . stringify ( paymentDetails ) } }; this . router . navigate ([ "/paybillpayment-options" ], navigationExtras ) receive page:: import { ActivatedRoute , Router } from '@angular/router' ; construct...