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

Problem with inserting data into database

$
0
0

@sam1408 wrote:

hi guys, I’ve been working on a project concerning a form submission to the database.
I have written some server side PHP and ts file. somehow its not working could you care to look…

php:

contact.ts:

the todo{} contains all the data that my form collects. I tried to set this.name = this.todo.name; somehow it says error when I tries to do so.

I am really new to this so please help me out.

Posts: 1

Participants: 1

Read full topic


Reverse engineer Ionic main.js and vendor.js?

Slider image is not set properly in ionic app

$
0
0

@hajkhan wrote:

i want to cover the header by this image of the slider but the image is not set properly how to set image that cover header too

 page-carousel-with-login-reg {

    ion-slides {
        background-color: whitesmoke;
        text-align: center;
    }
    ion-slide h2, ion-slide p {
        text-align: center;
        margin: 0;
        padding-left: 2.5rem;
        padding-right: 2.5rem;
        padding-top: 2rem;
        padding-bottom: 1rem;
        text-shadow: rgba(0, 7, 1, 0.1);
        font-family: Georgia, 'Times New Roman', Times, serif
        // font-family: 'Trebuchet MS', sans-serif
    }
    ion-slide h2 {
        font-size: 2rem;
        font-weight: bold;

    }
    ion-slide p {
        font-size: 1.5rem
    }
    ion-slide img{

        margin-top: 0 !important;

        width: 100%;
        -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0 90%);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 90%);

    }

}

Posts: 1

Participants: 1

Read full topic

Integrate project angular into project ionic

$
0
0

@Ibernato93 wrote:

Hello everyone,
I created a angular project following the official website guide.
Then I created an ionic project to test the application on an android device. I copied the angular file into ionic but the application shows me a white screen, while if I run the angular project it works correctly.
How do I integrate the files into the angular project in the ionic project?

Posts: 1

Participants: 1

Read full topic

Syncing with Couchbase in an Ionic 2

Info.plist issue when delivering app for iOS

$
0
0

@mateuspetter wrote:

Hello,

This issue happened to me once and I solved it by adding the Photo Library Usage Description variable to the config.xml and by making an Info.plist with the NSPhotoLibraryUsage. I’ve recently made a new project and I followed the same steps when adding the camera plugin but the error still persists.
My config xml:

<plugin name="cordova-plugin-camera" spec="^3.0.0">
        <variable name="CAMERA_USAGE_DESCRIPTION" value="..." />
        <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="..." />
   </plugin>

Info.plist

<key>NSPhotoLibraryUsageDescription</key>
<string>...</string>

The error:
Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app’s Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data

Posts: 3

Participants: 2

Read full topic

Generated back button click event in a sideMenu

$
0
0

@jeandemagny wrote:

I try to generate a back button click calling automatically setBackButtonAction() method. I have a ion-segment in a side menu and so when i open the menu i would like to call setBackButtonAction() to click on the “segment2” button.

Screenshot from 2017-11-23 23:18:11

side menu in app.html :

    <ion-menu [content]="content" side="left" id="menuParameter">
    <ion-header>
        <ion-toolbar color="default">
            <ion-segment [(ngModel)]="segmentSelected" >
                <ion-segment-button value="s1">
                  segment 1
                </ion-segment-button>
                <ion-segment-button value="s2"  click="setBackButtonAction()" >
                   segment 2
                </ion-segment-button>
            </ion-segment>
   </ion-toolbar>
</ion-header>
...

here is my code in my app.component.ts

export class AppComponent {
public segmentSelected: string = 's1';

constructor(
    public platform: Platform,
    public statusBar: StatusBar,
    public splashScreen: SplashScreen,
  public navCtrl :NavController) {
 this.platformReady();
}


  ionViewDidLoad() {
    this.setBackButtonAction()
}

//Method to override the default back button action
setBackButtonAction(){
  this.navBar.backButtonClick = () => {
  //Write here wherever you wanna do
   this.navCtrl.pop()
  }
}

public platformReady() {
    // Call any initial plugins when ready
    this.platform.ready().then(() => {
      this.statusBar.styleDefault();
      this.splashScreen.hide();
    });
  }

but it doesn’t work. Any help ?

Posts: 2

Participants: 2

Read full topic

Unhandled Exec Call

$
0
0

@Mata8 wrote:

I’ve been getting the following (error?) when debugging and simulating my ionic 2 app using Visual Studio Code. I started my app using the Ionic Super Starter template if that helps.

Anyone have an idea what I do with this? How would I go about fixing it if it is an issue? I can’t find much online about it.

Thanks!

Posts: 1

Participants: 1

Read full topic


[PROBLEM / ERROR] Import a custom component

$
0
0

@csaravia wrote:

Error: Template parse errors:
‘it-map’ is not a known element:

  1. If ‘it-map’ is an Angular component, then verify that it is part of this module.
  2. If ‘it-map’ is a Web Component then add ‘CUSTOM_ELEMENTS_SCHEMA’ to the ‘@NgModule.schemas’ of this component to suppress this message. ("

[ERROR ->]<it-map (onMapReady)=“onMapReady();” (onMapIdle)=“onMapIdle()” (onDragStart)=“onDragStart()”></it-map"): ng:///C:/Github/chuperman1/Ionic_Facebook_Firebase/src/pages/googlemap/googlemap.html@31:2
at Error (native)
at syntaxError (C:\Github\chuperman1\Ionic_Facebook_Firebase\node_modules@angular\compiler\bundles\compiler.umd.js:1550:34)
at TemplateParser.parse (C:\Github\chuperman1\Ionic_Facebook_Firebase\node_modules@angular\compiler\bundles\compiler.umd.js:12041:19)
at AotCompiler._compileComponent (C:\Github\chuperman1\Ionic_Facebook_Firebase\node_modules@angular\compiler\bundles\compiler.umd.js:22867:39)
at C:\Github\chuperman1\Ionic_Facebook_Firebase\node_modules@angular\compiler\bundles\compiler.umd.js:22764:55
at Array.forEach (native)
at AotCompiler._compileSrcFile (C:\Github\chuperman1\Ionic_Facebook_Firebase\node_modules@angular\compiler\bundles\compiler.umd.js:22748:20)
at C:\Github\chuperman1\Ionic_Facebook_Firebase\node_modules@angular\compiler\bundles\compiler.umd.js:22725:91
at Array.map (native)
at C:\Github\chuperman1\Ionic_Facebook_Firebase\node_modules@angular\compiler\bundles\compiler.umd.js:22725:56

Posts: 1

Participants: 1

Read full topic

How to remove the scrollbar in an ionic 3 page

$
0
0

@boussarhane wrote:

Hello,

I’m developing a login page and i want to remove the scrollbar, any idea on how to make that happend?
I tried to adda class to ion-content : <ion-content class="bg-image scroll">

and I applied this css code :

 .scroll {
        overflow: hidden;
    }

But it doesn’t work.
Any idea please? Thank you.

Posts: 2

Participants: 2

Read full topic

Listen for api auth errors in a DispatchPage

$
0
0

@thezoon wrote:

Hello.

Sometimes things go wrong, and I want to listen to my Api and Auth services for authentication errors, so if authentication expires for some reason (token expired, remote logout, bugs, etc.) and in that case, push the user to LoginPage or even just show an alert. Point is, access the view layer.

In pure Angular I would use a DispatchPage, a component that contains all other page components. So, the DispatchPage is always loaded and can handle this kind of logic.

But in Ionic, even if I use create a DispatchPage for my rootPage and begin navigation from there, livereloading or accessing the page directly (ie. by url) will load a given page directly, and DispatchPage is never loaded.

So is there a way to make sure Dispatch Page is always loaded in any navigation scenario, or perhaps someone has a better solution for this kind of behavior in general?

AppComponent would seem a good place for this, but NavController, AlertController, etc. are not available from here.

Posts: 2

Participants: 2

Read full topic

Ionic 2 Calendar

How to make a background process when app is not running/close

Ionic 3 google map not working in android platform

$
0
0

@ashokr wrote:

in google maps source to destination is notwrking my code isPreformatted text

import { Component } from ‘@angular/core’;
import { IonicPage, NavController, NavParams } from ‘ionic-angular’;
import { Geolocation } from ‘@ionic-native/geolocation’;

declare var google;
var distance;
var ttime;
declare var lat;
declare var lng;
var map;

/**

@IonicPage()
@Component({
selector: ‘page-getfare’,
templateUrl: ‘getfare.html’,
})
export class GetfarePage {
Destination: any = ‘’;
MyLocation: any;

map: any;

constructor(public navCtrl: NavController, public navParams: NavParams, public geolocation: Geolocation) {
}

ionViewDidLoad() {
this.initializeMap();
}
initializeMap() {

        let locationOptions = {timeout: 10000, enableHighAccuracy: true};

        this.geolocation.getCurrentPosition(locationOptions).then((position) => {

            let options = {
              center: new google.maps.LatLng(position.coords.latitude, position.coords.longitude),
              zoom: 15,
              mapTypeId: google.maps.MapTypeId.ROADMAP
            }

            /* Show our lcoation */
            this.map = new google.maps.Map(document.getElementById("map_canvas"), options);

            /* We can show our location only if map was previously initialized */
            this.showMyLocation();




        }).catch((error) => {
          console.log('Error getting location', error);
        });
    }

    /*
     * This function will create and show a marker representing your location
     */
    showMyLocation(){

        let marker = new google.maps.Marker({
            map: this.map,
            animation: google.maps.Animation.DROP,
            position: this.map.getCenter()
        });

        let markerInfo = "<h4>You are here!</h4>";

        let infoModal = new google.maps.InfoWindow({
            content: markerInfo
        });

        google.maps.event.addListener(marker, 'click', () => {
            infoModal.open(this.map, marker);
        });


    }

    calculateAndDisplayRoute() {
      let that = this;
      let directionsService = new google.maps.DirectionsService;
      let directionsDisplay = new google.maps.DirectionsRenderer;



      var destination_input = document.getElementById('cdest');
      const map = new google.maps.Map(document.getElementById('map_canvas'), {
        zoom: 7,
        center: {lat: 41.85, lng: -87.65}
      });
      directionsDisplay.setMap(map);


      if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(function(position) {
          var pos = {
            lat: position.coords.latitude,
            lng: position.coords.longitude
          };
          map.setCenter(pos);
          that.MyLocation = new google.maps.LatLng(pos);

        }, function() {

        });
      } else {
        // Browser doesn't support Geolocation
      }

      directionsService.route({
      origin: this.MyLocation,
      destination: this.Destination,
      travelMode: 'DRIVING'
    }, function(response, status) {
      if (status === 'OK') {
        directionsDisplay.setDirections(response);

        var route = response.routes[0].legs[0];
        distance = (route.distance.value * 0.000621371192).toPrecision(4);
        ttime = ((route.duration.value) / 60);


      var cost_per_mile = 2.47;
      var fdrop = 25.00;
      var min_mile = 10;


      if(distance <= min_mile){
        var ifare = fdrop;
      } else {
      var ifare = (((distance - min_mile) * cost_per_mile) + fdrop);
      }

      document.getElementById('dfare').innerHTML = '$' + ifare.toFixed(2) + '<br>' + parseFloat(distance).toFixed(2) +' Miles<BR>Estimated Time : '  + parseFloat(ttime).toFixed(2) + ' Mins ';
      } else {
        window.alert('Directions request failed due to ' + status);
      }
    });
  }

}

Posts: 1

Participants: 1

Read full topic

Permission Error Opening Gmail Compose with Lampaa com.lampaa.startapp Plugin

$
0
0

@sheamus wrote:

I am trying to get the startApp plugin to work properly, but am having trouble. I can get it to open up gmail from inside my app with:

let sApp = startApp.set({
      "action": "ACTION_VIEW",
      "package":"com.google.android.gm"
    });

However, what I’m really trying to do is get it to open up the compose view in gmail and also pass gmail the address I’m hoping to send to. This is my first time working with android intents and I’m not quite sure of a couple things:

The com.lampaa.startapp README says I can use this format to open a specific activity within the target package:

var sApp = startApp.set({ /* params */
	"component": ["com.app.name","com.app.name.Activity"]
}, { /* extras */
	"extraKey1":"extraValue1",
	"extraKey2":"extraValue2"
});

I found a few other sites that lay out how I might do this if I were developing natively with java:

Intent sendIntent = new Intent(Intent.ACTION_VIEW);
sendIntent.setType("plain/text");
sendIntent.setData(Uri.parse("test@gmail.com"));
sendIntent.setClassName("com.google.android.gm", "com.google.android.gm.ComposeActivityGmail");
sendIntent.putExtra(Intent.EXTRA_EMAIL, new String[] { "test@gmail.com" });
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "test");
sendIntent.putExtra(Intent.EXTRA_TEXT, "hello. this is a message sent from my demo app :-)");
startActivity(sendIntent);

However, when I translate what I’m seeing up in that codeblock to what the startapp documentation asks for, I get an error.

let sApp = startApp.set({
      "action": "ACTION_VIEW",
      "component": ['com.google.android.gm', 'com.google.android.gm.ComposeActivityGmail'],
      "package": 'com.google.android.gm',
      "type": "plain/text",
    }, {
      EXTRA_EMAIL: ['picard@enterprise.com'],
      EXTRA_SUBJECT: 'Your tea is ready',
      EXTRA_TEXT: "earl grey, hot."
    });
I/startApp: android.intent.extra.EMAIL
E/startApp: android.intent.extra.EMAIL
I/startApp: android.intent.extra.SUBJECT
E/startApp: android.intent.extra.SUBJECT
I/startApp: android.intent.extra.TEXT
E/startApp: android.intent.extra.TEXT
E/PluginManager: Uncaught exception from plugin
                 java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] typ=plain/text flg=0x10000000 pkg=com.google.android.gm cmp=com.google.android.gm/.ComposeActivityGmail (has extras) } from ProcessRecord{e9404d6 30081:org.gds.hop/u0a180} (pid=30081, uid=10180) not exported from uid 10091
                     at android.os.Parcel.readException(Parcel.java:1943)
                     at android.os.Parcel.readException(Parcel.java:1889)
                     at android.app.IActivityManager$Stub$Proxy.startActivity(IActivityManager.java:4365)
                     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1610)
                     at android.app.Activity.startActivityForResult(Activity.java:4472)
                     at org.apache.cordova.CordovaActivity.startActivityForResult(CordovaActivity.java:342)
                     at android.app.Activity.startActivityForResult(Activity.java:4430)
                     at android.app.Activity.startActivity(Activity.java:4791)
                     at android.app.Activity.startActivity(Activity.java:4759)
                     at com.lampa.startapp.startApp.start(startApp.java:178)
                     at com.lampa.startapp.startApp.execute(startApp.java:44)
                     at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
                     at org.apache.cordova.PluginManager.exec(PluginManager.java:132)
                     at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:57)
                     at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
                     at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
                     at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:9)
                     at android.os.Handler.dispatchMessage(Handler.java:105)
                     at android.os.Looper.loop(Looper.java:164)
                     at android.os.HandlerThread.run(HandlerThread.java:65)
  1. Does the permission mean I have to whitelist something in config.xml? If so – what do I need to whitelist?
  2. What am I doing wrong?

Posts: 1

Participants: 1

Read full topic


Error Inputing the data from the field

$
0
0

@sam1408 wrote:

hi guys I am new to Ionic so please help me out. I am creating an android application where a user has to input some value into certain fields and that value will be passed along to the server’s database.
But when I inputted the values it is not retrieved in the function. It shows undefined.
my HTML file:

my .ts file:
formorder

I tried manually inserting the data into variables. since all my inputted data is containing in the todo{} array.

my console log

Posts: 1

Participants: 1

Read full topic

Debugging Ionic Apps

$
0
0

@Vartex05 wrote:

Iam little confused about proper way to debug ionic apps, so far iam using ionic serve, or ionic run, and then i debug in developer tools(usually with console.log()). But this not seems like a right way to do this. I cant use steps and break points, and i cant see the typescript files and html templates in sources in developer tools. I saw that it cant be somehow done, that i can see it all and not only main.js , vendor.js and so on. Can u give me some advices about this? How u debug your apps? Or are there any best practises for this?

Posts: 1

Participants: 1

Read full topic

App is not working with - - prod flag build

$
0
0

@shafiul2344 wrote:

My bluetooth app is running well when I am building the app with “ionic cordova build android” command. BUT when I am building my app with - - prod flag i. e “ionic cordova build android - - prod”, my app is not getting access to the BLUETOOTH SERIAL cordova plugin and throwing error.

I am using …
ionic-angular “3.7.1” ,
ionic-native/core "4.3.0"
ionic-native/bluetooth serial “4.3.2”

Posts: 1

Participants: 1

Read full topic

How to upload the image uri or file uri(mp4 or pdf or excel etc...) into aws s3 bucket in ionic2?

Minimaps not being generated

$
0
0

@garg10may wrote:

Running ionic resources is not generating minimaps folders for android due to which the build is failing.

C:\Users\tanmay\Utrade\GMEX\utrade\web\utrade\static\utrade\HybridApp\ionic>ionic resources
Ionic icon and splash screen resources generator
uploading icon.png…
uploading splash.png…
splash.png (2732x2732) upload complete
icon.png (1024x1024) upload complete
generating icon ios icon-small@3x.png (87x87)…
generating icon ios icon-small@2x.png (58x58)…
generating icon ios icon-small.png (29x29)…
icon ios icon-small.png (29x29) generated
generating icon ios icon-83.5@2x.png (167x167)…
icon ios icon-small@2x.png (58x58) generated
generating icon ios icon-76@2x.png (152x152)…
icon ios icon-small@3x.png (87x87) generated
generating icon ios icon-76.png (76x76)…
icon ios icon-76@2x.png (152x152) generated
generating icon ios icon-72@2x.png (144x144)…
icon ios icon-76.png (76x76) generated
generating icon ios icon-72.png (72x72)…
icon ios icon-83.5@2x.png (167x167) generated
generating icon ios icon-60@3x.png (180x180)…
icon ios icon-72.png (72x72) generated
generating icon ios icon-60@2x.png (120x120)…
icon ios icon-72@2x.png (144x144) generated
generating icon ios icon-60.png (60x60)…
icon ios icon-60@3x.png (180x180) generated
generating icon ios icon-50@2x.png (100x100)…
icon ios icon-60.png (60x60) generated
generating icon ios icon-50.png (50x50)…
icon ios icon-60@2x.png (120x120) generated
icon ios icon-40@3x.png (120x120) generated
generating icon ios icon-40@2x.png (80x80)…
icon ios icon-40@2x.png (80x80) generated
generating icon ios icon-40.png (40x40)…
icon ios icon-50@2x.png (100x100) generated
generating icon ios icon@2x.png (114x114)…
icon ios icon-50.png (50x50) generated
generating icon ios icon.png (57x57)…
icon ios icon-40.png (40x40) generated
generating icon android drawable-xxxhdpi-icon.png (192x192)…
icon ios icon@2x.png (114x114) generated
icon android drawable-xxhdpi-icon.png (144x144) generated
generating icon android drawable-xhdpi-icon.png (96x96)…
icon ios icon.png (57x57) generated
icon android drawable-hdpi-icon.png (72x72) generated
generating icon android drawable-mdpi-icon.png (48x48)…
icon android drawable-xxxhdpi-icon.png (192x192) generated
generating icon android drawable-ldpi-icon.png (36x36)…
icon android drawable-xhdpi-icon.png (96x96) generated
generating splash android drawable-port-xxxhdpi-screen.png (1280x1920)…
icon android drawable-mdpi-icon.png (48x48) generated
generating splash android drawable-port-xxhdpi-screen.png (960x1600)…
icon android drawable-ldpi-icon.png (36x36) generated
generating splash android drawable-port-xhdpi-screen.png (720x1280)…
splash android drawable-port-xxhdpi-screen.png (960x1600) generated
generating splash android drawable-port-hdpi-screen.png (480x800)…
splash android drawable-port-xhdpi-screen.png (720x1280) generated
generating splash android drawable-port-mdpi-screen.png (320x480)…
splash android drawable-port-xxxhdpi-screen.png (1280x1920) generated
generating splash android drawable-port-ldpi-screen.png (240x320)…
splash android drawable-port-hdpi-screen.png (480x800) generated
generating splash android drawable-land-xxxhdpi-screen.png (1920x1280)…
splash android drawable-port-mdpi-screen.png (320x480) generated
generating splash android drawable-land-xxhdpi-screen.png (1600x960)…
splash android drawable-port-ldpi-screen.png (240x320) generated
generating splash android drawable-land-xhdpi-screen.png (1280x720)…
splash android drawable-land-xxhdpi-screen.png (1600x960) generated
generating splash android drawable-land-hdpi-screen.png (800x480)…
splash android drawable-land-xxxhdpi-screen.png (1920x1280) generated
generating splash android drawable-land-mdpi-screen.png (480x320)…
splash android drawable-land-xhdpi-screen.png (1280x720) generated
generating splash android drawable-land-ldpi-screen.png (320x240)…
splash android drawable-land-hdpi-screen.png (800x480) generated
splash ios Default~iphone.png (320x480) generated
generating splash ios Default@2x~iphone.png (640x960)…
splash android drawable-land-ldpi-screen.png (320x240) generated
generating splash ios Default-Portrait~ipad.png (768x1024)…
splash android drawable-land-mdpi-screen.png (480x320) generated
generating splash ios Default-Portrait@~ipadpro.png (2048x2732)…
splash ios Default@2x~iphone.png (640x960) generated
generating splash ios Default-Portrait@2x~ipad.png (1536x2048)…
splash ios Default-Portrait~ipad.png (768x1024) generated
generating splash ios Default-Landscape~ipad.png (1024x768)…
splash ios Default-Portrait@~ipadpro.png (2048x2732) generated
generating splash ios Default-Landscape@~ipadpro.png (2732x2048)…
splash ios Default-Landscape~ipad.png (1024x768) generated
generating splash ios Default-Landscape@2x~ipad.png (2048x1536)…
splash ios Default-Portrait@2x~ipad.png (1536x2048) generated
generating splash ios Default-Landscape-736h.png (2208x1242)…
splash ios Default-Landscape@~ipadpro.png (2732x2048) generated
generating splash ios Default-736h.png (1242x2208)…
splash ios Default-Landscape@2x~ipad.png (2048x1536) generated
generating splash ios Default-667h.png (750x1334)…
splash ios Default-Landscape-736h.png (2208x1242) generated
generating splash ios Default-568h@2x~iphone.png (640x1136)…
splash ios Default-736h.png (1242x2208) generated
splash ios Default-667h.png (750x1334) generated
splash ios Default-568h@2x~iphone.png (640x1136) generated

Fails with error - Error: cmd: Command failed with exit code 1 Error output:
C:\Users\tanmay\Utrade\GMEX\utrade\web\utrade\static\utrade\HybridApp\ionic\platforms\android\build\intermediates\manifests\full\debug\AndroidManifest.xml:24:23-35: AAPT: No resource found that matches the given name (at ‘icon’ with value ‘@mipmap/icon’).

Posts: 1

Participants: 1

Read full topic

Viewing all 49110 articles
Browse latest View live


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