Quantcast
Channel: Ionic Forum - Latest posts
Viewing all 228551 articles
Browse latest View live

Building with Stencil: Tabs

$
0
0

Originally published at: Building with Stencil: Tabs - Ionic Blog

As user interfaces (UI) go, tabs are a particularly useful pattern. The word “tab” invokes images of beige manila file folders. Early UI mimicked this physical property by placing buttons along the top of a dedicated space. Mobile devices, with their confined spaces, find the tab pattern in accordions, bottom button bars, and more. In…


Ionic/Vue add one Class to the Others

$
0
0

Isn’t what @tho-masn said what you want?

Vue’s documentation (link):

You can have multiple classes toggled by having more fields in the object. In addition, the :class directive can also co-exist with the plain class attribute. So given the following template:

<div
  class="static"
  :class="{ active: isActive, 'text-danger': hasError }"
></div>

Nested routes removes animation on RouterOutlet component

$
0
0

Hmmm… I tried doing the routes like that and it was not resolving properly. Let me try it again, if it’s acting funky I’ll record a video and post here.

Nested routes removes animation on RouterOutlet component

$
0
0

Well that worked! I swear that was my first choice and what ended up happening was other Components were picking up the route. Does order matter in this object? Either way, glad to see it’s resolved and I’m doing it right this time! Thanks!

Nested routes removes animation on RouterOutlet component

$
0
0

Good to hear!

I don’t see specifics of how Vue does route matching in the documentation but typically you want the most specific first if there were possible matches as most router logic starts at the top and stops on the first match (from my experience at least in .NET and Laravel). In your case, it shouldn’t matter.

Also make note of this issue that may or may not be related. It is fixed in Ionic 6.

Set focus on button not working

$
0
0

my template (I have another topic on v-for not allowing for constructed onclick and other attributes constructed dynamically, Ion-button color attribute from variable)

<template>
  <ion-page>
    <ion-content :fullscreen="true"  >    
     <div id="container" v-if="type === a">
          <ion-row class="typea" >
          <ion-button
            color="a1"
            ref="first_button_1" 
            @click="setTarget( type,  labels[0]  )" alt="type 1">
            {{labels[0]}}                               
          </ion-button>
          <ion-button
            color="a2"
            @click="setTarget( type,  labels[1]  )" alt="type 2">
            {{labels[1]}}
          </ion-button>
          </ion-row>
          <ion-row class="typea">
          <ion-button
            color="a3"
            @click="setTarget( type, labels[2]  )" alt="type 3">
            {{labels[2]}}
          </ion-button>
          <ion-button
            color="a4"
            @click="setTarget( type, labels[3]  )" alt="type 4">
            {{labels[3]}}
          </ion-button>
          </ion-row>
           <ion-button class="backbutton backbutton_a" @click="back" color="tertiary" >return to configuration</ion-button>
        </div>
        <div id="container" v-else>
          <ion-row class="typeb" > 
            <ion-button
              color="a1"
              ref="first_button_2"
              @click="setTarget( type, labels[0]  )" alt="type1">
              {{labels[0]}}
            </ion-button>
          </ion-row>
          <ion-row class="typeb">
            <ion-button
              color="a2"
              @click="setTarget( type, labels[1]  )" alt="type2">
              {{labels[1]}}
            </ion-button>
          </ion-row>
          <ion-row class="typeb">
            <ion-button
              color="a4"
              @click="setTarget( type, labels[2]  )" alt="type4">
              {{labels[2]}}
            </ion-button>
          </ion-row>
           <ion-button class="backbutton backbutton_b" color="tertiary" @click="back" >return to configuration</ion-button>
    </ion-content>
  </ion-page>
</template>

when this page is shown, if type=‘a’, then ALWAYS the button color=“a3” is selected. if type b, then ALWAYS the back button is selected, and when accessibility is enabled, the button alt text is spoken in either case

i have tried all the things others have tried, $nextTick(), setTimeout
notice I am doing this in didEnter()… which SHOULD be after everything is completed according to the lifecycle doc
ref lifecycle ref

ionViewDidEnter - If you see performance problems from using ionViewWillEnter when loading data, you can do your data calls in ionViewDidEnter instead. *However, this event will not fire until after the page is visible to the user*, 
ionViewDidEnter(){
 console.log(" sending focus change, refs="+JSON.stringify(Object.keys(this.$refs),null,2)); 
 const dest= ('first_button_'+this.prop[0])    
        console.log("dest="+dest)
        this.$refs[dest].$el.focus();
}

prop is ‘1’ or ‘2’
the console shows(here for type 2)

  [log] -  sending focus change, refs=[
  "first_button_2"]
⚡️  [log] - dest=first_button_2

trying to set the focus to the top or top/left button (this for blind user, stats show 1st button would be picked 75% of the time, so save them having to hunt for it. )

so, what am I missing?
ionic v = 6.16.3

Capturing app console.log on ios live app, not usb debugging connected

$
0
0

I ended up making a capacitor plugin to support enough of socket.io-client for my purposes

Streaming live radio on android using Howler.js

$
0
0

Greetings. I’m trying to build a simple radio streaming android application using capacitor.js, ionic-vue, and howler.js. This is just a practice project as I’m new to the above-mentioned libraries. I followed the howler.js streaming radio docs and managed to get the application to work to my satisfaction (on the browser). The problem however arises when I generate an android apk and try to run the app on a native android device or android emulator. The radio stream just doesn’t play, it loads forever. It works perfectly fine when running it on the browser using ionic serve.

I’ve tried to search for a solution but to no avail. I gathered Howler.js has this html5: true option that essentially makes use of html5 audio that allows you to stream large audio files so I wonder if that has something to do with it but I set the value to true and it works fine on the browser but it still doesn’t work when I build the app into an android apk. The app UI renders just fine, when I click the play button to stream radio, it just loads indefinitely and never starts playing.

or maybe android requires certain permissions to play audio? Please assist. a code sample of the stream function is down below. Poorly written code but I am learning


Vue dev-serve returns stale content

$
0
0

Again, Ionic is the UI, not the tool doing the dev-server. What eve the CLI docs say is the way to do something is the right way to do it.

Ionic/Vue add one Class to the Others

$
0
0

No it don’t do the correct thing…

It always remove the whole classes.

I want to check with a boolean to add a classname and if the boolean is wrong then remove and dont add again the classname…

if i do it like this:
:class="[isActive ? activeClass : ‘’]
it adds the classname but in the other way it remove the other classes on the object…

Angular Universal update

$
0
0

:wave: Hey there! So We haven’t done too much to be 100% honest. The general up-keep of SSR tooling is an uphill battle, plus Angular was also working on their own “official” SSR implementation that should address many issues we saw.

Basically, the old javascript DOM implementation that the older angular universal would ship with partially patched the DOM APIs, but still required a lot of work on Ionic/stencil.

But this newer implementation uses JSDOM which covers the entire DOM api. Meaning we won’t have to manage all that ourselves.

Ionic/Vue add one Class to the Others

$
0
0

Interesting. Can you share your full code? Please use code blocks to make it easier for us to read.

Here is a some plain Vue code that works just fine.

<template>
  <h1 class="h1"
      :class="{ active: isActive }"
      @click="isActive = !isActive">
    {{ msg }}
  </h1>
</template>

<style>
  .h1 {
    text-decoration: underline;
  }
  
  .active {
    color: red;
  }
</style>

<script setup>
import { ref } from 'vue'

const msg = 'Hello World!'
let isActive = ref(false)
</script>

Problem to build android app

Ionic 5 - long press gesture example

Angular Universal update


Opening app when clicking on local notification

$
0
0

I am using the cordova local notification plugin and at times when clicking on the notification, it opens the app and other times it takes a very long time to open the app - this is only happening on Android.

Anyone experience this as well?

Blurred background effect

SSL Pinning for iOS

$
0
0

Hi,

I have been looking for a solution for this for the past 2 months. I am currently using Ionic Capacitor as the native bridge and I have a problem with SSL Pinning on iOS. The plugin used is the HTTP Cordova plugin:

and

I want to point out that this method is working fine for Android. However, with iOS, I am receiving the following error on Xcode:

Connection 1: default TLS Trust evaluation failed(-9813)
Connection 1: TLS Trust encountered error 3:-9813
Connection 1: encountered error(3:-9813)

I am not sure how to fix this problem. I’ve googled everywhere, and most of the solution is for Android, and not iOS specifically.

Any help is very much appreciated. Thank you.

Angular Universal update

$
0
0

Hi and thx for the heads up

I will be looking for a different way to have a deeplink in a mail lead to a fast load of a pwa (on iOS).

Tom

Is an API is avalable to interact with Appflow?

$
0
0

Hi,

I was wondering if a public API exists to use Appflow in an automated way.
I am creating a nocode mobile app builder and I am using capacitor to generate the code corresponding to the nocode app.
So I would need to compile some code on the fly.
Does this kind of feature exist in Appflow? Thanks

Viewing all 228551 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>