Quantcast
Viewing all 70871 articles
Browse latest View live

Runtime Error: Maximum call stack size exceeded

@magu97 wrote:

Before further explanation let me clear that there is no issue with the code written that might cause recursive issue.
When I run “ionic serve” the tab opened in the browser shows the error according to below snapshot:

This issue appears when someone pulls the code from version control and try to run on their system.

Environment:
Ionic Framework: ^3.9.9
Ionic App Scripts: 3.2.4
Angular Core: 5.2.11
Angular Compiler CLI: 5.2.11
Node: 10.20.1
OS Platform: Windows 10
Navigator Platform: Win 32

Posts: 1

Participants: 1

Read full topic


Ionic scroll div with another div

@Astrix wrote:

Hope someone can help me with my problem:

I have a content full of data, of which I scroll through and have a next() button in my footer which handles several tasks. The next button is a fixed div overlapping the content (50% transparent starting from mid to bottom). I would like to make the footer’s next button div to be able to handle the content’s scroller too, on top of having the button effect.

Assigning next() to the content is not an option.

<ion-content padding #myContent [scrollEvents]="true" (ionScroll)="test2($event)">
</ion-content>

<ion-footer>
  <div *ngIf="nextButtonHolder">
  <div *ngIf="nextButton" class="next" (click)="next()" id="nextID" [scrollEvents]="true" (ionScroll)="test($event)"></div>
</div>
</ion-footer>

Code in TS and what I tried is: getting the scrollevents for both layers then matching the scrolltop and scrollleft value of next class with the contents’:

test($event) {

    $event.scrollTop = this.test2($event.scrollTop);
    $event.scrollLeft =  this.test2($event.scrollLeft);

  console.log($event.detail.scrollTop);
  console.log($event.detail.startY);    
}
test2($event) {
  console.log($event.detail.scrollTop);
  console.log($event.detail.startY);    
}

Maybe I’m missing something. What would be your solution?

Posts: 1

Participants: 1

Read full topic

New components not adding to app.module.ts

@Esnagar wrote:

Hi everyone!

I’m starting with Ionic 5 + Angular so I’m watching a lot of tutorials. Today I realized that, when I create a new custom component, Ionic doesn’t add it automatically at app.module.ts.

You may thing that this is a stupid question (and you are probably right), but I couldn’t find anything about this and I just want to know if it only happens to me or if this is an update of Ionic 5 or something.

Thanks a lot!!

Posts: 1

Participants: 1

Read full topic

IonInput masking

@austin43 wrote:

Hello,

I’ve been trying to implement a phone number mask on IonInput. imask and each third party library I’ve tried requires the native element as a reference (IonInput as the reference element will not work), so I’ve been trying this:

const MaskedStyledInput = IMaskMixin(({ inputRef, ...props }) => {
	return (
		<IonInput
			{...props}
			ref={async el => {
				const element = el && (await el.getInputElement())
				return inputRef(element)
			}}
		/>
	)
})

This doesn’t seem to work as the element isn’t available until after the first render has already happened, thus passing an undefined element to imask. It works perfectly with <input />.

Is there a recommended way of doing input masking in ionic/react outside of third party libraries? Thanks in advance for any help.

Posts: 1

Participants: 1

Read full topic

Retrieving all data at log in

@mell0 wrote:

Hi Guys,

I’m pretty new to Ionic and I’m creating a mobile app and was thinking to execute all database retrieval asynchronously after the user logs in and perhaps listen or like have a subscriber to receive that data and save it in local storage. This way it will make transitions to pages a lot faster since it won’t have to query on demand. Thing is, I don’t know where to start. Has somebody created something like this? Can you post a sample code? Is this a good practice? If not, how do I better handle it?

Also can you guys recommend an article/blog/book that I should read to improve mobile app development in Ionic? Thanks in advance folks.

Posts: 4

Participants: 2

Read full topic

More than one radio selected in radio-group with ngFor

@rwinford77 wrote:

I am having a problem using ion-radio-group with an *ngFor.
The radio group displays properly, but it doesn’t unselect a radio button
when I click on a different one. So, If I have 10 items on my list, and I click the
first 3, then those 3 radio buttons are selected (filled-in). I am
receiving the correct value from ionChange every time I click on a radio,
but it’s confusing to the user when multiple radios show as selected.

If I remove the ngFor and “hard-code” 4 different radio buttons, it works
correctly.

I have tried to put the *ngFor on the ion-list element with the same results.
I tried creating a div in place of the ion-list, with the same results.

thanks for your help.

Rick

HTML and TS code as follows:

HTML

<ion-list>
      <ion-radio-group allow-empty-selection="true" *ngFor="let trail of allTrails" 
                       (ionChange)="getTrail($event.detail.value)">
        <ion-item >
          <ion-label>Trail: {{ trail.id }} </ion-label>
          <ion-radio slot="start" [value]="trail.id"></ion-radio>
        </ion-item>
      </ion-radio-group>
    </ion-list>

TS


  getTrail(trail) {
    console.log("===>>> in getTrail, ev = ", trail);
  }

My software versions:
Ionic:

Ionic CLI : 6.5.0 (C:\Users\rick\AppData\Roaming\npm\node_modules@ionic\cli)
Ionic Framework : @ionic/angular 5.1.1
@angular-devkit/build-angular : 0.803.26
@angular-devkit/schematics : 8.3.25
@angular/cli : 8.3.26
@ionic/angular-toolkit : 2.2.0

Capacitor:

Capacitor CLI : 1.5.2
@capacitor/core : 1.5.2

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : none
Cordova Plugins : no whitelisted plugins (1 plugins total)

Utility:

cordova-res : not installed
native-run : not installed

System:

NodeJS : v12.16.1 (C:\Program Files\nodejs\node.exe)
npm : 6.13.4
OS : Windows 10Preformatted textImage may be NSFW.
Clik here to view.
ionicRadioGroup problem

Posts: 2

Participants: 2

Read full topic

[Ionic 5] Pinch gesture

@pabloo87 wrote:

Hi, i’m using Ionic 5 and trying to make a pinch gesture. I notice that there’s no out of the box solution for this so i’m trying to use ionic 5 gesture api to make one, but it seems that ionic gesture does not detect more than one tap at the time…
Does anyone know how to make pinch gesture to work in Ionic 5?

Thanks

Posts: 1

Participants: 1

Read full topic

Browser-tab plugin does not work on android

@PauloFrediani wrote:

I have been developing an app with ios only but now that I am trying to implem,ent openID authentication to my app after adding @ionic-native/browser-tab to implement the authentication flow , in Android simple does nnot build , missing package.

/mymachinepath/android/capacitor-cordova-android-plugins/src/main/java/com/google/cordova/plugin/browsertab/BrowserTab.java:21: error: cannot find symbol
import android.support.customtabs.CustomTabsIntent;
^
symbol: class CustomTabsIntent
location: package android.support.customtabs

Im using ionic v5 angular.

This works fine under ios platform but I do not seem to be able to run android .

Surely there is a solution for this ?

Thank you in advance for any help provided.

Paulo

Posts: 1

Participants: 1

Read full topic


Side menu navigation problem after switch between pages

@irelevant wrote:

Hi. I am new in ionic and angular and I am trying to create a single page with authentication. I have side menu different for user and visitor. My foled structure looks like this:
./app/

./app/user/profile/
./app/user/logout/

./app/visitor/login/
./app/visitor/registration/

And I am trying to navigate from user/profile folder/page after logout to visitor/login.

When visitor visit the page, he can see this:

After login, I redirected him to another page and after that, he can see this:

But after logout, I only call
`this.router.navigateByUrl(“visitor/login-internal”);, side menu is nowhere and you can see this:

To generate side menu for visitor and user, I am using this code, same for visitor.page.html and user.page.html:

<ion-app>
  <ion-split-pane content-id="visitor-menu">
    <ion-menu side="start" content-id="visitor-menu">
      <ion-header>
        <ion-toolbar color="primary">
          <ion-title>Menu</ion-title>
        </ion-toolbar>
      </ion-header>
      <ion-content>
        <ion-list>
          <ion-menu-toggle auto-hide="false" *ngFor="let page of appPages; let i = index">
            <ion-item routerDirection="root" [routerLink]="[page.url]" lines="none" detail="false"
              [class.selected]="selectedIndex == i">
              <ion-icon [name]="page.icon" slot="start"></ion-icon>
              <ion-label>{{ page.title }}</ion-label>
            </ion-item>
          </ion-menu-toggle>
        </ion-list>
      </ion-content>
    </ion-menu>
    <div class="ion-page" id="visitor-menu">
      <ion-content class="ion-padding">
        <ion-router-outlet class="ion-page" id="visitor-menu"></ion-router-outlet>
      </ion-content>
    </div>
  </ion-split-pane>
</ion-app>

Pages in the menu is stored in visitor.page.ts and user.page.ts. Here is example of visitor.page.ts, code for user.page.ts is almost equal:

@Component({
  selector: 'app-visitor',
  templateUrl: './visitor.page.html',
  styleUrls: ['./visitor.page.scss'],
})
export class VisitorPage implements OnInit {
  public selectedIndex = 0;
  public appPages = [
    {
      title: 'Quick match',
      url: '/visitor/quick-match',
      icon: 'football'
    },
    {
      title: 'Login',
      url: '/visitor/login-internal',
      icon: 'log-in'
    },
    {
      title: 'Registration',
      url: '/visitor/registration-internal',
      icon: 'person-add'
    },
    {
      title: 'Login via Google',
      url: '/visitor/login-google',
      icon: 'logo-google'
    }
  ];
  constructor() { }
  ngOnInit() {
  }
}

Here is example of visitor-routing.module.ts, user-routing.module.ts is almost equal:

const routes: Routes = [
  {
    path: '',
    component: VisitorPage,
    children: [
      {
        path: 'login-facebook',
        loadChildren: () => import('./login-facebook/login-facebook.module').then( m => m.LoginFacebookPageModule)
      },
      {
        path: 'login-google',
        loadChildren: () => import('./login-google/login-google.module').then( m => m.LoginGooglePageModule)
      },
      {
        path: 'login-internal',
        loadChildren: () => import('./login-internal/login-internal.module').then( m => m.LoginInternalPageModule)
      },
      {
        path: 'registration-internal',
        loadChildren: () => import('./registration-internal/registration-internal.module').then( m => m.RegistrationInternalPageModule)
      },
      {
        path: 'quick-match',
        loadChildren: () => import('./quick-match/quick-match.module').then( m => m.QuickMatchPageModule)
      }
    ]
  },
];
@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class VisitorPageRoutingModule {}

In app folder, main/root folder, I have almost nothing, only app-routing.module.ts has some of my code:

const routes: Routes = [
  { path: '', redirectTo: 'visitor/login', pathMatch: 'full' },
  {
    path: 'errors',
    loadChildren: () => import('./errors/errors.module').then( m => m.ErrorsPageModule)
  },
  {
    path: 'visitor',
    loadChildren: () => import('./visitor/visitor.module').then( m => m.VisitorPageModule),
    canLoad: [AuthGuard],
    data: { 'accessLevel': AccessLevel.VISITOR }
  },
  {
    path: 'user',
    loadChildren: () => import('./user/user.module').then( m => m.UserPageModule),
    canLoad: [AuthGuard],
    data: { 'accessLevel': AccessLevel.USER }
  },
];

@NgModule({
  imports: [
    RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
  ],
  exports: [RouterModule]
})
export class AppRoutingModule { }

I am sure that I have something absolutely wrong in my routing logic.

Here is ionic info:

Ionic:

   Ionic CLI                     : 5.4.16 (C:\Users\frant\node_modules\ionic)
   Ionic Framework               : @ionic/angular 5.1.1
   @angular-devkit/build-angular : 0.901.6
   @angular-devkit/schematics    : 9.1.6
   @angular/cli                  : 9.1.6
   @ionic/angular-toolkit        : 2.2.0

Capacitor:

   Capacitor CLI   : 2.1.0
   @capacitor/core : 2.1.0

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : browser 6.0.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 5 other plugins)

Utility:

   cordova-res : 0.14.0
   native-run  : 1.0.0

System:

   NodeJS : v12.13.0 (C:\Program Files\nodejs\node.exe)
   npm    : 6.12.0
   OS     : Windows 10

Application running with command ionic serve on localhost WIN 10 64 bit.
Thank you and sorry for any advice or time what you spend because of my problem.

Posts: 1

Participants: 1

Read full topic

Routeguard and localstorage

@argoflo wrote:

Hi, I’m new on Ionic and I’m building my first app, I’m trying to use routeguards to keep some routes secure the problem is than I store the token on localstorage And when a user Is logged in and open the app the dashboard page loads before than get token can resolve then the user is redirected to login page but when he arrives there the local storage is already resolve and the is redirected again to dashboard

Is there some way to load the local storage before the app starts or at least before than the first route try to use the route guard? Is there another better way to secure my routes? Could you please pint me in the right direction on this.

By the way I’m using Ionic 6, Angular and Capacitor 2

Thanks

Posts: 1

Participants: 1

Read full topic

Ionic with Angular JS

@w3bnetau wrote:

Is it possible to use a recent version of Ionic cli along with AngularJS rather than Angular?

I have tried --type=ionic1 with the Ionic cli, and I have tried creating Apache Cordova apps and adding Ionic and AngularJS to it, but I don’t seem to get there very easily. Ionic shouldn’t care too much about what framework I use, and so it should be able to just work with AngularJS as well as Angular, React, Vue and so on, is that right?

How should I create this project? Do I still need to use --type=ionic1, and add angular with npm? And copy those files into www/js for building, using ionic capacitor add android/ionic cordova platform add android?

Also does it work with AngularJS routing or does it use a separate plugin installed with npm? Like ui-router?

Thanks!

Posts: 1

Participants: 1

Read full topic

Push Notifications with OneSignal not showing pushToken

@C_shubham wrote:

Hello,

I am using ionic 4 react, i have integrated oneSignal push notification but i didn’t get push notification.
Push Notifications with OneSignal does not showing pushToken,

Code:
import { OneSignal } from ‘@ionic-native/onesignal’;
.
.
.
OneSignal.startInit(‘4eeef01f-02fc-48ef-bf8c…’, ‘fir-…’);
OneSignal.inFocusDisplaying(OneSignal.OSInFocusDisplayOption.None);
OneSignal.inFocusDisplaying(OneSignal.OSInFocusDisplayOption.InAppAlert);
OneSignal.setSubscription(true);
OneSignal.handleNotificationReceived().subscribe(() => {

});
OneSignal.handleNotificationOpened().subscribe(() => {

});
OneSignal.endInit();

OneSignal.getIds().then((id) => 
{
    alert(JSON.stringify(id))
    localStorage.removeItem('player_id_list');
    localStorage.setItem('player_id_list', JSON.stringify(id));
}, (error) => {
                    
                });

Any suggestions appreciated…

Posts: 1

Participants: 1

Read full topic

Ion-select scrollbar interface popover

@Blackace12 wrote:

Is there anyway I could add a scroll bar inside an ion-select interface='popover'? I can’t seem to find a way to do this.

Image may be NSFW.
Clik here to view.
image

Posts: 1

Participants: 1

Read full topic

Using ionic@lab

@hemangshah-in wrote:

I’m running ionic serve --l command and it will open a ionic lab screen where I can see my app in ios, android and windows, I can also open it in a new window.

But problem here, is we’ve used a third party login framework which won’t allow and end-up with below error.

Refused to display ‘url’ in a frame because it set ‘X-Frame-Options’ to ‘deny’.

Any idea? How to fix this?

Note: For a reason, I don’t have immediate control on that third party login framework.

Posts: 1

Participants: 1

Read full topic

Ion-popover

@hemangshah-in wrote:

I’ve used ion-popover from the framework to show a angular component as a popover. It has single/multiple selection functionality as well.

It works fine as a pop over, it will show the component, will list the items, I can select/unselect single/multiple items which are in display currently. Now if I try to scroll the list in popup it won’t scroll.

To do this, I’ve drag and scroll from the top and then it will get scroll.

NORMAL scrolling is not working.

I am new to this forum, more information can be share on request.

Posts: 1

Participants: 1

Read full topic


Ionic3 read content provider?

Ionic3 web intent can you help me?

@kjhnice77 wrote:

How can I get the value sent by Android from ionic3 as below?

I know a module called web intent, but it doesn’t work, there are no examples at all, and I can’t figure out how to do it.

Could you tell me the details?

This is an intent sent from Android. I want to receive this from ionic3.

ComponentName test = new ComponentName(‘com.test.program’, ‘com.mainactivity’);
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.putExtra(“test1”, 1234);
intent.putExtra(“test2”, 5678 );
intentsetComponent(test);
startActivity(intent);

please help me!

Posts: 1

Participants: 1

Read full topic

AppFlow dev workflow

@richardshergold wrote:

Interested to hear from anyone using AppFlow (we are in our 30 day trial at the moment). I had assumed I would continue to do my own dev builds locally and work that way and only use AppFlow for builds/deploys that were to be distributed for testing but having used it for a few days I’m wondering now if devs use AppFlow for all their device builds including their day to day development builds i.e maybe work on stuff in the browser using ionic serve and use AppFlow whenever you want a device build? If you are using it I’d love to know what your workflow is?

Posts: 1

Participants: 1

Read full topic

Ionic Prod Build Error

@osmancansiz wrote:

Hello,

When i build with --prod got this error message;
Error: Cannot activate an already activated outlet activateWith@ionic and i have a tabs, no action in tab1 page component. Only ion-header it seems.

but when i do normal build no problem.

what is the problem please help, thanks.

Posts: 1

Participants: 1

Read full topic

Bottom ion-tabs overlapping on last portion of ion-content on iOS devices

Viewing all 70871 articles
Browse latest View live


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