Quantcast
Channel: Ionic Forum - Latest topics
Viewing all 70439 articles
Browse latest View live

[Ionic 4] Checking network status over Browser

$
0
0

@rodrigojrmartinez wrote:

Hi Guys

I’m developing an ionic 4 app where I need to keep track of the current network status and notify the user whenever the status changes. The app should be supported on browser besides mobile devices, so after checking a while I’ve learned that when on mobile, the Network cordova plugin in should be used. This works just excellent! My problem starts when having to detect this at browser level.

Basically, what I do is to wait for the platform to be ready, check where I’m at, and based on this listen for the proper events besides checking the status at that point, something like.

constructor(platform: Platform, network: Network) {
   this.platform.ready().then(() => {
      if (this.platform.is('cordova')) {
          // this is ok
          this.listenForDeviceNetwork();
      } else {
          this.listenForBrowserNetwork();
     }
   });
}

private listenForBrowserNetwork(){
    // also tried with document!
    window.addEventListener('offline', () => { console.log('now you are offline!'); });
    window.addEventListener('online', () => { console.log('now you are online!'); });
     this.isOnline = navigator.onLine;
}

The problem I’m facing is that the navigator.onLine is always returning true, and the events are never fired. Tryied taking out the internet connection as well as setting to the airplane mode, but noting… Also tried to log the navigator.onLine with an interval and check its value, but it is always returning true

setInterval(() => {
    console.log('now ', navigator.onLine);
}, 200);

This anyone stumbled across this problem? Thanks for the time!

Posts: 1

Participants: 1

Read full topic


Ionic dashboard - how to specify version of node when building package

$
0
0

@moomoomamoo wrote:

On the Ionic dashboard, I’ve been building packages for iOS and android. During the build package process, it used to use node 8 (which is what my team is currently using at our workstations). The build package process has been successful.

Now it appears that the build package process uses node 10, and now we’re getting some errors. Is there a way for us to specify which version of node we want for the build package process?

To be clear, I’m not looking for help on resolving the errors I get when it’s using node 10, I’m just asking on how to make it use node 8 instead of node 10.

Posts: 1

Participants: 1

Read full topic

Getting started with Ionic and React

Ion-menu - registerAnimation

Getting started with ionic as a web developter

$
0
0

@sebay wrote:

Hello there!

I am a hobby developer and I have been doing fullstack webdevelopment for 2 years and really want to move forward into app developing. Therefor I chose Ionic 4, but I am not able to make progess because I cannot find any fitting tutorials.

Do you have any website, youtube-channel or book recommendations?
Give me everything you have :stuck_out_tongue:

Thanks!

Posts: 1

Participants: 1

Read full topic

Ionic app in accessibility mode

$
0
0

@igoragueme wrote:

Hello, I`ve made an app with ionic v4, and everthing was going well. My app has the propose to help blind people with somes daily actions. So when I put my cellphone in accessibility mode (wich the device speaks everthing on the screen), when I open my app, the accessibility voice speaks “Ionic app WebVie” instead my app name. Does anyone knows if I can configure it?

Posts: 1

Participants: 1

Read full topic

HELP :: Navigation triggered outside Angular zone

$
0
0

@pnaa78 wrote:

Navigation triggered outside Angular zone, did you forget to call ‘ngZone.run()’?

All of a sudden my app started to give this warning and at certain pages, it redirects to default page (login)…

Any help???

Ionic:

ionic (Ionic CLI) : 4.10.3 (C:\Users\pnaan_000\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.0.2
@angular-devkit/build-angular : 0.12.4
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.3.3
@ionic/angular-toolkit : 1.3.0

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.1.4
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 7 other plugins)

System:

Android SDK Tools : 26.1.1 (C:\Android\studio)
NodeJS : v10.13.0 (C:\Program Files\nodejs\node.exe)
npm : 6.7.0
OS : Windows 10

Posts: 1

Participants: 1

Read full topic

Unable to update an apk in phone

$
0
0

@negarmir wrote:

Hi
I have a problem with an application which I had created using ionic 4.1.2. it was created in windows 7.
recently I installed windows 10 and made some changes in the application.
the problem that I have now is when I try to install new apk to update previous version, I see the following message which is good:
" Do you want to install an update to this existing application? Your existing data will not be lost. It does not require any special access"
It is exactly what I want.
But when I press install button, it shows me “App not installed.” message.
I don’t know how to find the issue and how to fix it.

Some one please help me to fix this issue. Thanks

Posts: 1

Participants: 1

Read full topic


How to Design form like this

$
0
0

@balvantjat wrote:

I want to design forms like this please post some code sample

  • Using Ionic-v4

Provide css rules for variable.scss FILE

feature

Posts: 1

Participants: 1

Read full topic

Centering a section with another on bottom

$
0
0

@vzDeadler wrote:

I have this scenario…

The left one is what i got, the signup on the bottom and the login and the buttons on the middle of all the remaining space, and i want is like the right one, the login and the buttons on the middle of all the content. How i can achieve that?

This is my code

<ion-content primary padding>


  <ion-grid class="login-grid">
    <ion-row align-items-center text-center>
      <ion-col size="12">
        <ion-item>
          <ion-input placeholder="Email"></ion-input>
        </ion-item>
        <ion-item>
          <ion-input placeholder="Password"></ion-input>
        </ion-item>

        <ion-button expand="full" size="large">JOIN</ion-button>

        <div class="sign-in-hr">
          <span>Or log in with</span>
        </div>

        <!-- <hr class="hr-text" data-content="Or join with"> -->
        <ion-row>
          <ion-col class="fb-col" size="6">
            <ion-button class="rs-btn fb" size="default">
              <ion-icon slot="icon-only" name="logo-facebook"></ion-icon> 
              Facebook
            </ion-button>
          </ion-col>
          <ion-col size="6">
            <ion-button class="rs-btn g" size="default">
              <ion-icon slot="icon-only" name="logo-google"></ion-icon> 
              Google
            </ion-button>
          </ion-col>
        </ion-row>


      </ion-col>
      <ion-col size="12" align-self-end>
          <div class="sign-in-hr">
            <span>Not registered?</span>
          </div>

          <ion-button expand="full" size="default">Sign up</ion-button>
        </ion-col>
    </ion-row>
  </ion-grid>
  
</ion-content>

And this is my scss

.login-grid {
    height: 100%;

    ion-row {
        height: 100%;
    }
}

.sign-in-hr {
    width: 100%; 
    height: 10px; 
    border-bottom: 1px solid rgb(177, 167, 167); 
    text-align: center; 
    margin-top: 10px; 
    margin-bottom: 10px;

    span {
        font-size: 18px; 
        color: rgb(177, 167, 167); 
        background-color: #ffffff; 
        padding: 0 10px;
    }
}

.fb-col {
    padding-left: 0px !important;
}

.rs-btn {
    width: 100%;
    --border-radius: 0px;
    text-transform: none;

    &.fb {
        --background: #3b5998;
    }
    
    &.g {
        --background: #d62d20;
    }
}

Posts: 1

Participants: 1

Read full topic

How to enable border on Textarea and Input in Ionic 4

$
0
0

@skildfrix wrote:

I have a UI which consist of 2 text inputs. First is the ion input which has a placeholder of “Title of the discussion”, and the other which is a textarea with a placeholder of “Write a discussion”. See the screenshot below:

image

I wanted to enable a border to both text input elements to make these elements to be visible to the user. Below is my current HTML and CSS code for this UI.

social.component.html

 <div id="topSection">
    <ion-card>
      <ion-card-header>
        <ion-grid item-start>
          <ion-row>
            <ion-col id = "userAvatarContainer" size = "1" size-lg>
              <ion-avatar id = "userAvatar">
                <img src="https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y">
              </ion-avatar>
            </ion-col>

            <ion-col>
              <ion-input id="discussTitle" placeholder="Title of the discussion" pattern="text"></ion-input>
            </ion-col>
          </ion-row>

          <ion-row>
            <ion-textarea wrap="soft" placeholder="Write a discussion...">
            </ion-textarea>
          </ion-row>
        </ion-grid>
      </ion-card-header>

      <ion-card-content>
        <ion-button expand="full">Publish</ion-button>
      </ion-card-content>

    </ion-card>
  </div>

social.component.scss

#topSection > ion-card > ion-card-header{
    width: 100%;
}

#userAvatar{
    width: 50px;
    height: 50px;
}

#topSection > ion-card > ion-card-header > ion-item > ion-list{
    width: 100%;
}

#topSection > ion-card > ion-card-header > ion-item > ion-list > ion-item > ion-textarea{
    height: 150px;
}

#userAvatarContainer{
    vertical-align: middle !important;
}

Hoping someone could help as soon as possible. Thank you.

Posts: 1

Participants: 1

Read full topic

How to scroll horizontally to specified or selected element

$
0
0

@000678bb wrote:

<ion-scroll #scroll scrollX=“true” style=“height:85px; border-bottom: 2px solid #a01e1e;”>


<ion-col col-10 *ngFor=“let date1 of dateJson.data” (click)=“selectDate1(date1.apt_id, date1.full_date)”>
<div class=“div_date” *ngIf=“appoint_date != date1.full_date” >
{{date1.date}} {{date1.day}}
{{date1.month}}

<div class=“div_date_select” *ngIf=“appoint_date == date1.full_date” #scroll>
{{date1.date}} {{date1.day}}
{{date1.month}}



this is my html code i want to access #scroll element but by getting element by id it should be null how to get that element or any other option for this

Posts: 1

Participants: 1

Read full topic

Update Ionic weather app from v3 to v4

Ion-popover android issue

$
0
0

@jwhijazi wrote:

I’m using ion-popover in my application, following the same steps on ionic 4 documentation. The popover menu is working fine on browser and when running (ionic cordova run android).
But the popover didn’t work as expected when running (ionic cordova build android --prod) as the popover content is not showing at all.
Strange problem and I didn’t find any solution for it until now.

Posts: 1

Participants: 1

Read full topic

CRUD correct on Ionic 4 with Auth?

$
0
0

@Manel00 wrote:

Hi everyone,

I’m trying to adapt a CRUD app to only an Auth app empty, but the problem is i dont know how to deal with adding the info to the user, i have this code, but its not working, thank you so much

export interface Note {
  id?: string,
  name: string,
  notes: string
}

@Injectable({
  providedIn: 'root'
})
export class NoteService {

  private notes: Observable<Note[]>
  private noteCollection: AngularFirestoreCollection<Note>;

  constructor(private afs: AngularFirestore, private user: UserService, private afAuth: AngularFireAuth) {

    this.noteCollection = this.afs.collection<Note>(`/users/${user.getUID}/notes`);
    this.notes = this.noteCollection.snapshotChanges().pipe(
      map(actions => {
        return actions.map(a => {
          const data = a.payload.doc.data();
          const id = a.payload.doc.id;
          return { id, ...data }
        })
      })
    );

  }

  getNotes(): Observable<Note[]> {
    return this.noteCollection.valueChanges()
  }

  getNote(id: string): Observable<Note> {
    return this.noteCollection.doc<Note>(id).valueChanges().pipe(
      take(1),
      map(note => {
        note.id = id;
        return note
      })
    );
  }

  addNote(note: Note): Promise<DocumentReference> {
    return this.noteCollection.add(note);
  }

  updateNote(note: Note): Promise<void> {
    return this.afs.doc(`users/${this.afAuth.auth.currentUser.uid}/note/${note.id}`)
      .update(data => {
      name: note.name,
      notes: note.notes   
     });
  }

  deleteNote(id: string) {
    return this.noteCollection.doc(id).delete();
  }
}

Where can i learn how to do it correctly? (WITH AUTH)

Posts: 1

Participants: 1

Read full topic


[Ionic 4] ion-datetime doesn't allow day selection before minimun

$
0
0

@iondafi wrote:

My ion-datetime has a min value set to 27 February 2019, when I want to select (for example) March 2 I can’t, because the day of month 2 isn’t allowed (but for February not for all other months)

Under Ionic 3 the bug doesn’t exist, when I click on March I can drag the day of month and the previous values appear, on Ionic 4 dragging, double clicking, tapping, praying doesn’t work

The code I use is shown below

<ion-datetime display-format="DD/MM/YYYY" min="2019-02-27" value="2019-02-27"></ion-datetime>

Ionic:

   ionic (Ionic CLI)             : 4.10.3 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.0
   @angular-devkit/build-angular : 0.12.3
   @angular-devkit/schematics    : 7.2.3
   @angular/cli                  : 7.2.3
   @ionic/angular-toolkit        : 1.2.3

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.0.0, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.1, (and 8 other plugins)

System:

   ios-deploy : 1.9.4
   NodeJS     : v10.9.0 (/usr/local/Cellar/node/10.9.0/bin/node)
   npm        : 6.7.0
   OS         : macOS Mojave
   Xcode      : Xcode 10.1 Build version 10B61

Posts: 1

Participants: 1

Read full topic

Ionic 3: Web reload page in browser with F5

Firebase chat is not working with ionic 4

$
0
0

@manojpatel0217 wrote:

I tried to add firebase plugin in ionic 4

it show me its added properly but after that when i tried to build application it gives me files not accessible error.

Can anyone help me out on this?

Posts: 1

Participants: 1

Read full topic

[ionic 4] How can I style (custom css) ion-item

$
0
0

@pantarmj wrote:

In ionic4, generates #shadow-root as shown in the image below:

To assign custom css to ion-item element, I need to style the child elements under #shadow-root. Plz tell me how can I point to the elements with “item-native” class and “item-inner” class?

I tried following but “item-native” is not getting styled:

.list-item.item-native {
// custom css
}
.list-item .item-native {
// custom css
}

Can someone plz help me…

Posts: 1

Participants: 1

Read full topic

Ionic v4: How to access IonContent methods?

$
0
0

@notbenj33 wrote:

Hello,

I’m migrating an application from v3 to v4.
I have an issue with IonContent.
In the v3 code, we use the scrollToBottom() method.
In v4, I can’t find it.

I tried
import {IonContent} from '@Ionic/angular';
with
@ViewChild(IonContent) content: IonContent
and also with this ViewChild
@ViewChild(IonContent, {read: IonContent}) content: IonContent
But the auto-complete only gives me access to the 3 events (ionScroll, ionScrollEnd, ioScrollStart).
I don’t get the autocomplete for the methods listed in the v4 documentation:

I tried
import {Content} from '@Ionic/angular';
But this class cannot be found in the @ionic/angular package.

I use @Ionic/angular 4.0.1

Am I missing something?

Thank you.

Posts: 2

Participants: 2

Read full topic

Viewing all 70439 articles
Browse latest View live


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