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

Does iOS on low memory delete persistent data?

$
0
0

Hello, I am making an ionic app for iOS which uses IndexedDB as persistent storage. I have read that iOS when on low memory deletes persistent storage. Is that true?? There is not much about it on the Internet. Thanks


Change google maps map type

$
0
0

I’m using the google maps plugin and I want to change the map type. In options I have the following, but it doesn’t work, I have changed it to different types but always appears the same type of map:

let opciones: GoogleMapOptions = {
            mapType: GoogleMapsMapTypeId.SATELLITE,
            controls: {
                compass: false,
                zoom: true,
                myLocationButton: true,
                myLocation: true
            },
            styles: this.style
        };

How can I change the map type?
Thank you.

Ionic Android 5.1.1 SyntaxError: Use of const in strict mode

$
0
0

Yes. I resolved my bug… I don’t remember exactly how…
I remember that I compiled in debug … and on the error you saw the line in vendor.js or main.js where is crached.
Has a problem of my code or one of the plugin that I used…

Cristian

Avoid Duplicate Event

$
0
0

How to avoid duplicate event subscribe in lazy load.

PayPal plugin for Cordova/Ionic Applications does'nt work with Credit cards

$
0
0

i built an app using PayPal plugin for Cordova/Ionic Applications (https://github.com/paypal/PayPal-Cordova-Plugin) but payments with credit cards doesn’t work. Every attempt i made the reply is "Merchant doen’st accept this kind of payment (in italian: "il commerciante non accetta questo tipo di pagamento). I’m not able to solve this issue. Seeing the logs of the app i read “payment canceled”.
Is there someone that knows something about thie issue?

How to use Capacitor's convertFileSrc() instead of Cordova's convertFileSrc()

$
0
0

Can someone give me an example of how to pull convertFileSrc() from Capacitor instead of using the one from cordova?

I need this because if I use the cordova one, then I cannot run my code in the browser anymore – because cordova.js does not support the browser.

Thanks.

Ionic, MS-ADAL, Microsoft Azure AD

$
0
0

Hi all,

I’m facing a wall right now trying to implement SSO with MS-ADAL module in my Ionic application.

I just can’t get a valid authenticationContext using Microsoft Azure AD, in which I registered my application.

I can’t know if this is because I didn’t set all parameters on Azure portal correctly (I tried to find a clear tutorial on it, found many many super complicated ones, not even one close enough to S-I-M-P-L-E )

Herebelow is my code :

import { Injectable } from '@angular/core';
import { JwtHelperService } from '@auth0/angular-jwt';
import { Platform} from 'ionic-angular';

import { MSAdal, AuthenticationContext } from '@ionic-native/ms-adal';

import { environment as env } from '../environments/environment';
...
@Injectable()
export class AuthService {
  constructor(
    private msAdal: MSAdal,
    private jwtHelper: JwtHelperService,
    private platform: Platform,
    //private AuthContxt: AuthenticationContext
  ) {
    console.log("auth.service.ts constructor");
    platform.ready().then(() => {
      console.log('Activate ADAL logger');
      
      //Microsoft.ADAL.AuthenticationSettings.setLogger(logItem => {
      //  console.log(`ADAL: ${logItem.message}`, logItem);
      //});
    });
  }

public async authenticate(): Promise<boolean> {
    
    await this.platform.ready();
        
    const authContext = this.msAdal.createAuthenticationContext(
      env.adAuthority,
      false
    );
...

And as for the environment is concerned here is part of the file :

export const environment = {
  //adAuthority: 'https://login.microsoftonline.com/common',
  adAuthority: 'https://login.windows.net/common',

  //adResourceUri: 'https://management.azure.com/',
  adResourceUri: 'https://graph.windows.net',

  adClientId: '<<<here is the client id I took from Azure portal>>>',

  adRedirectUri: 'https://localhost:8100/',
 
  // -------------------------------------
  // partie dédiee a la connexion a l'API
  // -------------------------------------
...
};

Is my adAuthority wrong ? tried the login.microsoftonline.com/common but it returns a 404 in chrome when I put it as a URL …

Indeed the error is that my ‘authContext’ is undefined which leads logically to nothing when trying to get tokens afterwards :cry:

Capturing ion-tab click on active tab event

$
0
0

[DEPRECATED (with new solution) ]

If you close and reopen the Tabs page, a new ID will be generated for the new Tabs page if not destroyed properly.

The name will go from “tab-t0-1” to “tab-t1-1”. So you need to ensure that you generate the subscription for several different IDs every time you trigger the ngAfterViewInit().

I iterated through the different IDs until an ID was not undefined and then I triggered the subscription with the existing IDs.

Hope it helps (again)! :slight_smile:


Ionic 4 - How to check current page is on root or not?

$
0
0

How to check current page is root page or forwarded page in ionic 4,

On device back button press i want show alert before closing app

this.platform.backButton.subscribe(async () => {
    if (status) { // I WANT TO MAKE THIS STATUS TRUE ONLY IF APP VIEW IS ON ROOT PAGE
      const alert = await this.alertController.create({
        header: 'Confirm!',
        message: 'Are you sure? Do you want to exit app?',
        buttons: [
          {
            text: 'Cancel',
            role: 'cancel',
            handler: (blah) => {
            }
          }, {
            text: 'Exit',
            handler: () => {
              navigator['app'].exitApp();
            }
          }
        ]
      });
      await alert.present();
    }
  });

Iframe Youtube video slider using ion-slider in ionic 3

$
0
0

I have created iframe youtube video slider. it contain 3 slider youtube video. it’s run very well but when i play any one youtube video and go to another page then video doesn’t stop.

audio doesn’t stop and when i come back to same page then video slider rendering again but first one audio is continue played. how to pause or stop them??

Any one have an idea regarding my question??

Basic Validation in Ionic

$
0
0

This would be done via the base framework’s solution. If you are using Angular, you can use Reactive Forms to do this. Assume Vue and React have similar solutions. There are tons of tutorials on this.

Remember, Ionic is just the UI layer, the business logic (like validation) lives with the framework (Angular).

When i am building Ionic 4 for android and running the build on android studio 3.4.1 , it gave me error?

$
0
0

Maybe share the error you are getting?

What do you mean by “after creating the build i am running that build on android studio 3.4.1”

Background Design

$
0
0

First, good luck on this.

I would look at Ionic Grid and CSS Backgrounds as the foundations to solve this design. Remember, Ionic is built on the web, so see of there an existing tutorial or design that might serve as a starting point.

You might need to engage a web designer to work through this, as I suspect there may also be other functionality that exists on this screen that would need to be accounted for.

Change google maps map type

$
0
0

Have you tried setting the mapType to just ‘SATELLITE’ ?

Change google maps map type

$
0
0

Yes ChriisGriiffith, , but it didn’t work.


Iframe not load adsense

$
0
0

Hi all, I’m having a hard time on the iframe part of the ionic.

I’ve created an iframe to load my page, it loads everything, however the ads (adsense) of the page does not appear, the space is blank and shows nothing. I have already tried making changes with css and nothing works.
I have adbmod also configured in the app.

Netflix.page.ts

import { Component, OnInit, Input  } from '@angular/core';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { NavController } from '@ionic/angular';
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';

@Component({
  selector: 'app-home',
  templateUrl: 'netflix.page.html',
  styleUrls: ['home.page.scss'],
})
//export class Netflix implements OnInit{
export class Netflix {
  url: any;
  constructor(private sanitize: DomSanitizer){
    this.url = sanitize.bypassSecurityTrustResourceUrl("https://streamingsbrasil.com/category/netflix/amp");
  }

}

page.html

<ion-header>
  <ion-toolbar>
    <ion-buttons slot="start">
      <ion-back-button text="Voltar" defaultHref="home"></ion-back-button>
    </ion-buttons>

    <ion-title>
      Netflix
    </ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>
  <iframe scrolling="yes" style="z-index: 9999 !important;width: 100%;height: 79vh;position: fixed !important;" [src]="url"></iframe>
</ion-content>

<ion-tabs>
  <ion-tab-bar slot="bottom">
    <ion-tab-button href="/netflix/netflixlancamento">
      <ion-icon name="rocket"></ion-icon>
      <ion-label>Lançamentos</ion-label>
    </ion-tab-button>

    <ion-tab-button href="/netflix/netflixnoticias">
      <ion-icon name="paper"></ion-icon>
      <ion-label>Notícias</ion-label>
    </ion-tab-button>

    <ion-tab-button href="/netflix/netflixdicas">
      <ion-icon name="apps"></ion-icon>
      <ion-label>Dicas</ion-label>
    </ion-tab-button>
    <ion-tab-button href="/netflix/netflixremovidos">
      <ion-icon name="trash"></ion-icon>
      <ion-label>Removidos</ion-label>
    </ion-tab-button>
  </ion-tab-bar>
</ion-tabs>

How to display image(taking with camera) on canvas (signature pad)

$
0
0

Yes. I used canvas.

  1. take the picture from camera and show preview view.
  2. draw the canvas what you want.

Where to specify small icons (for notifications in status bar) in config.xml?

$
0
0

@holp

the small notification icon not showing correctly in oreo android os, but working on android version 6.0.1

In Oreo its showing only gray icon

but in lowest version the star icons shows correctly…

please help

config.xml

<platform name="android">
        <allow-intent href="market:*" />
        <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
        <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
        <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
        <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
        <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
        <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
        <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
        <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
        <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
        <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
        <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
        <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
        <icon src="resources/android/notification/icon-mdpi.png" target="app/src/main/res/drawable-mdpi/notification.png" />
        <icon src="resources/android/notification/icon-hdpi.png" target="app/src/main/res/drawable-hdpi/notification.png" />
        <icon src="resources/android/notification/icon-xhdpi.png" target="app/src/main/res/drawable-xhdpi/notification.png" />
        <icon src="resources/android/notification/icon-xxhdpi.png" target="app/src/main/res/drawable-xxhdpi/notification.png" />
        <icon src="resources/android/notification/icon-xxxhdpi.png" target="app/src/main/res/drawable-xxxhdpi/notification.png" />
        <resource-file src="resources/android/notification/icon-mdpi.png" target="app/src/main/res/drawable-mdpi/notification.png" />
        <resource-file src="resources/android/notification/icon-hdpi.png" target="app/src/main/res/drawable-hdpi/notification.png" />
        <resource-file src="resources/android/notification/icon-xhdpi.png" target="app/src/main/res/drawable-xhdpi/notification.png" />
        <resource-file src="resources/android/notification/icon-xxhdpi.png" target="app/src/main/res/drawable-xxhdpi/notification.png" />
        <resource-file src="resources/android/notification/icon-xxxhdpi.png" target="app/src/main/res/drawable-xxxhdpi/notification.png" />
    </platform>

in app.component.ts

pushSetUp() {
    const options: any = {
      android: {
        senderID: 'xxxxxxxxxxx',
        icon:'icon',
        smallIcon: 'res://notification',
        forceShow:'True'
      },
      ios: {
        alert: 'true',
        badge: true,
        sound: 'false'
      }

    };



    const pushObject: PushObject = this.push.init(options);




    pushObject.on('notification').subscribe((notification: any) => {
      console.log('Received a notification', notification)

      if (notification.additionalData.foreground) {
        this.showAlert(notification.title, notification.message)
        this.navCtrl.setRoot('DashboardPage');
      }
      else {
        localStorage.setItem('gotNotified', JSON.stringify(1));
        this.navCtrl.setRoot('DashboardPage');
      }

    });

Failed to apply plugin [id 'io.fabric'] > Cannot add extension with name 'crashlytics', as there is an extension already registered with that name

$
0
0

Failed to apply plugin [id ‘io.fabric’] > Cannot add extension with name ‘crashlytics’, as there is an extension already registered with that name

Can someone help ?! ionic 1.3.3 on iOS 12 with error: not set for url='unsafe:ionic://localhost%23/menu/aboutUs'

$
0
0

Looks like we are in the same boat, I was looking for a solution. However i did not solve it yet. Did you happen to find the solution, please let me know

Viewing all 228535 articles
Browse latest View live


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