I have a floating Ionic Header so when I scroll, the header stays at the top of the page. The problem is that the header goes past the scrolling bar on the right side of the page which looks really crappy. I want it to stop before the scrolling bar, but I’m not sure how anyone have any ideas? Actually, this website is a great example of the kind of header that i want lol. I’m not sure why my header laps over the scroll bar though
so, the profilePic from the same place using the same method loads fine.
also, if I use “src=assets/videos/Sermon1.mp4”, that works fine.
here is my data.json
"name": "Finding Grace",
"profilePic": "/assets/img/stuffs/PastorEvaFace.jpg",
"sermonVideo": "/assets/videos/Sermon1.mp4",
"about": "Learn to fnid Grace in every circumstance and realize just how much God has given you.",
"sum": "God has given us grace, we just need to open our eyes.",
"location": "Everywhere",
"id": "1"
anyone have any idea why it can’t run the video? profilePic runs fine…
I get the error “No video with supported format and mime type not found” when i try video
Good day house, please I need your help, I noticed that my ionic app doesn’t detect change when an update is made. I have a profile page that displays authenticated users data from an api( i.e username and email). Also, a profile_edit page that updates user data. But I noticed that when I update user data and navigate to the profile page, the change doesn’t reflect on the profile page unless I navigate to another page and back before it detects the change. I tried using BehaviourSubject but I don’t really know how to implement it. I have spent days on this, please I need your assistance. Thanks. My code below
profile.page.ts
public customerData: any
constructor ( WC: WoocommerceService) {
}
ngOnInit() {
// this retrieve authenticated user id
this.isUserLoggedIn = localStorage.getItem('currentUserId');
// this retrieve user data from an api call
this.WC.getUserInfo(this.isUserLoggedIn).subscribe((data)=>{
this.customerData = data;
});
}
export class WoocommerceService {
private authenticationState = new BehaviorSubject<any>([]);
data = this.authenticationState.asObservable();
//getting authenticated users details from woocommerce
getUserInfo(id){
this.apiUrl = `${this.siteUrl}${this.woocommercePath}customers/${id}?consumer_key=${this.consumerKey}&consumer_secret=${this.consumerSecret}`;
console.log('API url for retrive customer: ', this.apiUrl);
this.customerData = this.http.get(this.apiUrl);
// STORE WHATEVER DATA YOU WANT IN THE SUBJECT
this.authenticationState.next(this.customerData);
return this.customerData;
}
// this update user data
updateCustomerData(id, customerDataUpdated){
let headers = new HttpHeaders ({
"Content-Type" : "application/json"
});
this.apiUrl = `${this.siteUrl}${this.woocommercePath}customers/${id}?consumer_key=${this.consumerKey}&consumer_secret=${this.consumerSecret}`;
// console.log('API url for retrive customer data: ', this.apiUrl);
return new Promise((resolve, reject) => {
this.http.put(this.apiUrl, customerDataUpdated, {headers} ).subscribe(
response => {
resolve(response);
this.authenticationState.next(this.customerData);
console.log('Customer Data Updated: ', response);
},
error => {
resolve(error);
console.log('Customer Data Updated failed ', error);
}
)
});
}
}
i want to make a simple food ordering mobile app, but i’m struggling with the decision of the right backend solution. I need the backend to keep track of the cart and maybe also the payment.
And of course user data, but thats something every backend can do.
What would be a good solution for that? i thought about using firebase, but i’m not sure if thats right.
Hi everyone! Does anyone have a capacitor share example? I need to share some text with WhatsApp. I don’t know if there is a deep link to reference.
I literally have
import { Plugins } from '@capacitor/core';
const { Share } = Plugins;
let shareRet = await Share.share({
title: 'See cool stuff',
text: 'Really awesome thing you need to see right meow',
url: 'http://ionicframework.com/',
dialogTitle: 'Share with buddies'
});
I got the following error: ERROR Error: Uncaught (in promise): Web Share API not available
Hi,
I want to have a calendar that pulls information from a database in firestore and populates the corresponding dates in the calendar. For example if there was an event on the 28th march I want the calendar to connect to firebase where there is an event inside a collection and when the calendar loads, have the dates from firebase inside the calendar.
I have made the basic calendar in Ionic using ion-2-calendar. I have also established a connection to firebase inside the project and verified this with a console.log() statement which pulls from a sample database collection called competition with a date inside it
The tester collection includes a string for date i.e “28th May” and also a timestamp with the time as well in the format March 28th 2020 I’m not sure which is best to use.
If anyone could help me with this, it would be appreciated
TS
import { Component } from ‘@angular/core’;
import {tap} from ‘rxjs/operators’;
import {AngularFirestoreModule, AngularFirestore} from ‘@angular/fire/firestore’;
import {Injectable} from ‘@angular/core’;
I have installed the latest version of ionic:
C:\Users\Bilal>npm install -g @ionic/cli
C:\Users\Bilal\AppData\Roaming\npm\ionic -> C:\Users\Bilal\AppData\Roaming\npm\node_modules@ionic\cli\bin\ionic
@ionic/cli@6.6.0
added 227 packages from 157 contributors in 276.868s
but when I try to create an app it gives me this error, some help please:
C:\ionic>ionic start reprise blank
No valid exports main found for ‘C:\Users\Bilal\AppData\Roaming\npm\node_modules@ionic\cli\node_modules\is-promise’
I’m building a simple chat application and I’m facing an issue with setting the scroll position in iOS. It seems to work find on other platforms, including browser. Ionic v5, using Capacitor, building with Appflow.
The container needs to be scrolled to the bottom by default when the data loads. The page then listens for new messages. If a new message is added then the page should scroll to the bottom if the scroll position is within the bottom 150% of the client height. If not, a FAB appears indicating a new message has appeared and the user can select the button to scroll to the button.
The markup is as so. I have a custom domChange directive which listens to dom changes in the div. I prefer to put the scroll logic here as I was experiencing bugs putting it in the message listener before.
<ion-content>
<div class="chat-container" (click)="containerClick();" (scroll)="scroll($event)" #chatContainer>
<div class="wrapper" *ngIf="messages.length > 0" (domChange)="onDomChange($event)">
<!-- Excuse my inline styling, this is just for debug -->
<div style="width:100%;text-align:center;padding:20px;" *ngIf="loadingMore"><ion-spinner></ion-spinner></div>
<ng-container *ngFor="let message of messages">
<chat-bubble
[sent]="message.from === authService.user.id"
[delivered]="message.delivered"
[position]="message.position"
[timestamp]="message.createdAt.getTime()"
[content]="message.content"
>
</chat-bubble>
</ng-container>
</div>
</div>
<ion-fab vertical="bottom" horizontal="center" slot="fixed" *ngIf="showScrollBtn">
<ion-fab-button size="small" (click)="scrollToBottom()"><ion-icon name="arrow-down-outline"></ion-icon></ion-fab-button>
</ion-fab>
</ion-content>
The CSS is relatively simple but I am use a column-reverse flexbox and I think this might be one of the causes to the issue. The column-reverse means the webview renders the scroll at the bottom by default.
public onDomChange(event: any) {
if(event.addedNodes.length > 0 && event.addedNodes[0].localName == 'chat-bubble') {
const scrollTop = (this.platform.is('ios') && !this.platform.is('mobileweb')) ? this.chatContainer.nativeElement.scrollTop + this.chatContainer.nativeElement.scrollHeight : this.chatContainer.nativeElement.scrollTop;
/*
* Because of the column-reverse iOS sees the bottom of the div as scrollTop = 0 and the top of the div as scrollTop = -scrollHeight
* Android sees it as scrollTop = scrollHeight at the bottom and scrollTop = 0 at the top
*/
const scrollHeight = this.chatContainer.nativeElement.scrollHeight;
const clientHeight = this.chatContainer.nativeElement.clientHeight * 1.5;
const newMessageIndex = this.messages[this.messages.length - 1].index;
if((this.messages.length <= 30 || scrollHeight - scrollTop <= clientHeight) && this.channel.lastConsumedMessageIndex < newMessageIndex) {
this.scrollToBottom();
} else if(this.channel.lastConsumedMessageIndex < newMessageIndex) {
this.showScrollBtn = true;
}
}
}
The scrollToBottom() function works absolutely fine when triggered by the button click event but doesn’t seem to do anything when triggered in the domChange trigger. I think this is because the trigger is called before the chat bubble element has rendered but I’m not sure how to fix this.
I’m looking for some general guidance going forward.
I’ve got 2 Ionic 3 projects. One personal and one work one. The personal one is currently causing me the issues.
I can’t deploy to the browser because it doesn’t build the cordova_plugins.js file.
I’ve tried removing browser and adding browser, but this comes back
(node:19649) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): SyntaxError: Unexpected token < in JSON at position 258
(node:19649) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Not helpful.
I know my plugins are outdated (See below), but every time I update them, I get caught in “Dependency Hell” and have to go back to where I started and hope that it magically works again.
I’m concerned that if I update the Ionic CLI, the work project is going to break and that’s not going to be deployable.
Will updating the CLI break old projects?
Also, is it possible to run a V3 app and a V4 app on the same computer?
Any help would be much appreciated. As you can tell, I’m getting frustrated with this.
Hello! I am trying to implement navigation between tabs. I read the following documentation: https://ionicframework.com/docs/api/tab-button but it is not solving my use case. Here is what I am trying to do:
Here is the issue though! It won’t compile unless I have a tab attribute to each ion-tab-button that would be responsible to navigate to another component (if I understood the doc correctly).
I tried to add a (click) to illustrate that I needed the navigation to occur when I click on the tab (I know that this behaviour occurs in a general use case due to the tab attribute).
Here is the navigation function: (I just realized it is missing a relativeTo param, but the reason for the bug really is the template)
I know that the router that I would need to use would be different than the router above (router-outlet’s router), but the method above shows what I want to achieve with the tabs. In other words, is there a way I can access the tabs’ router?
Note that the error message I am getting is pretty odd:
I new here and on ionic. I want to use ionic but after installation, i can not create a app.
This my error :
Mianssodila@Mianssodila-PC MINGW64 /e/HybridApps
$ ionic --version
6.6.0
Mianssodila@Mianssodila-PC MINGW64 /e/HybridApps
$ ionic start MyAPPv1 blank
√ Preparing directory .\MyAPPv1 - done!
√ Downloading and extracting blank starter - done!
–no-confirm: Integrate your new app with Capacitor to target native iOS and Android? No
Ionic Enterprise, platform and solutions for teams by Ionic
Powerful library of native APIs
A supercharged platform for teams
Learn more: https://ion.link/enterprise
npm.cmd i
npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.12: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! Unexpected end of JSON input while parsing near ‘…:"^1.10.0"},“dist”:{"’
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Mianssodila\AppData\Roaming\npm-cache_logs\2020-04-26T01_56_54_998Z-debug.log
[ERROR] An error occurred while running subprocess npm.
npm.cmd i exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
I am trying to transfer the data on tab 3 (Reserve) to the tab 4 (MyTables). I am going to be completely honest. I do not know how to write in ionic at all. Person teaching doesnt help as he talks like we know. Any help would be appreciated. I am almost at the point to pay someone to do it. I can zip the file if needed or uploaded but thats alot of code for 5 folders.
Hello,
I have issues to get my app approved by Apple. My web app is using WebRTC which is not supported by the default WebView of Apple. Because of this, I’m using the “SafariViewController Cordova Plugin” which opens my web app in a SafariViewController / Safari window after clicking on a button. Then my web app asks the user for the permissions for the camera, microphone and location access. This request is displayed in the default Safari dialog and can’t be modified. This looks like to be the problem.
Apple rejected my app with this information:
Please revise the relevant purpose string in your app’s Info.plist file to specify why the app is requesting access to the user's microphone and location.
As you can see here, my app has this kind of informations in the Info.plist:
<key>NSMicrophoneUsageDescription</key>
<string>To access your microphone so that you can talk with a chat partner.</string>
<key>NSCameraUsageDescription</key>
<string>To access your camera roll so that you can upload images, show you to a chat partner and scan QR codes.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>To access your camera roll so that you can upload images.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>To access your camera roll so that you can upload images.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>To access your position so that a chat partner can be searched near you.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>To access your position so that a chat partner can be searched near you.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>To access your position so that a chat partner can be searched near you.</string>
<key>NSLocationUsageDescription</key>
<string>To access your position so that a chat partner can be searched near you.</string>
They are not displayed because it’s not possible to ask in a Safari window for these permissions with a custom dialog like described in the Info.plist. It’s always a default dialog.
Did someone of you have this kind of problem?
My app is adding a native functionality to be able to scan QR codes. When the user is using this functionality for the first time, there is a dialog with the message set in the Info.plist file. This permission is not “transferred” to the new SafariViewController / Safari window so that the Safari window has to ask for these permissions again with a default dialog.
I’m wondering what’s the best way to show or hide HTML elements based on conditions in Ionic applications. I’m not sure if I’m currently doing it right / the way it should be.
Let’s say I have a couple of themes (products) displayed by cards with the ion-card components. Some of the products can be purchased via InApp Purchases and others are free.
I now have to make sure which one are free, paid, have been purchased etc. and therefore display either a click function to open a modal or navigate to the page where the product can be purchased.
My HTML code currently looks like this:
<ion-grid>
<ion-row>
<ion-col *ngFor="let theme of themes">
<!-- If it's a free theme or already owned, display useTheme function -->
<ion-card *ngIf="theme.category == 'free' || theme.owned == true" (click)="useTheme(theme.themeID)">
<ion-badge *ngIf="theme.owned == true">purchased</ion-badge>
<ion-img [src]="theme.src"></ion-img>
</ion-card>
<!-- If it's a paid theme and not owned, provide a link to the purchase page -->
<ion-card *ngIf="theme.category == 'paid' && theme.owned == false" routerLink="link/to/theme/purchase">
<ion-badge>1,99 EUR</ion-badge>
<ion-img [src]="theme.src"></ion-img>
</ion-card>
<ion-text>{{theme.description}}</ion-text>
</ion-col>
</ion-row>
</ion-grid>
Is this the right way? Or do you suggest handling the if/else stuff in the array item in my .ts files and avoiding *ngIf-conditions like these in my HTML?
I’m asking because sometimes I face the problem that the images of my paid products are not displayed on the initial app start. They just show up as soon as I click on some elements or navigate to a different page.
Thank you in advance for any suggestions and best regards!
Hi guys, kind of new to using firebase here and I’m running into an issue while developing an Android app.
I’m trying to do google authentication according to this little guide here
And everything goes to plan, except, that when I choose my google account, I get redirected to my app IN THE BROWSER, instead of natively, which messes everything up, as the browser just throws errors and other issues while trying to compile the app.
How do I fire the callback I provided in the function and redirect back to the app, instead of having to continue in the browser?
Hi there I hope everyone is safe, I been having this problem for like a few days now. Im trying to update my user info and works except for the photo but my form doesnt wanna read the file. i have use another pluging with it camerasource and cameraresulttype to be able to use the camera in the browser as well, the thing is that it works just fine in Desktop but when it comes to a real device android it does not work I try to do some console.log(this.form.get(‘photo’).value and in browser console, works fine i can see the img or photo file but in android it gives me null.
Please help thank you
this are the file:
ngOnInit() {
I am trying to create a PWA app that downloads some files (e.g. PDF, Word, Images etc) to a folder on the device. The files will total up to around 700MB or more. The requirement is to develop the app as a PWA and install as a standalone to a mobile device.
I am using Ionic 5 with Angular and Capacitor. Capacitor has a Filesystem plugin which allow to write files to disk easily but I noticed it is writing to a FileStorage within the IndexedDB. From what I read there is a storage limit if it’s being stored within the IndexedDB and also files may be purged.
Is it possible to read/write the files via PWA as if it’s a native / cordova app? It would be probably be something like a Google Drive app but in PWA form.
The reason we are going the PWA route is to skip the app / play store. Is this idea possible with PWA or a better way is to build it as a cordova / native app?