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

Import Google Material Icon in Ionic Apps

$
0
0

Somone can help me to solve my issue ?

Regards,


While running "ionic cordova run android" command I am getting below error. Is there any way to get it fixed?

$
0
0

Hi Sujan,

Did not get your point can u pl come again ?....and code is already formatted there is no syntax error.

How to use ionic 2 calendar native

View dosen't update

$
0
0

in my app i'm trying to connect to BLE and show status of connecting on {{status}} variables. this is my code, this is scan() method and called when user press a button :

scan() {
let that = this;
this.ble.scan([], 1).subscribe(d=> {
  this.devices = d;
  this.l = d.id.toString();
  this.ble.connect(d.id).subscribe(p => {
    that.status = "connected"
    let lastChar = p.characteristics[p.characteristics.length - 1];
    let serviceId = lastChar.service;
    let chUUID = lastChar.characteristic;
    // this.ble.write(d.id.toString(), serviceId, chUUID, this.stringToBytes("HOPE AGAIN")).then(() => {

    // })
    this.ble.startNotification(d.id, serviceId, chUUID).subscribe(p => {
      that.status = "NOTI";
      // this.cdata = typeof p;
      this.ble.read(d.id, serviceId, chUUID).then(p => {
        that.status = "CHANGEEED";
      })
    })
    // this.connected = "SUCESSFULLY CONNECTED TO ";
    // this.cdata = JSON.stringify(p);
  })
})

in any state of promise like ble.connect,or ble.startNotification, or ble.write i change the status variable, but nothing change and the wonderfull thing is my app successfully connected to device and can write on device , so it means it successfully connected and must show connected string. but nothing is show or changed.

Making a Website Using Ionic & Firebase Hosting

$
0
0

Thanks for sharing. One comment: Instead of ionic serve I suggest you use npm run build --prod to build your www folder. This runs a production build and makes the files in www/build much smaller.

View dosen't update

$
0
0

Had a similar problem like this, messages not refreshing on the view. What I did is use ngZone

import { NgZone } from '@angular/core';

constructor(private zone: NgZone){
     ...
}

then in your code:

//do this for each message
this.zone.run(() => {
    this.status = "CHANGED";
})

Basicly run zone.run() for every status message change.

Ionic/Angular and Firebase Phone Authentication

$
0
0

Hello Mahmoud, you should take a look at this.

It's a good tutorial, but don't seem to work on Phones. In the comment section there are a few people debating and developing plugins to fix the problem.
Take a look!

Hope it can help you.

PS: I wasn't able to make it work, i don't understand how these plugins+ how import them works. If you're able to make it work, PLEASE contact me!

Have a nice day!

Local notification not getting triggered on exact set time and is not consistent on ionic

$
0
0

Issue :
As a part of my project requirement, I need to display local-notification exactly at 7:07am, 8:08am upto 8:08pm except 9:09. But sometimes, local-nitifications are delayed by 2-3 minutes & sometimes it completely misbehaves.
Ex. - notification for 10:10am gets triggered at 11:10pm. Is it possible to display notifications exactly at desired time?

setSamaySampanata(){
let dt = new Date();
//console.log("----- peacePrayer.ts ---- setSamaySampanata() ---- Scheduling All Samay Sampanata reminders -----");
if( this.wantSamaySampanat == true ) {
console.log("----- peacePrayer.ts ---- setSamaySampanata() ---- Scheduling All Samay Sampanata reminders -----" + dt.getHours() +dt.getMinutes());
let seven = 0;
let eigth = 0;
let ten = 0;
let eleven = 0;
let twelv = 0;
let one = 0;
let two = 0;
let three = 0;
let four = 0;
let five = 0;
let six = 0;
let sevenPM = 0;
let eigthPM = 0;

		if((dt.getHours() == 7  && dt.getMinutes() > 7) || (dt.getHours() == 8  && dt.getMinutes() < 8)){
			 seven = 1;
			 console.log("------setSamaySampanata-----after-----seven")
		 }
		if((dt.getHours() == 8  && dt.getMinutes() > 8) || (dt.getHours() == 10  && dt.getMinutes() < 10)){
			 eigth = 1;
			 console.log("------setSamaySampanata-----after-----eigth")
		 }
		if((dt.getHours() == 10  && dt.getMinutes() > 10) || (dt.getHours() == 11  && dt.getMinutes() < 11)){
			 ten = 1;
			 console.log("------setSamaySampanata-----after-----ten")
		 }
		if((dt.getHours() == 11  && dt.getMinutes() > 11) || (dt.getHours() == 12  && dt.getMinutes() < 12)){
			 eleven = 1;
			 console.log("------setSamaySampanata-----after-----eleven")
		 }
		if((dt.getHours() == 12  && dt.getMinutes() > 12) || (dt.getHours() == 13  && dt.getMinutes() < 1)){
			 twelv = 1;
			 console.log("------setSamaySampanata-----after-----twelv")
		 }
		if((dt.getHours() == 13  && dt.getMinutes() > 1) || (dt.getHours() == 14  && dt.getMinutes() < 2)){
			 one = 1;
			 console.log("------setSamaySampanata-----after-----one")
		 }
		if((dt.getHours() == 14  && dt.getMinutes() > 2) || (dt.getHours() == 15  && dt.getMinutes() < 3)){
			 two = 1;
			 console.log("------setSamaySampanata-----after-----two")
		 }
		if((dt.getHours() == 15  && dt.getMinutes() > 3) || (dt.getHours() == 16  && dt.getMinutes() < 4)){
			 three = 1;
			 console.log("------setSamaySampanata-----after-----three")
		 }
		if((dt.getHours() == 16  && dt.getMinutes() > 4) || (dt.getHours() == 17  && dt.getMinutes() < 5)){
			 four = 1;
			 console.log("------setSamaySampanata-----after-----four")
		 }
		if((dt.getHours() == 17  && dt.getMinutes() > 5) || (dt.getHours() == 18  && dt.getMinutes() < 6)){
			 five = 1;
			 console.log("------setSamaySampanata-----after-----five")
		 }
		if((dt.getHours() == 18  && dt.getMinutes() > 6) || (dt.getHours() == 19  && dt.getMinutes() < 7)){
			 six = 1;
			 console.log("------setSamaySampanata-----after-----six")
		 }
		if((dt.getHours() == 19  && dt.getMinutes() > 7) || (dt.getHours() == 20  && dt.getMinutes() < 8)){
			 sevenPM = 1;
			 console.log("------setSamaySampanata-----after-----seven")
		 }
		if(dt.getHours() == 20  && dt.getMinutes() > 8){
			 eigthPM = 1;
			 console.log("------setSamaySampanata-----after-----eigthPM")
		 }

	LocalNotifications.schedule([{
          id: 707,
          title: '07:07 SAMAY SAMPANATA Reminder',
          text: 'This is hourly reminder for SAMAY SAMPANATA.',
          at: new Date(Date.parse(dt.getFullYear() +"-" + (dt.getMonth() + 1) + "-" + (dt.getDate() + seven) +" 07:07:00 +0530")),
          led: '0000FF',
		        every: 'day',
		        sound: 'file://audio/SamaySampannaRing.mp3'
      },{
          id: 808,
          title: '08:08 SAMAY SAMPANATA Reminder',
          text: 'This is hourly reminder for SAMAY SAMPANATA.',
          at: new Date(Date.parse(dt.getFullYear() +"-" + (dt.getMonth() + 1) + "-" + (dt.getDate() + eigth) +" 08:08:00 +0530")),
          led: '0000FF',
		        every: 'day',
		        sound: 'file://audio/SamaySampannaRing.mp3'
      },{
					  id: 1010,
          title: '10:10 SAMAY SAMPANATA Reminder',
          text: 'This is hourly reminder for SAMAY SAMPANATA.',
          at: new Date(Date.parse(dt.getFullYear() +"-" + (dt.getMonth() + 1) + "-" + (dt.getDate() + ten)  +" 10:10:00 +0530")),
          led: '0000FF',
		        every: 'day',
		        sound: 'file://audio/SamaySampannaRing.mp3'
      },{
					  id: 1111,
          title: '11:11 SAMAY SAMPANATA Reminder',
          text: 'This is hourly reminder for SAMAY SAMPANATA.',
          at: new Date(Date.parse(dt.getFullYear() +"-" + (dt.getMonth() + 1) + "-" + (dt.getDate() + eleven)  +" 11:11:00 +0530")),
          led: '0000FF',
		        every: 'day',
		        sound: 'file://audio/SamaySampannaRing.mp3'
      },{
					  id: 1212,
          title: '12:12 SAMAY SAMPANATA Reminder',
          text: 'This is hourly reminder for SAMAY SAMPANATA.',
          at: new Date(Date.parse(dt.getFullYear() +"-" + (dt.getMonth() + 1) + "-" + (dt.getDate() + twelv)  +" 12:12:00 +0530")),
          led: '0000FF',
		        every: 'day',
		        sound: 'file://audio/SamaySampannaRing.mp3'
      },{
					  id: 1301,
          title: '01:01 SAMAY SAMPANATA Reminder',
          text: 'This is hourly reminder for SAMAY SAMPANATA.',
          at: new Date(Date.parse(dt.getFullYear() +"-" + (dt.getMonth() + 1) + "-" + (dt.getDate() + one)  +" 13:01:00 +0530")),
          led: '0000FF',
		        every: 'day',
		        sound: 'file://audio/SamaySampannaRing.mp3'
      },{
					  id: 1402,
          title: '02:02 SAMAY SAMPANATA Reminder',
          text: 'This is hourly reminder for SAMAY SAMPANATA.',
          at: new Date(Date.parse(dt.getFullYear() +"-" + (dt.getMonth() + 1) + "-" + (dt.getDate() + two)  +" 14:02:00 +0530")),
          led: '0000FF',
		        every: 'day',
		        sound: 'file://audio/SamaySampannaRing.mp3'
      },{
					  id: 1503,
          title: '03:03 SAMAY SAMPANATA Reminder',
          text: 'This is hourly reminder for SAMAY SAMPANATA.',
          at: new Date(Date.parse(dt.getFullYear() +"-" + (dt.getMonth() + 1) + "-" + (dt.getDate() + three)  +" 15:03:01 +0530")),
          led: '0000FF',
		        every: 'day',
		        sound: 'file://audio/SamaySampannaRing.mp3'
      },{
					  id: 1604,
          title: '04:04 SAMAY SAMPANATA Reminder',
          text: 'This is hourly reminder for SAMAY SAMPANATA.',
          at: new Date(Date.parse(dt.getFullYear() +"-" + (dt.getMonth() + 1) + "-" + (dt.getDate() + four)  +" 16:04:00 +0530")),
          led: '0000FF',
		        every: 'day',
		        sound: 'file://audio/SamaySampannaRing.mp3'
      },{
					  id: 1705,
          title: '05:05 SAMAY SAMPANATA Reminder',
          text: 'This is hourly reminder for SAMAY SAMPANATA.',
          at: new Date(Date.parse(dt.getFullYear() +"-" + (dt.getMonth() + 1) + "-" + (dt.getDate() + five)  +" 17:05:00 +0530")),
          led: '0000FF',
		        every: 'day',
		        sound: 'file://audio/SamaySampannaRing.mp3'
      },{
					  id: 1806,
          title: '06:06 SAMAY SAMPANATA Reminder',
          text: 'This is hourly reminder for SAMAY SAMPANATA.',
          at: new Date(Date.parse(dt.getFullYear() +"-" + (dt.getMonth() + 1) + "-" + (dt.getDate() + six)  +" 18:06:00 +0530")),
          led: '0000FF',
		        every: 'day',
		        sound: 'file://audio/SamaySampannaRing.mp3'
      },{
					  id: 1907,
          title: '07:07 SAMAY SAMPANATA Reminder',
          text: 'This is hourly reminder for SAMAY SAMPANATA.',
          at: new Date(Date.parse(dt.getFullYear() +"-" + (dt.getMonth() + 1) + "-" + (dt.getDate() + sevenPM)  +" 19:07:00 +0530")),
          led: '0000FF',
		        every: 'day',
		        sound: 'file://audio/SamaySampannaRing.mp3'
      },{
					  id: 2008,
          title: '08:08 SAMAY SAMPANATA Reminder',
          text: 'This is hourly reminder for SAMAY SAMPANATA.',
          at: new Date(Date.parse(dt.getFullYear() +"-" + (dt.getMonth() + 1) + "-" + (dt.getDate() + eigthPM)  +" 20:08:00 +0530")),
          led: '0000FF',
		        every: 'day',
		       // sound: 'res://platform_default'
					  sound: 'file://audio/SamaySampannaRing.mp3'
				}]);
	}else{
		//console.log("----- peacePrayer.ts ---- setSamaySampanata() ---- Canceling All Samay Sampanata reminders -----");
		LocalNotifications.cancel([707,808,1010,1111,1212,1301,1402,1503,1604,1705,1806,1907,2008]);
	}
}

iOS splashscreen spinner not centered

$
0
0

I'm getting closer to the origin of the issue. I removed the following line in the app.component.ts file :

Splashscreen.hide();

And I could see that the spinner goes back to the center of the splash screen once the platform is ready (this.platform.ready().then). Before that, the spinner is stuck at the top left corner. Do you have an idea ?

How to click notify calendar go to my app

$
0
0

Hello,
I am getting difficult to integrate calendar and add event. Could you please help me?

Below code always fails and gives 111111

this.calendar.createEventInteractivelyWithOptions(
this.content.title,
this.content.location,
null,
this.content.startTimeTs
this.content.endTimeTs
).then(success=>{
console.log(4324)
},
error=>{
console.log(111111)
})

Is it a problem in or or the combination of both?

Images dont show, ionic bug?

BLE read issue

$
0
0

this is my scan code that write and read some data , write is happen but when i want to read nothing happedn ? what is the problem ?

scan() {
let that = this;
this.ble.scan([], 1).subscribe(d=> {
  this.devices = d;
  this.l = d.id.toString();
  this.ble.connect(d.id).subscribe(p => {
    that.status = "connected"
    let lastChar = p.characteristics[p.characteristics.length - 1];
    let serviceId = lastChar.service;
    let chUUID = lastChar.characteristic;
    // this.ble.write(d.id.toString(), serviceId, chUUID, this.stringToBytes("HOPE AGAIN")).then(() => {

    // })
    this.ble.startNotification(d.id, serviceId, chUUID).subscribe(p => {
      that.status = "NOTI";
      // this.cdata = typeof p;
      this.ble.read(d.id, serviceId, chUUID).then(p => {
        that.status = "CHANGEEED";
      })
    })
    // this.connected = "SUCESSFULLY CONNECTED TO ";
    // this.cdata = JSON.stringify(p);
  })
})

thanks

Ionic 3 error adding platform

Should I post this as an issue as there seems to be no fix

$
0
0

Hi,

Yep - I'm pushing a page onto the nav stack and the auto generated back button in the navbar does not work on android.

Or another way, when I'm using the app - I'm on the home page, hit the side menu button and select a link on the side menu to go to another page. Here the page opens but the back button (on android) will not go back to the home page.

That make sense?

Will post ionic info shortly.

Thanks


Help to migrate from Rollup to Webpack

$
0
0

We are using latest app scripts but still with rollup. Since we are seeing SASS / CSS display bugs after the LTR Update came out (maybe root cause / maybe not, only god knows), I want to migrate our project to Webpack, away from rollup.

How would you migrate this file:

"rollup.config.js":

var nodeResolve = require('rollup-plugin-node-resolve');
var commonjs = require('rollup-plugin-commonjs');
var globals = require('rollup-plugin-node-globals');
var builtins = require('rollup-plugin-node-builtins');
var json = require('rollup-plugin-json');
var replace = require('rollup-plugin-replace');
var rollup = require('./../node_modules/@ionic/app-scripts/config/rollup.config');
var themes = require('../src/shared/theme/theme.config');
var environment = require('../src/environments/environment');
var child_process = require('child_process');

// theme setup
var current_theme = process.env["THEME"] || themes.ThemeConfig.default_theme;
var all_themes = themes.ThemeConfig.all_themes;

if (all_themes.indexOf(current_theme) === -1) {
    console.log('Rollup - Theme could not be found: ' + current_theme + '. Existing themes: ' + all_themes.join(", ") + '.');
} else if (process.env["THEME"] === undefined) {
    console.log('Rollup - THEME environment variable missing. Using default theme: ' + current_theme + '.');
} else {
    console.log('Rollup - Current theme: ' + current_theme + '.');
}


// environment setup

var gitAuthor = child_process.execSync('git log -1 --pretty=format:"%an"').toString().trim();
var gitSha = child_process.execSync('git rev-parse --short HEAD').toString().trim();
var gitTag = child_process.execSync('git describe --tags --abbrev=0').toString().trim();
var gitDate = child_process.execSync('git log -1 --date=local --format=%cd').toString().trim();
var gitBranch = child_process.execSync('git rev-parse --abbrev-ref HEAD').toString().trim();

var bbBuild = process.env["BUDDYBUILD_BUILD_NUMBER"] || "0";
var debugMode = process.env["DEBUG"] || "0";

var current_environment = process.env["BUDDYBUILD_BRANCH"] || gitBranch;
var all_environments = environment.environment_keys;

if (all_environments.indexOf(current_environment) === -1) {
    console.log("Rollup - Environment '" + current_environment + "' could not be found. Using default environment: " + environment.default_environment + ". Existing Environments: " + all_environments.join(", ") + ".");
    current_environment = environment.default_environment;
} else {
    console.log('Rollup - Current environment: ' + current_environment + '.');
}

rollup.plugins = [
    replace({
        values: {
            "{{THEME_PLACEHOLDER}}": current_theme,
            "{{ENVIRONMENT_PLACEHOLDER}}": current_environment,
            "{{DEBUG_PLACEHOLDER}}": debugMode,
            "{{BB_BUILD_PLACEHOLDER}}": bbBuild,
            "{{GIT_AUTHOR_PLACEHOLDER}}": gitAuthor || "none",
            "{{GIT_HASH_PLACEHOLDER}}": gitSha || "none",
            "{{GIT_TAG_PLACEHOLDER}}": gitTag || "none",
            "{{GIT_DATE_PLACEHOLDER}}": gitDate || "none",
            "{{GIT_BRANCH_PLACEHOLDER}}": gitBranch || process.env["BUDDYBUILD_BRANCH"] || "none",
            "{{EASTER_EGG_PLACEHOLDER}}": "none"
        },
        include: ['src/environments/environment.js', 'src/shared/theme/theme.config.js'],
        exclude: 'node_modules/**'
    }),
    builtins(),
    commonjs({
        namedExports: {
            // js-base64
            'node_modules/js-base64/base64.js': ['Base64']
        }
    }),
    nodeResolve({
        module: true,
        jsnext: true,
        main: true,
        browser: true,
        extensions: ['.js']
    }),
    globals(),
    json()
];


if (process.env.IONIC_ENV === 'prod') {
     rollup.entry = '{{TMP}}/app/main.ts';
     rollup.sourceMap = false;
}



module.exports = rollup;

tsconfig.json:

{
    "compilerOptions": {
        "allowSyntheticDefaultImports": true,
        "allowJs": true,
        "declaration": false,
        "noImplicitReturns": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "lib": [
				 "dom",
				 "es2015"
			   ],
        "module": "es2015",
        "moduleResolution": "node",
        "sourceMap": true,
        "target": "es5"
    },
    "include": [
        "src/**/*.ts"
    ],
    "exclude": [
        "node_modules",
        "src/**/*.spec.ts",
        "node_modules/@types"
    ],
    "compileOnSave": false,
    "atom": {
        "rewriteTsconfig": false
    }
}

Tabs: programmatically remove the highlight after a push

$
0
0

Hello,
In a page I have some tabs with Icons, one tab contains link to other pages.
I want to click and change page without leave the tabs, it's pretty easy by using a normal nav.push()
The problem is that I think it is misleading for the user if the tab remains highlighted.
I want to remove this wrong indication from the last visited tab.

I made some test with the methods in the prototype, I access them in the common way:
@ViewChild('mainBottomTabs') mainBottomTabs: Tabs;

For compatibility reasons, I'd avoid to access directly the dom element.

The css code the selects the tab is this one:
.tabs-md .tab-button[aria-selected=true] .tab-button-icon {
color: #eb478b;
-webkit-transform: translate3d(0, -2px, 0);
transform: translate3d(0, -2px, 0);
}

Any idea?

Ionic 2 Refresh Current Page

$
0
0

I'm with a problem that when I read via bluetooth an code, I add a value to a variable shown on the screen. The value change but the view just refresh when I press any button. Anyone have a solution to this?

Label on marker doesnt exist property

$
0
0

My problem is i cant put a label for the marker type MarkerOptions, and if you look inside the markeroptions code you will see there isnt a property label. How can achieve the same effect a number on the marker for example. i dont want a infowindow i know that i can achieve that with the title property but i dont need that.

export interface MarkerOptions {
    /**
     * The icon image url or properties. Also you can specify HTML Color values. Alternatively you can specify the image as Base64
     */
    icon?: any;
    /**
     * The content of the infoWindow.
     */
    title?: string;
    /**
     * The snippet of the infoWindow.
     */
    snippet?: string;
    /**
     * The position of the marker.
     */
    position?: LatLng;
    /**
     * 	Specify the anchor of the InfoWindow
     */
    infoWindowAnchor?: number[];
    /**
     * Set true if you want to enable to drag the marker. (Default: false) Important! Drag starts after long pressed on the marker.
     */
    draggable?: boolean;
    /**
     * 	Set true if you want to use a flat marker. (Default: false)
     */
    flat?: boolean;
    /**
     * 	Set rotation angle. (Default: 0)
     */
    rotation?: number;
    /**
     * Set false if you want to hide. (Default: true)
     */
    visible?: boolean;
    /**
     * Specify the options for title.
     */
    styles?: any;
    /**
     * Which animation to play when marker is added to a map.
     */
    animation?: string;
    /**
     * 	iOS only, Plugin Version >= 1.3.3 Higher zIndex value overlays will be drawn on top of lower zIndex value tile layers and overlays. (You're able to run this on Android, but it will have no effect)
     */
    zIndex?: number;
    /**
     * Set to true to disable auto panning when the marker is clicked.
     */
    disableAutoPan?: boolean;
    /**
     * Function to be invoked when the user clicks on the marker
     */
    markerClick?: Function;
    /**
     * Function to be invoked when the user clicks on the info box
     */
    infoClick?: Function;
}
/**

How to use PSD in ionic?

$
0
0

any guide?
well, say i have image in need for input, how should i make it?

regards,

Viewing all 228535 articles
Browse latest View live


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