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

Onscroll more image is not loading

$
0
0

@vishal14 wrote:

I am using news api so first loading 5 articles so once scroll then more articles load but only text is showing no image show on scroll.

image

<ion-content>
  <ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
    <ion-refresher-content
      pullingIcon="arrow-dropdown"
      pullingText="Pull to refresh"
      refreshingSpinner="circles"
      refreshingText="Refreshing...">
    </ion-refresher-content>
  </ion-refresher>
  <ion-card *ngFor="let article of data?.articles" (click)="onGoToNewsSinglePage(article)">
    <ion-img [src]="article.urlToImage"></ion-img>

    <ion-card-content>
      <ion-card-title>{{article.title}}</ion-card-title>

      <!-- <p>{{article.description}}</p> -->
      <p class="date">{{article.publishedAt | date:'medium'}}</p>
    </ion-card-content>
  </ion-card>

  <ion-infinite-scroll (ionInfinite)="loadMoreNews($event)">
    <ion-infinite-scroll-content loadingSpinner="bubble" loadingText="Loading More.."></ion-infinite-scroll-content>
  </ion-infinite-scroll>
</ion-content>
export class Tab1Page implements OnInit {
data: any;
page = 1;
constructor(private newsService: NewsService, private router: Router) {}
ngOnInit() {
this.newsService
.getData(
  `everything?domains=wsj.com,nytimes.com&pageSize=5&page=${
    this.page
  }`
)
.subscribe(data => {
  console.log(data);
  this.data = data;
});
}
onGoToNewsSinglePage(article) {
  this.newsService.currentArticle = article;
  this.router.navigate(['/news-single']);
}
loadMoreNews(event) {
  this.page++;
  // console.log(event);
  this.newsService
    .getData(
      `top-headlines?country=in&pageSize=5&page=${
        this.page
      }`
    )
    .subscribe(data => {
      // console.log(data);
      // this.data = data;
      for (const article of data['articles']) {
        this.data.articles.push(article);
      }
      event.target.complete();
      // console.log(this.data);
    });
}

doRefresh(event) {
  setTimeout(() => {
    this.newsService
    .getData(
      `top-headlines?country=in&pageSize=5&page=${
        this.page
      }`),
    event.target.complete();
  }, 2000);
}
}

Posts: 1

Participants: 1

Read full topic


Ionic 4 - setInterval inactive tabs

$
0
0

@jamesLD wrote:

Hi,

I just started studying ionic, and made a simple countdown timer using setInterval.

I got i working, but when i move to a different chrome tab, the timer seem to have stopped.

And when i go back to by app tab, it just continues to countdown the value before the switching the tab.

Lets say, i have 60 sec countdown, then let i countdown up to 40, then switch to another chrome tab.

then waited for around 10sec. I expected the value to be 30. But timer will continue the countdown at 40.

Posts: 1

Participants: 1

Read full topic

Video player with custom dimensions

[Ionic5] - ion-segment-button-indicator width (Shadow Dom)

$
0
0

@William_Wallace wrote:

Hey there,
I found a lot Shadow-DOM Stories already and really like the feature. But also ran into some trouble when I try to customize some stylings that are not yet part of the ionic offered variables.

Long story short. I want to do the following:

  • change the ions-segment-button-indicator width to about 10%, or 20%.

There is now the feature of the css-var: --indicator-height which is great, i already use that.

So, now is the thing… I can manipulate that Shadow-DOM via JS? I red about that, but all I see is that I have to do a custom-element (class) that extends ion-segment? And then go on? Sounds really much work for me.

So is there an easy option? I know that I can request something like --indicator-width but not sure when and where. :smiley:

I am happy about any help. :wink:

Thank you in advance

Pascal

Posts: 1

Participants: 1

Read full topic

Ionic 4 Social Sharing Plugin Change The Image Format To JPEG in IOS

$
0
0

@ionicbucket wrote:

In Ionic4, I’m using social sharing Plugin & called the shareWithOptions method to share image from IOS device. My image path is -

file:///var/mobile/Containers/Data/Application/55849AB9-036D-4A6B-AFB5-8F8F95EDB374/Library/NoCloud/images/0z3aq5czc22b.tiff

This is a TIFF image file, when I want to share this image file by using Airdrop or Gmail options, every time It’s change the right image format to JPEG.

I am also trying to send a Base64 TIFF/BMP image file format but It’s always change to JPEG image.

Here is my code,

async share() {
    console.log(this.imgPath)
    var options = {
      files: [this.imgPath]
    };

    this.socialSharing.shareWithOptions(options);
  }

Also I try to use specific share via email option( shareViaEmail method) but the same problem is happening.

Anyone can know how to share the right image format using Ionic4. Couldn’t solve this issue, Any Ideas?

Posts: 1

Participants: 1

Read full topic

Molpay Plugin

$
0
0

@ladaniavadh wrote:

Hello Guys,
I am working on one of my client;s application in which i have to integrate molpay plugin, there is in xdk provided by them, i can’t get anything, please help me if anyone use it

Posts: 1

Participants: 1

Read full topic

COVID-19 Coronavirus Tracker (Ionic5, Capacitor) AdMob Integrated Full Ready App

Ecommerce App Theme/Template UI (Ionic 5 Angular 8)

$
0
0

@ionicbucket wrote:

The application has been created with top most open-source hybrid mobile apps development framework IONIC 5 & ANGULAR 8. This awesome template app is highly customizable, user and developer friendly which holds high code quality, reflects module based project structure and many more. By using this app you can easily make any large scale E-Commerce, grocery, food, fashion, restaurants, boutique coffee shop, street bar, fast food, pizza store, ice cream shop or any e-commerce related app easily.

Playstore Demo: https://play.google.com/store/apps/details?id=com.appsplaces.ecommerce
Youtube Demo: https://www.youtube.com/watch?v=8rEy7PzG8QA
https://codecanyon.net/item/ionic-5-angular-8-ui-themetemplate-ecommerce-app/screenshots/25567613?_ga=2.33991009.1506023403.1587117847-38099678.1584510408

Posts: 1

Participants: 1

Read full topic


IonTube - Youtubers Youtube Channel (Ionic 5 & Angular 8) App

$
0
0

@ionicbucket wrote:

If you are an amazing Youtuber and haunting for your own platform then IonTube is for you. This crazy app has made for YouTubers uniquely. This app has built with latest technology Ionic Framework, which is fully functional and easy to use. You can display your all works together here. The app displays your all videos, playlists, favorites and channels. You have already thousands of fan who are waiting for your new creations. Let people use their favorite channel in their device for regular use. The app has made by aiming your need and demand.

Buy: https://codecanyon.net/item/iontube-youtubers-youtube-channel-ionic-5-angular-8-app/25676765
Playstore Demo: https://play.google.com/store/apps/details?id=com.themesbuckets.iontubev2
Youtube Demo: https://www.youtube.com/watch?v=vvb44gf58k8

banner

Posts: 1

Participants: 1

Read full topic

Ion-item like a material input with outline mode

$
0
0

@tkrzykawski wrote:

Hi,

Im struggling with input style, I saw that material has outlined input with also floating mode.
The question is - how can I achieve this input:

  <mat-form-field appearance="outline">
    <mat-label>Outline form field</mat-label>
    <input matInput placeholder="Placeholder">
    <mat-icon matSuffix>sentiment_very_satisfied</mat-icon>
    <mat-hint>Hint</mat-hint>
  </mat-form-field>

You can see it in action here: https://stackblitz.com/angular/moyqbvarjgpa?file=src%2Fapp%2Fform-field-appearance-example.html

Posts: 1

Participants: 1

Read full topic

Do I have to upgrade to Ionic V6?

$
0
0

@insolvent wrote:

Hi all

Before I bore you with the technicalities, let me tell you what I am looking to achieve:
I am looking to make some updates on y existing app but apparently it can not happen due to the below.

My app has been developed on Ionic CLI 3.2

I want to now make a few changes and when I run source code via ionic serve, I am getting too many errors. It is asking me to update ionic CLI to Version 6. The system is also not allowing me to install an older version of the node as the node version was 5.x when I first developed this app and right now that seems to be old. If I try to use a newer version of the node then the app throws so many errors with the most common error being ‘app-script’ and many others.

Apologise if this question has been asked before but I have looked through many forums with no easy solution.

When the app was built the system was configured as below

Node - 5.8.0
Ionic Framework - 3
Ionic CLI - 3.2.0

Ideally what I am looking to do is update the app with the latest framework along with updating the other npm packages which also need updating with the latest SDK (as I heard apple will soon be requiring their members to update this in June).

Now I am trying to achieve all the latest versions but with the current app. Most probably the npm packages. If we use the latest npm then all its packages get updated that will cause to update their syntax and other things related to this, for example, FCM to perform a push notification.

The issue is my developer has informed me that do update this it will take 20-25 working days, which amounts to a conisderable cash outlay for something which is updating things. Normally when there are updates one would like to see that it is for their beneift and the cash outlay to update would be far less then then benefits. Here it does not seem to be the case.

So going back to y purpose:

1- Is there a way to avoid the full changes and still make changes to the source code and get it approved for the changes i want in the app?
If yes, can you please shed some light into this
2- If No, what is the easiest, most efficient way to overcome the above hurdles?
I would like to believe that Ioinc would not make changes to their platform as such that their existing users have to spend thousands to upgrade. This was not a cost I had budgeted for at all and due to the updates apparently I can not make changes to my app.

Any help would be much appreciated

Thanks

Posts: 1

Participants: 1

Read full topic

Is it possible to make ion-select usable?

$
0
0

@Bahou wrote:

Hi,

Configuration
ionic/angular project.
ionic: 5.4.16
angular: 8.2.14

My problem:
I created a reactive form with an ion-select inside with multiple selection.
Display is hugly because ionic does not display all the text and it is not usable as it is.
I just want to customize the size of the text or make it wrap.

Question:
I need to set this style at component level because my component is in a shared library.

I try to use “interfaceOptions” without any success.

Thanks for help,

Posts: 1

Participants: 1

Read full topic

How to ensure local array always contains latest data in Ionic / Angular app?

$
0
0

@Sweg wrote:

In my Ionic / Angular app, a Conversation object contains an array of Message objects.

I am able to add Conversations , no problem using the below code. When I console.log this.conversations , all of the Conversations are displayed.

private _conversations = new BehaviorSubject<Conversation[]>([]);

get conversations() {
    return this._conversations.asObservable();
}

addConversation(mechanicId: string, message: string) {
    let generatedId;
    const newConversation = new Conversation(
      Math.random().toString(),
      [new Message(
        Math.random().toString(),
        message,
      )]
    );
    return this.http.post<{ name: string }>(
      'myUrl/conversations.json',
      { ...newConversation, id: null }
    ).pipe(
      switchMap(resData => {
        generatedId = resData.name;
        console.log('My Conversations', this.conversations);
        return this.conversations;
      }),
      take(1),
      tap(conversations => {
        newConversation.id = generatedId;
        this._conversations.next(conversations.concat(newConversation));
      })
    );
  }

However, when I try to update a Conversation (i.e. add a new Message to it), when I console.log this.conversations , I am only getting back the Conversation which I am updating:

addMessageToConversation(conversationId: string, message: string) {
    let updatedConversations: Conversation[];
    return this.conversations.pipe(
      take(1),
      switchMap((conversationToUpdate: any) => {
        conversationToUpdate.messages.push(
          new Message(
            Math.random().toString(),
            message,
            this.authService.userId,
            new Date(Date.now())
          )
        );
        console.log('Conversations after adding new message', this.conversations);
        // This only shows the Conversation I am looking @ currently. I want it to have all the latest Conversations & Messages, not just this one
        return this.http.put(
          `myUrl/conversations/${conversationId}.json`,
          { ...conversationToUpdate, id: null }
        );
      }), tap(() => {
        // this._conversations.next(updatedConversations); // dont't think this is doing what I want it to
      })
    );
  }

I want to get back all of the Conversations so that _conversations always contains the latest Conversations .

Can someone please tell me how I can ensure _conversations always contains all Conversations , rather than just the one who’s ID is passed into addMessageToConversation() ?

So if I add a new Conversation, it shows all Conversations in the console. But if I add a new Message to a Conversation, it only shows that Conversation in the console, while I want it to show all Conversations.

Posts: 1

Participants: 1

Read full topic

Adding Google Analytics into Ionic 5 App

$
0
0

@travkriel wrote:

I’ve been battling with adding tracking into my app and am struggling to find clear information on what to do about it.

The two options I’ve tried so far and with no luck are:

  • Google Analytics - It asks for a tracking ID which doesn’t seem to be available within Google Analytics. There are only data stream identifiers and an overall property ID. Neither of which seem to work.

  • Google Firebase - Which seems to generate build errors as well as console log errors. Even though we are already using Firebase Authentication successfully.

Are there any clear methods or instructions to getting Google Analytics hooked up? There is a lot of conflicting advice / information out there.

Thanks!

Posts: 1

Participants: 1

Read full topic

Ionic not make apk

$
0
0

@nexoone7 wrote:

cordova.cmd build android
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=C:\Users\hp\AppData\Local\Android\Sdk (recommended setting)
ANDROID_HOME=C:\Users\hp\AppData\Local\Android\Sdk (DEPRECATED)
Cannot read property ‘length’ of undefined
[ERROR] An error occurred while running subprocess cordova.

    cordova.cmd build android exited with exit code 1.

    Re-running this command with the --verbose flag may provide more information.

any one help me plz to solve this issue whats wrong ??

Posts: 1

Participants: 1

Read full topic


Ionic Serve is stuck on "Files successfully emitted, waiting for typecheck results..."

$
0
0

@Remling wrote:

When i execute “ionic serve” in my project, the output looks as follows:

react-scripts.cmd start
[react-scripts] i 「wds」: Project is running at http://192.168.1.114/
[react-scripts] i 「wds」: webpack output is served from
[react-scripts] i 「wds」: Content not from webpack is served from C:\Users\Remling\Desktop\Code\hello\public
[react-scripts] i 「wds」: 404s will fallback to /
[react-scripts] Starting the development server…
[react-scripts]
[react-scripts] Files successfully emitted, waiting for typecheck results…

But thats where it stops, no site is opening, no error message, nothing.

onic info:

Ionic:

Ionic CLI : 6.5.0 (C:\Users\Remling\AppData\Roaming\npm\node_modules@ionic\cli)
Ionic Framework : @ionic/react 5.0.7

Capacitor:

Capacitor CLI : 2.0.1
@capacitor/core : 2.0.1

Utility:

cordova-res : not installed
native-run : 1.0.0

System:

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

Someone suggested running it on a different port, but that didnt help.

Posts: 1

Participants: 1

Read full topic

File download incomplete using dynamic link method

$
0
0

@leonardofmed wrote:

I have a text file and I’m doing some changes in it before the user downloads. All changes are made with TypeScript and don’t generate any errors. The problem I’m facing is that, when the user download the file, it always comes incomplete after a specific word. If I console.log before the actual download, I can see the file perfectly fine. The source of the problem seems to be a added reference to the file, because if I remove this ‘Add references’ part, the file is download as expected. Sadly I cannot remove this part.

This function was made for when the user is navigating through the browser:

myDownloadFunction() {
	...

	// Add references
	for (let feature of this.featuresToExport) {
		let idToExport = feature.id_;
		let featureColor:string = feature.values_.color;
		let featureHexColor = this.getColorByName(featureColor);

		let colorElement = '<Style id="app_style_'+idToExport+'"><IconStyle><Icon><href>https://earth.google.com/earth/rpc/cc/icon?color='+featureHexColor+'&amp;id=2000&amp;scale=4</href></Icon></IconStyle></Style>';

		// Add style element
		let indexOfDocument = final_output.indexOf("Document");
		let indexOfClosingDocument = final_output.indexOf(">", indexOfDocument) + 1;
		let output = [
			final_output.slice(0, indexOfClosingDocument), 
			colorElement, 
			final_output.slice(indexOfClosingDocument)
		].join('');

		// Add reference to style element
		let indexOfPlacemark = output.indexOf('Placemark id="' + idToExport + '"');
		let indexOfClosingPlacemark = output.indexOf(">", indexOfPlacemark) + 1;
		output = [
			output.slice(0, indexOfClosingPlacemark), 
			'<styleUrl>#app_style_'+idToExport+'</styleUrl>', 
			output.slice(indexOfClosingPlacemark)
		].join('');

		final_output = output;
	}	
	
	this.mainDoc = "data:text/json;charset=utf-8," + final_output;
	console.log(this.mainDoc); // <-- Here I can see the whole document perfectly fine	

	let link = document.createElement("a");
	link.download = this.file_name + this.file_extension;
	link.href = this.mainDoc;
	document.body.appendChild(link);
	link.click();
	document.body.removeChild(link);
	link = null;
}

All variables are correctly obtained and the file end in a word the middle of the text, without relation to any variable.

Originally the method I used for editing the file was jQuery.parseXML() and the same error happened, so I tried to change the method to this one I posted above.

I imagine that the problem may be some asynchronous step that is still in progress when the download event is triggered, but analyzing the code that was passed in I can’t see any asynchronous part.

Posts: 1

Participants: 1

Read full topic

Using alerts in provider

$
0
0

@Vartex05 wrote:

Hi, i have a question about using alerts in providers. For example, i have printService, which handles bluetooth connection and send data to bluetooth printer, is it ok to handle errors and display alerts for user right from the provider, or is it considered bad practise and i should create and present alerts only in components/pages?

Posts: 1

Participants: 1

Read full topic

Cannot make ionic 5 project work using capacitor on simulator/device

$
0
0

@kdefombelle wrote:

Hello,

ion build --prod and test in browser are ok.
Now I would like to test my capacitor feature (open the camera) on the devices but I am not knowledgeable enough to understand why what’s generated by the frameworks is not working and I am running out of ideas.

In short any good hint to build something that is working on iOS device or Android simulator?

I build as follows:

ionic build
npx cap copy
npx cap open android

ios simulator: ok but cannot test capacitor camera plugin which is only available on real device

on iphone XR: nok the app crashes as soon as started with below error message

dyld: Library not loaded: @rpath/Capacitor.framework/Capacitor
Referenced from: /private/var/containers/Bundle/Application/5CB1FD35-1C30-48BC-B653-5274AC471845/MyApp.app/MyApp
Reason: no suitable image found. Did find:
/private/var/containers/Bundle/Application/5CB1FD35-1C30-48BC-B653-5274AC471845/MyApp.app/Frameworks/Capacitor.framework/Capacitor: code signature invalid for ‘/private/var/containers/Bundle/Application/5CB1FD35-1C30-48BC-B653-5274AC471845/MyApp.app/Frameworks/Capacitor.framework/Capacitor’

android simulator: nok the project generated cannot be built, error is:

Manifest merger failed : Attribute application@appComponentFactory

If I add the below to gradle.properties - as per stackoverflow
android.enableJetifier=true
android.useAndroidX=true
then it enables to build but crashes as soon as started on the simulator

The capacitor code I introduced is the following

import { Component, OnInit, Input } from "@angular/core";
import { Router, ActivatedRoute } from "@angular/router";
import { Plugins, CameraSource, CameraResultType } from "@capacitor/core";
const { Camera } = Plugins;
import { DomSanitizer, SafeResourceUrl } from "@angular/platform-browser";
@Component({
  selector: "app-tab5",
  templateUrl: "tab5.page.html",
  styleUrls: ["tab5.page.scss"],
})
export class Tab5Page implements OnInit {
  imageTaken: boolean;
  image: SafeResourceUrl;

  constructor(
    private route: ActivatedRoute,
    private router: Router,
    private sanitizer: DomSanitizer
  ) {}

ngOnInit() {}

async takePhoto() {
    const result = await Camera.getPhoto({
      quality: 75,
      allowEditing: true,
      source: CameraSource.Camera,
      resultType: CameraResultType.Uri,
    });
    this.image = this.sanitizer.bypassSecurityTrustUrl(result.webPath);
    this.imageTaken = true;
  }
}

Thank you,

PS: ionic info

Ionic:

   Ionic CLI                     : 6.6.0 (/Users/me/applications/node-v10.15.3-darwin-x64/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.0.7
   @angular-devkit/build-angular : 0.901.1
   @angular-devkit/schematics    : 9.1.1
   @angular/cli                  : 9.1.1
   @ionic/angular-toolkit        : 2.2.0

Capacitor:

   Capacitor CLI   : 1.5.0
   @capacitor/core : 1.5.0

Cordova:

   Cordova CLI       : 9.0.0
   Cordova Platforms : none
   Cordova Plugins   : no whitelisted plugins (0 plugins total)

Utility:

   cordova-res : 0.12.1
   native-run  : 1.0.0

System:

   Android SDK Tools : 26.1.1 (/Users/me/Library/Android/sdk)
   ios-deploy        : 1.10.0
   ios-sim           : 8.0.2
   NodeJS            : v10.15.3 (/Users/me/applications/node-v10.15.3-darwin-x64/bin/node)
   npm               : 6.14.4
   OS                : macOS Catalina
   Xcode             : Xcode 11.4 Build version 11E146

Posts: 1

Participants: 1

Read full topic

Can you help with SqlServer plugin?

$
0
0

@caldack wrote:

Hi all, I have issues with https://www.npmjs.com/package/cordova-plugin-sqlserver in my ionic app android

I have a client that does not want an API to connect to DB, so i found this plugin but if I do a recursive function to execute the 3-4 queries that has that function. The execution time is high, so is not efficient. And if i do a simple for iteration, the interface always is blocked until all queries are finished.

I have the following question:

Exists, any plugin or other way to connect a SQL Server DB, without API and without that plugin?

If not exists… Anyone has the problems that I have with the above description?

Regards,
Sam

Posts: 1

Participants: 1

Read full topic

Viewing all 70440 articles
Browse latest View live


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