it’s working in background and foreground when app not killed , but when app killed i received notification i click it but he don’t navigate to page detail
Hi everyone Im working on a PWA which contains slider and Im using ionic slides to achieve that.
Everything works fine with slides but I have a problem which I couldn’t solve,
I need to get the active index of slides when page loads before user does anything more.
I realized that I can only get index AFTER page is loaded with events like after swiping slides
by user.
I tried different lifecycle hooks and none of them works.
So i tried “ionSlidesDidLoad” event and it returns wrong index
my .html
@ViewChild('theSlides' , { static: true }) theSlides: IonSlides
moveToNext(slides) {
slides.slideNext()
//HERE GETACTIVEINDEX RETURNS CORRECT INDEX!
slides.getActiveIndex().then((index: number) => {
var value = this.peers[index]
})
}
moveToPrev(slides) {
slides.slidePrev();
//HERE GETACTIVEINDEX RETURNS CORRECT INDEX!
slides.getActiveIndex().then((index: number) => {
var value = this.peers[index]
})
ionSlidesDidLoad(slides) {
//HERE RETURNS 1 EVERY TIME EVEN WHEN MY ARRAY HAS 1 ELEMENT AND IT SHOULD BE 0
slides.getActiveIndex().then(
(index:number) => {
var value = this.peers[index]
}
)
}
so when ionSlidesDidLoad event fires getActiveIndex returns 1 even when the peers array has 1 element so this.peers[index] will be “undefined”
can you tell me whats wrong and how can I get the active index of slider when page loads?
Best regards
When I try to record and upload a video to the server, I’m getting The resource doesn’t support the specified Http Verb error. I have ***** for all headers on the API end. But no use. Please help me out this.
I have a problem with ion-nav component. In my UI I have a modal with an entry point for all my app. There is an internal navigation showing different pages (signin, signup, password-recovery …). All of this works fine. But the problem is: when I put an ion-input inside any page inside the ion-nav it doesn’t work properly. For example, the clearInput icon does not appear. Also, I have imported Angular Material in the project, and the same thing happens with the mat-form-field as well. They render and work perfectly in the entire app except within the ion-nav component.
I have created the function to save and record and stop the recording, but it does not work, it creates the file but does not store the recording, the file weighs 0B.
I use a xiaomi mobile with android 10.
I have the following code
startRecord() {
if (this.platform.is('ios')) {
this.fileName = 'record' + new Date().getDate() + new Date().getMonth() + new Date().getFullYear() + new Date().getHours() + new Date().getMinutes() + new Date().getSeconds() + '.mp3';
this.filePath = this.file.documentsDirectory.replace(/file:\/\//g, '') + this.fileName;
this.audio = this.media.create(this.filePath);
} else if (this.platform.is('android')) {
this.fileName = 'record'+new Date().getDate()+new Date().getMonth()+new Date().getFullYear()+new Date().getHours()+new Date().getMinutes()+new Date().getSeconds()+'.mp3';
this.filePath = this.file.externalDataDirectory.replace(/file:\/\//g, '') + this.fileName;
this.audio = this.media.create(this.filePath);
this.audio.startRecord();
}
this.recording = true;
}
stopRecord() {
this.base64.encodeFile(this.filePath).then(
(base64: any) => {
let dataAudio = base64.substr(34, base64.length);
let x = base64.substr(13, base64.length);
x = "data:audio/mpeg;base64" + x;
console.log("base64",x);
this.dataAudios.push(this.sanitizer.bypassSecurityTrustUrl(x));
this.dataUpload.push(dataAudio);
}, err=>{
console.log("base64 err", err);
});
this.recording = false;
}
I’m trying to find out what the default way is to showing ionicons in Ionic Vue. Im unable to use them when trying to import and also when using them inside other components (like icons inside input field or buttons).
What packages do I need, aside from “@ionic/vue”, or is that enough?
Current behavior:
No matter what i do, there is no way to make iOS Simulator load the custom fonts.
I’ve tested everything I’ve found across different Ionic versions and all platforms and the current setup works perfectly in Google Chrome Browser, Safari Browser, Android Device and Android Emulator but not in iOS Simulator (could not test it in iOS Device since i don’t have one yet).
No custom font dependent component is shown except when commenting its font styling (second image).
// Ionic Variables and Theming. For more info, please see:
// http://ionicframework.com/docs/theming/
/** Ionic CSS Variables **/
:root {
// --ion-font-family: "GothamMedium", "Roboto";
// font-family: var(--ion-font-family) !important;
--ion-font-family: 'Gotham' !important;
font-family: 'Gotham' !important;
//... other non-related theming variables
}
Ionic-suggested fonts.scss (i was going to deprecate it if the globals.scss code block functioned correctly, or the inverse). I do use mixins to make styling faster.
I’m trying to create a media viewer lightbox using IonModal and IonSlides, however when placing an image in a slide, it is not naturally zoomable (pinch-to-zoom). There are a number of really old posts that mention placing the image in a component called IonScroll, which has a “zoom” prop, but that doesn’t seem to exist anymore, or at least not in the React version.
Is there a current or updated approach to this problem?
and the console log on page initial draw
there should be ONE call to created for press and dbltap for each ion-row
dbltap means edit row, press means delete
I am using ion-content and it’s scroll methods in the Ionic react.
I want to update the header based on the scroll.I am using onIonScroll to detect the scrollY position. in which I passed handleScroll function
I also want to navigate to a specific point with scrollToPoint method.
The issue I am facing is I have some code to update the header for in handleScroll, but when I call scrollToPoint this scroll function handleScroll is called internally and updates the value.
I want to detect when the function is called by user action and when the function is called from handle scroll
I am having a trouble when I try to use cordova camera plugin in my application.
Actually, I’ve tried to give permissions to the application using https://ionicframework.com/docs/native/android-permissions but this gives me Has permission? false and although I am trying to concede permissions, this is not working.
I’ve also installed cordova-camera-plugin, as I told you before, but debugging gives me:
vendor.js:85402 Native: tried calling Camera.getPicture, but the Camera plugin is not installed.
pluginWarn @ vendor.js:85402
vendor.js:85408 Install the Camera plugin: 'ionic cordova plugin add cordova-plugin-camera'
Although I’ve removed and added the platform again this is still not working.
I watched this talk by Mike Hartington and Neil Manvar on Real time application monitoring for Ionic Apps with Sentry
I’m using the same Make file as per Mike’s git repo which is an app that deliberately throws errors.
When I execute the file, I can see that the Sourcemaps are being created, uploaded and linked to my releases but I’m not getting the stack traces on the errors.
I cloned the Sentry-React-Ionic project and committed it to my own repo, then also set it up on my Sentry account to see if I get the same results as I am getting with my project.
The results: Neither project gives stack traces when running it locally with “ionic serve” but when deployed to the device, the Sentry-React-Ionic app links it’s Sourcemaps correctly but mine, as mentioned, are not.
So, finally, the question. As both projects’ Sourcemaps are generated and uploaded in the same way but yielding different results, where else should I be looking to troubleshoot this?
in Ionic 5 I use ion-alert and when this comps are rendered I see <button> tag instead <ion-button>.
So, why Ionic don’t use Ionic comps for button?
Or there’s a way to use (that I don’t know).
I’m trying to access the shared iCloud Keychain in my Ionic application, but it’s not working.
I have another MacOS app that writes some data under this path:
com.app.keychain.token
And these data are available and shared within another iOS app of mine, so the iCloud keychain works.
Now I’m trying to connect it to a third Ionic app. In Xcode I have enabled SignIn&Capabilities > Keychain Sharing > KeychainGroup as com.myAccount (same as in the iOS and MacOS apps), and then wrote this code
import { Keychain } from '@ionic-native/keychain/ngx';
let keychainId = 'com.app.keychain'
let keychainTokensId = 'token'
let keychain = new Keychain()
console.log(keychainId+'.'+keychainTokensId)
keychain.get(keychainId+'.'+keychainTokensId)
.then(value => console.log('Got value', value))
.catch(err => console.error('Error getting', err));
But it always returns null. (I’ve tested on a real device with the correct AppleId and some data under that keychain path)
NB: in my iOS and MacOS app the Keychain Group (com.myAccount) differs from the path I use to store the data (com.app.keychain.token), I don’t know if this may cause some problem, anyway on iOS-MacOS keychain sharing works.
I’m trying to use the Composition API with Ionic Vue but it’s throwing an error when trying to compile. The error is coming from the use-song-list.ts and the errors I’m getting are
Type 'Ref<never[]>' is missing the following properties from type 'never[]': length, pop, push, concat, and 28 more.
Type 'Ref<null>' is not assignable to type 'null'.
Type 'Ref<boolean>' is not assignable to type 'boolean'.
What am I doing wrong? Why can’t I assign the response, error and fetching constants to the songs object properties?