Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all 48981 articles
Browse latest View live

Stackblitz - ionic4


How to use custom component inside modal controller

$
0
0

@mathewk wrote:

Hi, How to use a custom component inside the modal controller.

let modal = this.modaCtrl.create(‘customComponent’);

this shows an invalid link error

Posts: 1

Participants: 1

Read full topic

Ionic V4 align button contents (text, icon) left instead of center

$
0
0

@Stck wrote:

ion-button contains a span with:
align-items: center;

I want a button that has width: 100%, but where the contents are aligned left.

However, because the span is under #shadow-root, I cannot simply put this into my global.scss:
.button-inner {
align-items: left;
}

I also don’t see a variable that is exposed for this. How can I achieve button contents to be aligned left?

Thanks!

Posts: 1

Participants: 1

Read full topic

Unable to use "ionic-img-viewer" in ionic4

$
0
0

@pantarmj wrote:

I am using “ionic-img-viewer” in my ionic application and I am unable to use it in ionic4. It is showing the following error in console:

StaticInjectorError(AppModule)[ImageViewerController -> App]:
StaticInjectorError(Platform: core)[ImageViewerController -> App]:
NullInjectorError: No provider for App!

Please refer link (https://www.npmjs.com/package/ionic-img-viewer) for ionic-img-viewer documentation.

Can any body help me plz to resolve this error. Please note that I am unable to use it in ionic4 only. It is working properly in ionic3.

Posts: 1

Participants: 1

Read full topic

AdMob Pro/Free/Plus not working with Ionic 3

$
0
0

@rehanmobileapps wrote:

Hi Team,

I tried to implement Admob free, Admob pro, Admob Plus. All three works with test ads and when “isTesting”:true. But Production Ad is not showing in all the three plugins, But I see in admob that the ad gets counted. If autoshow: true then it wont show anything, if authshow: false then when we forcibly show ads it shows black color.

I read some posts that Admob implementation has been changed after Android 7 Please can anyone tell me have u fixed this issue ???

FRIENDS or IONIC TEAM Please someone look into this issue ASAP

Steps to reproduce :slight_smile:
create blank project
Add the code from the ionic native plugin website
Add a live ad from the admob website

I tried all three plugins none is working !!! :sob: :sob: :sob::sob::sob:

Posts: 1

Participants: 1

Read full topic

Ionic-4-rest-api-calls-not-working-on-the-device

$
0
0

@OmkarHLT wrote:

Hello Team Struggling to get the API working on android Device tried the below ways still no help.

Have my release in 2 days but stuck with this issue

Tried

  1. Updated the config.xml with allowed and access tags
  2. updated api to allow access from same origin
  3. Updated the cordova plugins nothing seems working
    4, Added to index file

Config.xmL

<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
 <access origin="*" />

   <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" /

Index.html

<meta http-equiv="Content-Security-Policy" content="img-src 'self' data:; default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">


Cnfiguration Details

 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.0.0, (and 7 other plugins)

System:

   NodeJS : v10.7.0 (C:\Program Files\nodejs\node.exe)
   npm    : 5.3.0
   OS     : Windows 10

ionic (Ionic CLI)             : 4.6.0
   Ionic Framework               : @ionic/angular 4.0.0-beta.7
   @angular-devkit/build-angular : 0.7.5
   @angular-devkit/schematics    : 0.7.5
   @angular/cli                  : 6.1.5
   @ionic/angular-toolkit        : not installed

Error [Error screen](https://i.stack.imgur.com/kQGm5.png)

Please Help

Posts: 1

Participants: 1

Read full topic

Type 'AbstractControl' is not assignable to type 'string' / Unable to cast and save individual information from formGroup

$
0
0

@sanesma93 wrote:

Hey everybody. I have a form group for the information of a transaction and I want to get the individual field values of the form to save it.
When I check the logs it shows that the data from the form is being fetched without problems:

amount: "420444"
destination: "DE36584fh9"
recipient: "John Johnso545n"
reference: "Testerinoadfhg"

however, I want to be able to access the individual values of the form instead of the whole form as an object because I have a function that takes several arguments so what I want to do is to have individual values for
amount, destination, etc.

this is my form:

this.transactionForm = formBuilder.group({
      recipient: [''],
      destination: [''],
      amount: [0.01],
      type: ['now'],
      reference:  [''],
      date: [new Date().toISOString().split('T')[0]]
    });

and this is what I tried to do to save the information:

this.templateServicerino.createTemplate(this.transactionForm.controls['destination'], this.transactionForm.controls['recipient'], this.transactionForm.controls['amount'], this.transactionForm.controls['reference'] );

when that didn’t work I tried a single value just to check:

let referencerino: string;
referencerino = this.transactionForm.controls['reference'];

and the IDE shows the error : TS2322: Type ‘AbstractControl’ is not assignable to type ‘string’.

Thank you in advance for your help

Posts: 2

Participants: 1

Read full topic

[ionic 4] How to remove Capacitor from app?

$
0
0

@gigocabrera wrote:

I added @capacitor to my ionic 4 app and now I want to remove it and just focus on ionic-native.

How can I remove @capacitor?

Posts: 3

Participants: 2

Read full topic


Record audio then save it to the assets file ionic

$
0
0

@safaAlshaarri wrote:

hi every one
i have an application when i need the user recorde an audio then save this file as mp3 in /www/assets/audios
how i can do that ??

Posts: 1

Participants: 1

Read full topic

How to read the pdf data from the url and show pdf content in html in ionic3?

$
0
0

@RomnEmpire wrote:

Hi to all,
I have to load the data from the pdf URL In the pdf content of the chapter detail I have tried sanitizer but it’s not working for me I have got cannot get/null in the HTML section .tell me any another way to read the data of pdf URL and show in HTML.i have used bypassSecurityTrustResourceUrl for read pdf but got null.

getChapterDetail() {

//postMethod for post data in the API.....
this.service.postMethod1(this.service.baseurl()+'syllabus_details').then(data => {
  if(data.status == 1) {
      this.syllabusDetail = data.data.syllabus_data[0];

      //
       var pdfLink = this.sanitizer.bypassSecurityTrustResourceUrl(this.syllabusDetail.subject_data);
       console.log('dddd' +pdfLink);

     // this.showPdf(this.syllabusDetail.subject_data);

  }  
},error => {
  console.log(error)

});
}
//html section where we have to display pdf content
 <iframe [src]="pdfLink" width="100%" height="100%" frameborder="0" ></iframe>  

Posts: 1

Participants: 1

Read full topic

I can not Publishing my app android?

NG2-Charts + Ionic4

$
0
0

@tinnocente wrote:

Hi all,

has anyone been able to use Ng2-Charts with Ionic 4? I followed the Ionic3 tutorial linked below but I am running into the error “Can’t bind to ‘datasets’ since it isn’t a known property of ‘canvas’”

https://www.djamware.com/post/598953f880aca768e4d2b12b/creating-beautiful-charts-easily-using-ionic-3-and-angular-4

I also followed steps in this community and at their issue tracker (https://github.com/valor-software/ng2-charts/issues/553)

Is there an alternate charting package that has been tested on Ionic 4 RC0?

Thanks!

Posts: 1

Participants: 1

Read full topic

[ionic 4] EmailComposer Plugin TypeError: Object(...)

$
0
0

@gigocabrera wrote:

I’m getting the following error when I try to use the EmailComposer plugin on my ionic 4 app. I followed the installation and usage instructions from this page.

What am I missing?

core.js:14597 ERROR Error: Uncaught (in promise): TypeError: Object(...) is not a function
TypeError: Object(...) is not a function
    at index.js:202
    at Module../node_modules/@ionic-native/email-composer/index.js (index.js:306)
    at __webpack_require__ (bootstrap:83)
    at Module../src/app/pages/submenu/submenu.ts (pages-submenu-submenu-module.js:1723)
    at __webpack_require__ (bootstrap:83)
    at Module../src/app/pages/submenu/submenu.module.ts (pages-submenu-submenu-module.js:1657)
    at __webpack_require__ (bootstrap:83)
    at $_lazy_route_resource lazy namespace object:56
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388)
    at Object.onInvoke (core.js:16156)
    at resolvePromise (zone.js:814)
    at resolvePromise (zone.js:771)
    at zone.js:873
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
    at Object.onInvokeTask (core.js:16147)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)
    at drainMicroTaskQueue (zone.js:595)

Posts: 1

Participants: 1

Read full topic

Build problems after Cordova and Cordova-Android update

$
0
0

@Llarian wrote:

Hi there,

what I did and the cli answered is below:
(bold is mine, three dots is stuff I snipped)

npm uninstall -g cordova
npm install -g cordova

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0
cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
@ionic/app-scripts : 3.2.1
Cordova Platforms  : android 6.2.3
Ionic Framework    : ionic-angular 3.9.2

ionic cordova platform remove android
ionic cordova platform add android

Using cordova-fetch for cordova-android@~7.1.1
Adding android project...
Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: de.llarian.logbook
        Name: The_Logbook
        Activity: MainActivity
        Android target: android-27
Android project created with cordova-android@7.1.4
...

ionic cordova build android

...
Preparing "Install Android SDK Platform 27 (revision: 3)".
...
"Install Android SDK Platform 27 (revision: 3)" finished.
...
:app:transformDexArchiveWithDexMergerForDebug
Dex: Error converting bytecode to dex:
 FAILED
38 actionable tasks: 38 executed

Cause: com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/PermissionHelper;
    UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/PermissionHelper;

com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/PermissionHelper;
        at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:661)
        at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:616)
        at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:598)
        at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
        at com.android.dx.merge.DexMerger.merge(DexMerger.java:198)
        at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:61)
        at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:36)
        at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

FAILURE: Build failed with an exception.
...
cmd: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.

... and some more

So, what went wrong and how to get it to build at the updated level?

All help really appreciated!

Posts: 1

Participants: 1

Read full topic

Tutorial in documentation for version 4 doesn't work

$
0
0

@AnastasiaR wrote:

Hello, all. I’m trying Ionic for the first time and am about to give up. I’ve been working through the tutorial in the documentation https://beta.ionicframework.com/docs/developer-resources/guides/first-app-v4/ios-android-camera and it doesn’t work. The camera functionality of it, to be specific.

So first, this line: ```
npm install --save @ionic-native/camera@beta

Seemed to have a circular dependency of some sort. I managed to re-install everythign with npm install npm -g

Then the next line: ```
ionic cordova plugin add cordova-plugin-camera

Didn’t work, because I had cordova 5.5 installed (or it was installed with ionic version 4), and it needed cordova 6. Lower versions of cordova 6 couldn’t find some method, so I finally installed a later version of cordova 6 that installed with no error messages. I was able to add the cordova-plugin-camera.

But now the project doesn’t compile. New error:
"
[cordova] FAILURE: Build failed with an exception.
[cordova]
[cordova] * Where:
[cordova] Build file ‘C:\Development\TerrestrialOrigin\IonicTutorial\PhotoGallery\platforms\android\build.gradle’ line:
255
[cordova]
[cordova] * What went wrong:
[cordova] A problem occurred evaluating root project ‘android’.
[cordova] > Could not get unknown property ‘ANDROID_SUPPORT_ANNOTATIONS_VERSION’ for object of type org.gradle.api.inte
rnal.artifacts.dsl.dependencies.DefaultDependencyHandler.
"
Really don’t know what to do at this point? Should I try Ionic 3 or does it have just as many problems?

Posts: 1

Participants: 1

Read full topic


Ionic 4 and IphoneX

$
0
0

@vptcnt wrote:

Hello,

How to do a list of cards on Ionic 4 to respect the safe area on iPhone X - landscape

I tried this :slight_smile:

<ion-content>
    <ion-list>
        <ion-item>
            <ion-label>
                <ion-card>
                    <ion-card-header>
                        <ion-card-subtitle>Subtitle</ion-card-subtitle>
                        <ion-card-title>Title</ion-card-title>
                    </ion-card-header>
               </ion-card>
               ...
            </ion-label>
        </ion-item>
    </ion-list>
</ion-content>

It’s not working on iPhone X with the safe area.
How should ?

Thanks
Vincent

Posts: 1

Participants: 1

Read full topic

Get user name of author from firebase

$
0
0

@aligassan wrote:

hi , l am try to build simple app database connection with firebase . l used authentication email and password for access to my app and he is working fine . And when l post in database he is working fine either . l am tired to find way to show the user name or the email address for who post in database , but unfortunately no way . there is any way to to show the user name or email address for anyone who post in databases ?

l try this code for showing email address but l got the same email only !

ionViewDidLoad() {

  this.fire.authState.subscribe(data =>{
    console.log(data)
    if (data.email && data.uid){
      this.adderss = data.email
    }else{

    }
    
    })

 }

Capture

my real time databases

1

any solution please with simple code ?

Posts: 1

Participants: 1

Read full topic

Background service to trigger local notification

$
0
0

@dilipwk wrote:

I want to trigger local notification whenever the device connected to internet. It works fine if the app is in background but need to set the service even if the app is killed.

https://ionicframework.com/docs/native/background-mode/ doesn’t works if the app is killed.

https://ionicframework.com/docs/native/local-notifications/ provides triggers notification even if the app is killed for timer and geo location.

Same like I want to trigger notification whenever the device connected to internet even if the app is closed.

Posts: 1

Participants: 1

Read full topic

Conflict Between Google Plugins

$
0
0

@mahmoudmobile55 wrote:

Hello all,

i have ionic 3 application and i have used FCM Plugin and GeoLocation Plugin but when i trying to use the app and make a build it is showing warning message (developer warning for package XXXXXXX failed to post notification on channel “null” see log for more details)

so please if anyone can help

thanks

Posts: 1

Participants: 1

Read full topic

Header in HTTP GET request

$
0
0

@patilsuraj767 wrote:

Hello,

I am trying to send the GET request to ovirt server but gets error 401 (Unauthorized).

Here is some more detailed background.

First I send the POST request to the server to get the authentication token, this goes successful and I get the auth token.

Then I am trying to send the GET request with authentication token in the header as below.

getdata() {
    
  this.token = 'xxxxxxxxxx';

  let headers = new HttpHeaders();  
      headers = headers.append("Content-Type", "application/x-www-form-urlencoded");
      headers = headers.append("Accept", "application/json");
      headers = headers.append("Authorization", "Bearer " +this.token);

      return new Promise(resolve => {
        //, {headers: headers}
        this.http.get(this.baseUrl+'/ovirt-engine/api/vms',{headers: headers}).subscribe(data => {
          console.log(data);
          resolve(data);
        }, err => {
          resolve(err)
          console.log(err);
        });
      });
}

But I get 401 (Unauthorized)


What difference I have observed in the POST request which is working and the GET request is the headers.

Below is the screen shot from chrome inspect tool.

GET request header -

Screenshot%20from%202019-01-13%2016-40-02

POST request header -

Screenshot%20from%202019-01-13%2016-43-32

Why when I sent the GET request “Content-Type” and " Accept" header is not shown in the chrome in inspect tool?

Curl commands which works -

# curl -X POST  -H 'Accept: application/json' -H 'Content-type: application/x-www-form-urlencoded'  https://ovirt.example.com/ovirt-engine/sso/oauth/token -d "grant_type=password&scope=ovirt-app-api&username=admin%40example.com&password=xyz!"


# curl -X GET  -H 'Accept: application/json' -H 'Content-type: application/x-www-form-urlencoded' -H 'Authorization: Bearer xxxxxtokenxxxxx  https://ovirt.example.com/ovirt-engine/api/vms

Any help is appreciated :slight_smile:

Thanks in advance.

Posts: 1

Participants: 1

Read full topic

Viewing all 48981 articles
Browse latest View live


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