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

My app stopped compiling and I am not sure why

$
0
0

@AIBug wrote:

I am getting these errors when I try to compile my app:

Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”).

Content Security Policy: The page’s settings blocked the loading of a resource at http://localhost:8100/favicon.ico (“default-src”).

Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”).

Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”).

It used to compile fine earlier today and I am not sure what I did to cause these problems. Nor can I find “default-src”.

I’m not sure what code to give you to look at :frowning:

Sorry for the hard question.

Thanks for any help that you can give.

Posts: 1

Participants: 1

Read full topic


How to display directory files in ionic using listDir() method

$
0
0

@VinodTillu wrote:

Am able to create and remove a directory but how to display the files of that directory on screen.
Am getting [object Obejct] on screen
Home.ts

listAllFiles(){
    this.platform.ready().then(() => {
      this.file.listDir(this.file.externalRootDirectory, "DirectoryFile")

        .then((listfiles) => {
          this.showFile=listfiles;
          console.log("Directory listeing" + this.showFile);

        })
        .catch((err) =>{
        alert(JSON.stringify(err));
      })
    })
  }

Home.html

 <ion-list>
          <ion-item *ngFor="let printValues of showFile">
          {{printValues}}
        </ion-item>
      </ion-list>

Posts: 1

Participants: 1

Read full topic

Ionic React - Realtime Clock

Screen size (NOT PIXEL COUNT!) steps in grid

$
0
0

@StormSeeker wrote:

Good morning

I’m new to this community and I would like to ask for help from people with more expertise.
Let’s say I want to use an ion-grid and that I want to resize an ion-col BASED ON SCREEN SIZE, NOT ON PIXEL COUNT (I’M TALKING ABOUT REAL WORLD MILLIMETERS), what’s the recommended most straight-forward way to accomplish this?

Thank you very much in advance!

Posts: 1

Participants: 1

Read full topic

Ionicons not found

$
0
0

@Simran3798 wrote:

I am not able to add ionicons like person-sharp etc. it is coming 404 not found . I can just use person keywword.

Posts: 1

Participants: 1

Read full topic

How to create scratch cards using ionic

Is there any way to make a progress bar work in an overlay?

$
0
0

@Arkthur wrote:

I’m trying to put an ion-progress-bar in an ion-alert. It renders, but it doesn’t receive the value I’m sending to it.

const progress = 0.5
const alert = await this.alertCtrl.create({
  message: `Loading workOrder...
  <ion-progress-bar value="${progress}"></ion-progress-bar>`
});
alert.present();

I’m doing this in a component I call as an ìon-modal. I don’t know if this has something to do with anything, but I thought it was worth mentioning it.

Posts: 2

Participants: 2

Read full topic

Direct Url not opening through firebase function

$
0
0

@mursaleenkamal wrote:

Everything seems to be working. I can view the Angular App through my firebase hosting url. But: As soon as I call a route directly e.g. http://xxx.firebase.app/about I get this error (copied from firebase functions log)

TypeError: handler is not a function
at cloudFunction (/srv/nodemodules/firebase-functions/lib/providers/https.js9)
at /worker/worker.js7
at /worker/worker.js11
at ZoneDelegate.invokeTask (/srv/dist/server.js31)
at Zone.runTask (/srv/dist/server.js47)
at ZoneTask.invokeTask (/srv/dist/server.js34)
at ZoneTask.invoke (/srv/dist/server.js48)
at data.args.(anonymous function) (/srv/dist/server.js25)
at combinedTickCallback (internal/process/nexttick.js7)
at process.tickDomainCallback (internal/process/nexttick.js9)

Live Url: https://jobs-92.firebaseapp.com/folder/Inbox

Posts: 1

Participants: 1

Read full topic


Using ion-nav within a modal

$
0
0

@sanz wrote:

Hi all,

I’ve created a modal that I can access from multiple pages within my app in order to provide page specific help text to the user. This works quite well :slight_smile:

I would now like to add a menu list to this modal, and when an item in this list is clicked, a new “page” is transitioned to, entirely within the modal.

Reading the docs it seems ion-nav fits the bill … “This fits use cases where you could have a modal, which needs its own sub-navigation, without making it tied to the apps URL”.

Have not been able to find a really good example of this use case … closest I could find is this.

Now I’ve added to my modal template, and followed the 2nd answer and managed to get somewhere, but not at all what I was expecting. The component I’d like to set for setRoot should be another page (not an individual component).

The issue is when activating the modal, it appears that whatever component is used in setRoot takes over/replaces the whole modal template output … not what I was expecting. Was expecting the main modal info and then whatever I have in the page template ie a list of links.

Has anyone used or come across a good example/tutorial for using ion-nav?

Thanks :slight_smile:

Posts: 1

Participants: 1

Read full topic

Social Share Plugin - ios doesnt show app icon

$
0
0

@31121986g wrote:

I used the social share plugin to share a link via the Native share. The popup does come well but i dont see my app icon in the header. Any guess how this can be achieved?

Posts: 1

Participants: 1

Read full topic

I have an issue with ion-icon styling

$
0
0

@samdawit wrote:

I want to use the following icons in my ionic 5 react App with their title or label at their bottom and also align them horizontally rather than vertically like a list. I tried to ion-icon, I couldn’t find colored icons and also I tried using ion-list and ion-item couldn’t get them to align horizontally and also couldn’t align the label at the bottom of the icons. So if there is anyone that can help me on what component to use to achieve the following result as shown in the attached image, it would be much appreciated, Thank you icon with text

Posts: 1

Participants: 1

Read full topic

Can't display a img using base64

$
0
0

@slammers wrote:

Hello Guys, im stuck with a Problem. In my App i want to load all Images in a Folder and displays these. I finished this part of the App already. Now I want to Display the image in a new page and show the exif Metadata of the Image. For getting the EXIF Data I need to display the Image by her Base64 Data. Here I get an error.
I converted the File to Base64 with the Base64 Plugin

this.base64.encodeFile(this.pictureItem.nativeURL).then((base64File: string) => {
  this.data = base64File;
  var tmp = data.substring(data.indexOf(','));
  this.data = 'data:image/jpeg;base64' + tmp;
}, (err) => {
  console.log(err);
});

A Base64 String is generated successful.
If I pass this String into a HTML img, nothing happens.

<img [src]="data"/>

I tried a sanitizer.bypassSecurityTrustResourceUrl already, but if I use the pipe im getting just “error” in Android Studio Console.

Please help.

Posts: 1

Participants: 1

Read full topic

Http Error 503: command: ionic cordova resources

Storage options (ionic storage, capacitor, localForage, ...)

$
0
0

@lhk wrote:

Hi,
I’ve run into issues regarding data storage and would appreciate some feedback.

So far I’ve been using the capacitor storage API.
My app will need to store a few dozen, maybe up to a 100 mb. Huge blobs of static text that need to be read very infrequently.
On mobile, capacitor uses SharedPreferences and UserDefaults. Both should be able to accommodate this.

Currently, the app targets only ios and android. But during development, I’m working in the browser. Here capacitor uses localStorage and I think I’m now running into a storage cap:

DOMException: Failed to execute 'setItem' on 'Storage': Setting the value of '_cap_test' exceeded the quota.

My app is built with React, Ionic v5 and Capacitor. What options do I have, to store large files?
I’ve done some searching:

  • ionic storage, sounds awesome. But apparently only works with angular projects. There’s an issue for this on the ionic github, it has been resolved with the recommendation to use the capacitor storage API. This is not really a solution though, since capacitor storage is very limited in the web.

  • community capacitor plugin. This plugin exposes the API I need and the repository looks very clean. But it’s maintained by just a single person. Data storage is absolutely critical for my app, I’m hesitant about adding this dependency.

  • localForage is a convenience wrapper around IndexedDB or WebSQL. Like the capacitor plugin above, this exposes a very convenient minimal API. How would this work in capacitor? How does Capacitor treat the WebSQL API ?

  • Capacitor Filesystem. This one does not have a convenient API and would make my code a little more complicated. On the web it uses IndexedDB.

Did I miss anything?
Out of these options, I think I would prefer localForage, but I have no idea how this would work with Capacitor. I want to avoid running into other storage issues down the road.

Is there an approach that you would recommend?
Currently I think I might go for localForage and if it doesn’t work on mobile I’ll write a thin abstraction layer that switches between capacitor get/set and localForage get/set. The APIs really look basically identical.

Posts: 1

Participants: 1

Read full topic

EXIF Data from HTML Image

$
0
0

@slammers wrote:

Hey,

i want to get the Exif Metadata from a img. I display this img using base64 and sanitizer. Now I can’t get the Exif Information with exif-js. I think the problem is the sanitizer.

Please Help, I spend a lot of hours right now, and I don’t got a solution…

Posts: 1

Participants: 1

Read full topic


IonInfiniteScroll problem if datasource reloaded

$
0
0

@icatanzaro wrote:

Hi, the IonInfiniteScroll fail when the datasource is reloaded.

It saves his position and making the component unusable.

We have two Pages:

  1. Page A (a list of items loaded with infinitescrolling)
  2. Page B (a detail page of list item)

I was in page A and next, click to item and go to page B for details. When i return back to page A i need to “refresh” the datasource of the ngFor. When the datasource is refreshed, the infinite scroller doesn’t work anymore.

The offsetHeight variable appears to retain the value obtained before the refresh.

Can you help me?

Posts: 1

Participants: 1

Read full topic

How to make an image compulsory ? (Ensure it is entered by user)

$
0
0

@androunie wrote:

Hello dear Ionic friends :smiley:

I am making a form, this form contains text (name, age…) and one image.
Right now I can make sure the text are necessary by using a FormGroup but I would like to make sure that the form is valid ONLY IF the image is entered.

So I tried this way: (HTML file)

 <input   formControlName="photo" type="file" (click)="selectImage()">

TS FILE:

 ngOnInit() {
    this.sellingSneakForm = new FormGroup({
      photo: new FormControl('', [Validators.required]),
    });
  }

  selectImage() {

    let actionSheet = this.actionSheetCtrl.create({
      title: 'Add an image',
      buttons: [
        {
          text: 'Take a picture from camera',
          role: 'CAMERA',

          handler: () => {
            this.takePicture();
          }
        },
        {
          text: 'Choose from your gallery',
          role: 'GALLERY',

          handler: () => {
            this.selectPicture();
          }
        },
        {
          text: 'Cancel',
          role: 'cancel',
          handler: () => {

          }
        }
      ]
    });
    actionSheet.present();
  }


  takePicture() {
    this.camera.getPicture({
      quality : 95,
      destinationType : this.camera.DestinationType.DATA_URL,
      sourceType : this.camera.PictureSourceType.CAMERA,
      encodingType: this.camera.EncodingType.JPEG,
      targetWidth: 500,
      targetHeight: 500,
    }).then(imageData => {
      this.base64Image = "data:image/jpeg;base64," + imageData;      // imageData is a base64 encoded string
      this.Picture = imageData;       //this.Picture is passing the string to our DB
    }, error => {
      console.log("ERROR -> " + JSON.stringify(error));
    });
  }

It is working 100% when I upload the image but my app does not need the image to push the item to the database… What I would like with this FormGroup and FormControl.

Is it possible this way ?

Thanks

Posts: 1

Participants: 1

Read full topic

True or False ? ( about the true nature of scss )

$
0
0

@Roye wrote:

Are the following statements correct? and if not, explain.

  1. When switching to a page using routing, the scss of the page will be used to set style.
  2. When opening a page as a modal (ModalController.create) the page’s scss is not being used.
  3. If you want to apply some style to a modal, all style data needs to be located in the global.scss file.

A question for Ionic developers is "how do you recommend to style a modal component/page?

Thank you,
Roye

Posts: 1

Participants: 1

Read full topic

Certificate issue

$
0
0

@waelabdeen wrote:

Hi,

i have one issue related to my application (Ionic 4), i already generated apk file and it works fine in emulator, and i already use https to call my backend apis and securing my backend with SSL certificate.

the problem is, when i install the apk manually in some devices, it doesn’t connect to backend until i install the backend certificate manually in the device !

i have no idea why i faced this issue only in a specific devices in android and never face in ios and how to resolve ?!

thanks

Posts: 2

Participants: 2

Read full topic

How to navigate to a particular screen when notification is clicked?

$
0
0

@raghav1299 wrote:

I want to navigate to a particular screen when a user clicks the notification but I am unable to find a solution for that. Can someone please help?

Posts: 2

Participants: 2

Read full topic

Viewing all 70435 articles
Browse latest View live


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