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

Ionic 3 - Open GPS on real device automatically

$
0
0

@MhmdAdil wrote:

Hello!

I want to automatically on GPS in real device and send long & lat after specific event (click) on offline mode.

thanks

Posts: 1

Participants: 1

Read full topic


How I can increase performance in Ionic 3

$
0
0

@MhmdAdil wrote:

Hi

I have app with huge data, that effected on performance.

How I can increase performance in Ionic 3 ???!!!

Posts: 1

Participants: 1

Read full topic

Social sharing issues

$
0
0

@ahmadklsany wrote:

hello guys
in my app I give user points after Publish my app in social media
so how can i know if he Publish or not to give him points .
Look at this function>>>>>>>

PublishApp(){

this.socialSharing.share(anyMessage).then((data)=> {


 }
)

}

thanks

Posts: 1

Participants: 1

Read full topic

Menu is not clickable after dismissing a modal

$
0
0

@SEusmaniqbal wrote:

Unfortunately the menu is not enabled after dismissing a modal with Android back button. I can see the menu icon but clicking it does not open the menu and If menu is opened after clicking on page name nothing is displaying for that page. I have only one menu that placed in app.html. I also using tab.

Posts: 1

Participants: 1

Read full topic

Best way to work with non-ionic components

Error when installing npm in ionic (struggle for past seven days )

$
0
0

@sujithhybrid wrote:

$ npm install
npm WARN deprecated cordova-plugin-console@1.1.0: This plugin has been deprecated since it is now included in the latest versions of cordova-ios
npm WARN deprecated babili@0.0.10: babili has been renamed to babel-minify. Please update to babel-minify
npm WARN deprecated babel-preset-babili@0.0.10: babili has been renamed to babel-minify. Please update to babel-preset-minify
npm WARN deprecated object-keys@0.2.0: Please update to the latest object-keys

> node-sass@4.5.0 install C:\Users\Dell\Desktop\newrie\node_modules\@ionic\app-scripts\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.0/win32-x64-57_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.0/win32-x64-57_binding.node":

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g.

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> node-sass@4.7.2 install C:\Users\Dell\Desktop\newrie\node_modules\node-sass
> node scripts/install.js

Cached binary found at C:\Users\Dell\AppData\Roaming\npm-cache\node-sass\4.7.2\win32-x64-57_binding.node

> node-sass@4.5.0 postinstall C:\Users\Dell\Desktop\newrie\node_modules\@ionic\app-scripts\node_modules\node-sass
> node scripts/build.js

Building: C:\Program Files\nodejs\node.exe C:\Users\Dell\Desktop\newrie\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'C:\\Users\\Dell\\Desktop\\newrie\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using node-gyp@3.6.2
gyp info using node@8.9.1 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\Users\Dell\Desktop\newrie\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\Dell\Desktop\newrie\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\Dell\Desktop\newrie\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\Dell\Desktop\newrie\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\Dell\Desktop\newrie\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\Dell\Desktop\newrie\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed  python2 { Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\Users\Dell\Desktop\newrie\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\Dell\Desktop\newrie\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\Dell\Desktop\newrie\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\Dell\Desktop\newrie\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\Dell\Desktop\newrie\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\Dell\Desktop\newrie\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed   stack: 'Error: not found: python2\n    at getNotFoundError (C:\\Users\\Dell\\Desktop\\newrie\\node_modules\\which\\which.js:13:12)\n    at F (C:\\Users\\Dell\\Desktop\\newrie\\node_modules\\which\\which.js:68:19)\n    at E (C:\\Users\\Dell\\Desktop\\newrie\\node_modules\\which\\which.js:80:29)\n    at C:\\Users\\Dell\\Desktop\\newrie\\node_modules\\which\\which.js:89:16\n    at C:\\Users\\Dell\\Desktop\\newrie\\node_modules\\isexe\\index.js:42:5\n    at C:\\Users\\Dell\\Desktop\\newrie\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:152:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed     at getNotFoundError (C:\Users\Dell\Desktop\newrie\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\Dell\Desktop\newrie\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\Dell\Desktop\newrie\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\Dell\Desktop\newrie\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\Dell\Desktop\newrie\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\Dell\Desktop\newrie\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed  python { Error: not found: python
gyp verb `which` failed     at getNotFoundError (C:\Users\Dell\Desktop\newrie\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\Dell\Desktop\newrie\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\Dell\Desktop\newrie\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\Dell\Desktop\newrie\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\Dell\Desktop\newrie\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\Dell\Desktop\newrie\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed   stack: 'Error: not found: python\n    at getNotFoundError (C:\\Users\\Dell\\Desktop\\newrie\\node_modules\\which\\which.js:13:12)\n    at F (C:\\Users\\Dell\\Desktop\\newrie\\node_modules\\which\\which.js:68:19)\n    at E (C:\\Users\\Dell\\Desktop\\newrie\\node_modules\\which\\which.js:80:29)\n    at C:\\Users\\Dell\\Desktop\\newrie\\node_modules\\which\\which.js:89:16\n    at C:\\Users\\Dell\\Desktop\\newrie\\node_modules\\isexe\\index.js:42:5\n    at C:\\Users\\Dell\\Desktop\\newrie\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:152:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb could not find "python". checking python launcher
gyp verb could not find "python". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Users\Dell\Desktop\newrie\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\Dell\Desktop\newrie\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack     at C:\Users\Dell\Desktop\newrie\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Dell\\Desktop\\newrie\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\Dell\Desktop\newrie\node_modules\@ionic\app-scripts\node_modules\node-sass
gyp ERR! node -v v8.9.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN Error: EPERM: operation not permitted, scandir 'C:\Users\Dell\Desktop\newrie\node_modules\fsevents\node_modules\dashdash\node_modules'
npm WARN  { Error: EPERM: operation not permitted, scandir 'C:\Users\Dell\Desktop\newrie\node_modules\fsevents\node_modules\dashdash\node_modules'
npm WARN   stack: 'Error: EPERM: operation not permitted, scandir \'C:\\Users\\Dell\\Desktop\\newrie\\node_modules\\fsevents\\node_modules\\dashdash\\node_modules\'',
npm WARN   errno: -4048,
npm WARN   code: 'EPERM',
npm WARN   syscall: 'scandir',
npm WARN   path: 'C:\\Users\\Dell\\Desktop\\newrie\\node_modules\\fsevents\\node_modules\\dashdash\\node_modules' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.5.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.5.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Dell\AppData\Roaming\npm-cache\_logs\2017-12-06T10_22_41_043Z-debug.log

Posts: 3

Participants: 3

Read full topic

Kentico Cloud as CMS for an Ionic app?

Model / Slider issue

$
0
0

@Giltea wrote:

Hi There,

I am new to ionic and am trying to setup a modal that transitions to the correct slide based on buttons from the previous view. I am recieving the following error:

slideTo TypeError: undefined is not an object

There was a related post but the fix did not seem to work for me:

Below is my function for opening the model / slide transition. Can someone please lend a hand?

export class LegsPage {

@ViewChild(Slides) slides: Slides;

constructor(public navCtrl: NavController, public navParams: NavParams, public modalCtrl: ModalController) {
}

ionViewDidLoad() {
console.log(‘ionViewDidLoad LegsPage’);
}

public openModal(index) {
var modalPage = this.modalCtrl.create(‘LegModelPage’);
modalPage.present();
setTimeout(() => { this.slides.slideTo(index, 1000); }, 1000);
}

public closeModal() {

}

}

The load is occurring more slowly now that the time out function has been added but the error im getting is still the same. Thanks in advance.

Posts: 1

Participants: 1

Read full topic


Local notifications "Click" event with APP CLOSED

$
0
0

@VMVwebagency wrote:

Hi,
i’m using local notifications native plugin on my ionic 3 project (last versions of all), but when i click on notification and my app is closed the click event is not triggered.
It works when app is in background or foreground.

I use local notifications inside a provider and my on click code is inside its constructor but when app is closed is not work.
I’ve tried too write code inside platform ready in app/app.component.ts but not work.
This is my code:

app/app.component.ts


export class MyApp {
  @ViewChild(Nav) nav: Nav;

  rootPage: any;

  constructor(
    public platform: Platform,
    public menu: MenuController,
    public statusBar: StatusBar,
    public splashScreen: SplashScreen,
    public BeaconServiceProvider: BeaconServiceProvider, /* my provider with local notifications*/
    public RemoteServiceProvider: RemoteServiceProvider,
    public translate: TranslateService,
    public globalization: Globalization,
    private oneSignal: OneSignal,
    public ga: GoogleAnalytics
  ) {
......
}
}

my provider

import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Storage } from '@ionic/storage';
import { IBeacon } from '@ionic-native/ibeacon';
import { LocalNotifications } from '@ionic-native/local-notifications';
import { RemoteServiceProvider } from '../remote-service/remote-service';
import { StorageProvider } from '../storage/storage';
import { TranslateService } from '@ngx-translate/core';
import { AlertController } from 'ionic-angular';
import { NavController, App} from "ionic-angular/index";
import { GoogleAnalytics } from '@ionic-native/google-analytics';

/*
  Generated class for the BeaconServiceProvider provider.

  See https://angular.io/guide/dependency-injection for more info on providers
  and Angular DI.
*/
@Injectable()
export class BeaconServiceProvider {

  remoteBeacons: Array<{major: string, minor: string}> = [];
  localBeacons: Array<{major: string, minor: string, date: any}> = [];
  bluetoothInit: boolean = false;
  private navCtrl: NavController;

  constructor(
    public http: HttpClient,
    public alertCtrl: AlertController,
    public storage: Storage,
    public ibeacon: IBeacon,
    public translate: TranslateService,
    public localNotifications: LocalNotifications,
    public RemoteServiceProvider: RemoteServiceProvider,
    public StorageProvider: StorageProvider,
    public ga: GoogleAnalytics,
    private app: App
  ) {
    console.log('Hello BeaconProvider Provider');

    this.localBeacons = this.StorageProvider.localBeacons;

    this.navCtrl = this.app.getActiveNav();

    let thiz_app = this.app;
    let remote = this.RemoteServiceProvider;
    console.log("QUI");
    this.localNotifications.on("click", function(notification, state){

      console.log("QUI2");

      this.ga.trackEvent(
        "Notifiche Beacon (" + remote.version_code + ")",
        "Apertura notifica",
        "Click sulla notifica beacon " + " {" + notification.message + "}",
        1
      );

      let nav = thiz_app.getActiveNav();
      console.log("NAV", nav);

      let data = JSON.parse(notification.data);
      let page_id = data.page_id;
      page_id = page_id.toString();

      switch(page_id)
      {
        case "" :
        case "0" :
          break;
        case "-1" : //Contact Page
            if (nav == null)
              nav.push('ContactPage');
            else if (nav.getActive().component.name != 'ContactPage')
              nav.push('ContactPage');
          break;
        default :

          remote.isPageListNew(page_id).subscribe(result => {
              let page = result.has_subpages ? 'List2Page' : 'ItemDetailsPage';

              if (nav == null)
                nav.push(page, { item: result });
              else
              {
                if( nav.getActive().component.name != page)
                  nav.push(page, { item: result });
                else
                {
                  let item_id = nav.getActive().data.item.id;
                  if (item_id != result.id)
                    nav.push(page, { item: result });
                }
              }
          });

      }

    });

  }

Any ideas why not work?
Thanks

Posts: 1

Participants: 1

Read full topic

Http post does not work

$
0
0

@mdline wrote:

Hi,

I always get an error unkown host in error message from ios simulator or from ios device.

 public login(username: string, passwd: string): Observable<string> {
    const headers = new HttpHeaders({'Content-Type': 'application/x-www-form-urlencoded'});
    const options = {headers: headers, withCredentials: true};
    const body = {
      'username': username,
      'password': passwd
    };
    return this.http.post(URL, body, options)
      .map(xxx)
      .catch(xxx);
  }

In catch block I got the message "Http failure response for (unkown url).
Does anybody have any idea?

Posts: 1

Participants: 1

Read full topic

Error: Failed to fetch platform andriod

$
0
0

@rtalexk wrote:

I arrived my work and the first thing I did was try to install an Ionic 3 app in my android device but I got an error. It is strange because the previous day it worked.

ionic cordova build andriod

Output:

alxkc (photo) FindMeMobile $ ionic cordova build andriod
> cordova platform add andriod --save
Using cordova-fetch for andriod

Error: Failed to fetch platform andriod
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code E404
npm ERR! 404 Not Found: andriod@latest

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/alxkc/.npm/_logs/2017-12-06T16_21_54_358Z-debug.log

[ERROR] Exception:
alxkc (photo) FindMeMobile $

Complete log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install', 'andriod', '--save' ]
2 info using npm@5.5.1
3 info using node@v8.9.2
4 verbose npm-session f26bb88ad9328d2c
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 404 https://registry.npmjs.org/andriod 766ms
8 silly fetchPackageMetaData error for andriod@latest 404 Not Found: andriod@latest
9 verbose stack Error: 404 Not Found: andriod@latest
9 verbose stack     at fetch.then.res (/usr/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/fetch.js:42:19)
9 verbose stack     at tryCatcher (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
9 verbose stack     at Promise._settlePromiseFromHandler (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
9 verbose stack     at Promise._settlePromise (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
9 verbose stack     at Promise._settlePromise0 (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
9 verbose stack     at Promise._settlePromises (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
9 verbose stack     at Async._drainQueue (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:133:16)
9 verbose stack     at Async._drainQueues (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
9 verbose stack     at Immediate.Async.drainQueues (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
9 verbose stack     at runCallback (timers.js:789:20)
9 verbose stack     at tryOnImmediate (timers.js:751:5)
9 verbose stack     at processImmediate [as _immediateCallback] (timers.js:722:5)
10 verbose cwd /home/alxkc/Documents/ProjectsIonic/FindMeMobile/node_modules
11 verbose Linux 4.10.0-40-generic
12 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "andriod" "--save"
13 verbose node v8.9.2
14 verbose npm  v5.5.1
15 error code E404
16 error 404 Not Found: andriod@latest
17 verbose exit [ 1, true ]

I tried to understand that log, but it does not tell my nothing.

This is my ionic info:

cli packages: (/home/alxkc/Documents/ProjectsIonic/FindMeMobile/node_modules)

    @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 7.0.1

local packages:

    @ionic/app-scripts : 2.1.4
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node              : v8.9.2
    npm               : 5.5.1
    OS                : Linux 4.10

Environment Variables:

    ANDROID_HOME : /home/alxkc/Android/Sdk

Misc:

    backend : legacy

Posts: 1

Participants: 1

Read full topic

Using devapp on a Enterprise network

$
0
0

@Abhisht12 wrote:

Hi,

I installed dev-apps on all my devices and tried to run it on my office network and it’s not really a surprise but the application didn’t launch(the devices were on the company network). Is there any support coming for us to be able to run it on an enterprise network?

Thanks!

Posts: 1

Participants: 1

Read full topic

"Adding zone.js project..." fails in CI environment

$
0
0

@fdbeiraorhdhv wrote:

Hello everyone :wave:

I am trying to get ionic to build my android app in my CI environment, but I must be doing something wrong.

The CI performs a clean clone from Git, and these are the overall contents of Git:

  • package.json does NOT have dependency on cordova-android;
  • platforms, inside cordova, inside package.json is empty;
  • config.xml only has <platform name="android"><allow-intent href="market:*" /></platform> related to android, everything else is same as generated by ionic start;

I am using yarn to download my npm dependencies.

My CI script runs the following:

- yarn config set cache-folder .yarn
- yarn
- ionic info
- ionic cordova platform add android
- ionic cordova resources android
- ionic cordova build android --prod

The problem is that on my CI environment, the ionic cordova platform add android command fails, with the following output:

$ yarn
yarn install v1.3.2
[1/4] Resolving packages...
[2/4] Fetching packages...
warning Pattern ["esprima-fb@~3001.0001.0000-dev-harmony-fb"] is trying to unpack in the same destination "/builds/fdbeirao/myapp/frontend/app/.yarn/v1/npm-esprima-fb-3001.1.0-dev-harmony-fb-b77d37abcd38ea0b77426bb8bc2922ce6b426411" as pattern ["esprima-fb@~3001.1.0-dev-harmony-fb"]. This could result in a non deterministic behavior, skipping.
info fsevents@1.1.3: The platform "linux" is incompatible with this module.
info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 29.82s.
$ ionic info

cli packages: (/usr/lib/node_modules)

    @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.2
    Cordova Platforms  : none
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.0.1
    Node              : v8.9.1
    npm               : 5.5.1
    OS                : Linux 4.13

Environment Variables:

    ANDROID_HOME : /opt/android-sdk-linux

Misc:

    backend : pro

$ ionic cordova platform add android
> cordova platform add android --save
Using cordova-fetch for cordova-android@~6.3.0
Adding zone.js project...
Unable to load PlatformApi from platform. Error: Unhandled "error" event. (Does not appear to implement platform Api.)
Error: Unhandled "error" event. (The platform "zone.js" does not appear to be a valid cordova platform. It is missing API.js. zone.js not supported.)

If I run this command in my Windows 10 machine (after deleting cordova-android from node_modules, and deleting the platform folder, and making sure that the platforms array is empty in package.json), I get the expected output:

PS D:\Git\myapp\frontend\app> ionic cordova platform add android
> cordova platform add android --save
Using cordova-fetch for cordova-android@~6.3.0

Adding android project...

Creating Cordova project for the Android platform:

        Path: platforms\android
        Package: io.ionic.starter
        Name: myapp
        Activity: MainActivity
        Android target: android-26
Subproject Path: CordovaLib
Android project created with cordova-android@6.3.0

Discovered plugin "ionic-plugin-keyboard" in config.xml. Adding it to the project

(some other output about plugins, not relevant)

--save flag or autosave detected

Saving android@~6.3.0 into config.xml file ...

> ionic cordova resources android --force
√ Collecting resource configuration and source images - done!
√ Filtering out image resources that do not need regeneration - done!
√ Uploading source images to prepare for transformations - done!
√ Generating platform resources: 18 / 18 complete - done!
√ Modifying config.xml to add new image resources - done!
PS D:\Git\myapp\frontend\app> ionic info

cli packages: (C:\Users\fdbei\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.2
    Cordova Platforms  : android 6.3.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node              : v8.9.1
    npm               : 5.5.1
    OS                : Windows 10

Environment Variables:

    ANDROID_HOME : C:\Users\fdbei\AppData\Local\Android\Sdk

Misc:

    backend : pro

This is almost driving me insane hehe. The major difference is that the OS in my CI is Linux (alpine based) and in my dev computer I have Windows 10…

I am scratching my head about the output line in my CI “Adding zone.js project …”… where the heck did this come from? It should say (like my windows machine) “Adding android project…”

Searching around in the interwebs told me to run ionic platform rm android followed by ionic platform add android, but this doesn’t solve the problem.

Any pointers will make my tomorrow greatly better than my today ended. :slight_smile:

Thank you in advance.
Fábio

Posts: 1

Participants: 1

Read full topic

[SOLVED] After unsubscribe calls permission denied error

$
0
0

@JeffMinsungKim wrote:

Hello folks.
I have a weird permission denied issue after fully unsubscribing from all my pages.
It works perfectly fine on a real device but not on the Chrome browser.
I’ve looked at the logs and it seems like the problem starts from Username.ts file but, still getting an error.

Page starts from SettingPage -> ProfileDetailPage -> UsernamePage (No keyup event calls from checkUsername() then no problem to log out.)
After I saveUsername from UsernamePage and try to make an attempt to log out from SettingPage then it throws an error. :frowning:

Here’s the code looks like.

Username.ts

export class UsernamePage implements OnDestroy {
  private subscription: Subscription;
  private currentUsername: string;
  private usernameText: string;
  private isUsernameAvailable: boolean;
  private hasSetUsername: boolean = false;

  constructor(
    public navCtrl: NavController,
    public navParams: NavParams,
    private userService: UserServiceProvider) {
    this.currentUsername = this.navParams.get('username');
  }

  saveUsername() {
    this.hasSetUsername = true;
    this.userService.removeDeprecatedUsername(this.currentUsername);
    this.userService.updateUsername(this.usernameText);
    this.currentUsername = this.usernameText;
  }

  checkUsername() {
    this.subscription = this.userService.checkUsername(this.usernameText).subscribe(username => {
      if (username !== null)
        this.isUsernameAvailable = false;
      else
        this.isUsernameAvailable = true;
    });
  }

  ngOnDestroy() {
    if (this.subscription !== undefined) {
      this.subscription.unsubscribe();
      console.log("Username ngOnDestroy");
    }
  }
}
<ion-buttons right>
        <button ion-button color="dark" (click)="saveUsername()">
            SAVE
        </button>
    </ion-buttons>

<ion-content padding>
<ion-input type="text" placeholder="Letters or Letters with numbers ONLY" [(ngModel)]="usernameText" (keyup)="checkUsername()"></ion-input>
</ion-content>

profile-detail.ts

export class ProfileDetailPage implements OnDestroy {
  private subscription: Subscription;
  private previewImage: any;
  private avatar: string;
  private displayName: string;
  private username: string;
  private gender: string;
  private user: any[];

  @ViewChild('genderMale', {read: ElementRef}) maleButton;
  @ViewChild('genderFemale', {read: ElementRef}) femaleButton;

  constructor(
    public navCtrl: NavController,
    public navParams: NavParams,
    public actionSheetCtrl: ActionSheetController,
    public viewCtrl: ViewController,
    private renderer: Renderer,
    private camera: Camera,
    private userService: UserServiceProvider,
    private uploadService: UploadServiceProvider,
    private loadingService: LoadingServiceProvider) {

    this.getUserProfile();
  }

  getUserProfile() {
    this.subscription = this.userService.getCurrentUser().subscribe((user: any) => {
      console.log("Current user:", user);
      this.avatar = user.photoURL;
      this.displayName = user.displayName;
      this.gender = user.gender;
      this.username = user.username;
    });
  }

  ngOnDestroy() {
    if (this.subscription !== undefined) {
      this.subscription.unsubscribe();
      console.log("ProfileDetail ngOnDestroy");
    }
  }

setting.ts

export class SettingPage implements OnDestroy {
  private subscription: Subscription;
  private username: string;

  constructor(
    public navCtrl: NavController,
    public navParams: NavParams,
    private authService: AuthServiceProvider,
    private userService: UserServiceProvider,
    private toastService: ToastServiceProvider,
    private modalService: ModalServiceProvider,
    private uploadService: UploadServiceProvider) { }


  ionViewWillEnter() {
    this.subscription = this.userService.getCurrentUsername().subscribe((user: any) => {
      console.log("SettingPage user", user);
      this.username = user;
    });
  }

  ngOnDestroy() {
    if (this.subscription !== undefined) {
      this.subscription.unsubscribe();
      console.log("Setting ngOnDestroy");
    }
  }
  async logout() {
    this.userService.updateCurrentActiveStatusTo(false);
    const user: any = await this.authService.signOut();
    this.toastService.show(`Signed out as ${user.email}`);
  }
}

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 7.1.0

local packages:

@ionic/app-scripts : 3.1.4
Cordova Platforms  : android 6.3.0
Ionic Framework    : ionic-angular 3.9.2

System:

Node  : v8.9.0
npm   : 5.5.1
OS    : OS X El Capitan

Posts: 2

Participants: 1

Read full topic

Cordova-sqlite-storage's plugin can't be added

$
0
0

@Youtch wrote:

Hello, I need to add the Cordova-sqlite-storage’s plugin to provide a database based on SQLite in my new project.
I installed it with this command :
ionic start SWMG blank -app-name="NewProject"
Secondly I tryed to add the plugin several times by typing this… I received each time the same error :

cordova plugin add cordova-sqlite-storage --save

Error: Failed to fetch plugin cordova-sqlite-storage@2.0.4 via registry.
Probably this is either a connection problem, or plugin spec is incorrect
.
Check your connection and plugin name/version/URL.
Error: cmd: Command failed with exit code 4294963248 Error output:
npm ERR! path c:\Users\PC\Documents\Apache www\Projets Ionic\SWMG\no
de_modules\fsevents\node_modules\dashdash\node_modules
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall scandir
npm ERR! Error: EPERM: operation not permitted, scandir 'c:\Users\PC\Documents\Apache www\Projets Ionic\SWMG\node_modules\fsevents\node_modules\dashdash\node_modules’
npm ERR! { Error: EPERM: operation not permitted, scandir 'c:\Users\PC\Documents\Apache www\Projets Ionic\SWMG\node_modules\fsevents\node_modules\dashdash\node_modules’
npm ERR! stack: ‘Error: EPERM: operation not permitted, scandir ‘c:\Users\PC\Documents\Apache www\Projets Ionic\SWMG\node_modules\
fsevents\node_modules\dashdash\node_modules’’,
npm ERR! errno: -4048,
npm ERR! code: ‘EPERM’,
npm ERR! syscall: ‘scandir’,
npm ERR! path: ‘c:\Users\PC\Documents\Apache www\Projets Ionic\SWMG\node_modules\fsevents\node_modules\dashdash\node_modules’ }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\PC\AppData\Roaming\npm-cache_logs\2017-12-06T12_17_47_077Z-debug.log

[ERROR] An error occurred while running cordova plugin add
cordova-sqlite-storage@2.0.4 --save (exit code 1).

So I try with this command it’s the same bad message :
cordova plugin add cordova-sqlite-storage@2.0.4 --save

I don’t understand because all any plugin adding works.
Moreover in this log I find the repository where is downloaded the plugin files :
https://registry.npmjs.org/cordova-sqlite-storage
…When it’s opened in a browser the repository don’t seem to be offline !
Thank you to help.

Ionic info :

 cli packages: (C:\Users\PC\AppData\Roaming\nvm\v8.1.2\node_modules)
      @ionic/cli-utils  : 1.19.0
      ionic (Ionic CLI) : 3.19.0

global packages:
      cordova (Cordova CLI) : not installed

local packages:
      @ionic/app-scripts : 3.1.4
      Cordova Platforms  : none
      Ionic Framework    : ionic-angular 3.9.2

 System:
      Android SDK Tools : 25.2.5
      Node              : v8.1.2
      npm               : 5.5.1
      OS                : Windows 8.1

 Environment Variables:
      ANDROID_HOME : C:\android-sdk-windows

 Misc:
      backend : pro

Posts: 2

Participants: 2

Read full topic


How to use together radio and checkbox with alert

$
0
0

@atlanti wrote:

Hello friends,
I have to use two different methods in order to show the product properties and types in my application, so I have to show the features with checkbox and radio buttons. I will do this in an alert control, but I can not use the alert radio button and checkbox at the same time. Thanks in advance for your help.

openDetailAlert() {
    let alert = this.alertCntrl.create({
      title: 'Ürün Detaylandırma'
    });
    alert.addInput({
      type:'radio',
      label:'Sade',
      value:'1'
    });
    alert.addInput({
      type:'radio',
      label:'Orta',
      value:'0'
    });
    alert.addInput({
      type:'radio',
      label:'Şekerli',
      value:'0'
    });


    alert.addInput({
      type:'checkbox',
      label:'deneme1',
      value:'value1',
      checked:true
    });
    alert.addInput({
      type:'checkbox',
      label:'deneme2',
      value:'value2'
    });
    alert.present();
  }

Posts: 1

Participants: 1

Read full topic

Error: Cannot find module “@firebase/polyfill”

$
0
0

@rashidSoftordi wrote:

After running ionic serve facing the eorror: Error: Cannot find module “@firebase/polyfill”

Detail of error:

Error: Cannot find module "@firebase/polyfill"
    at webpackMissingModule (http://localhost:8100/build/vendor.js:71203:65)
    at Object.<anonymous> (http://localhost:8100/build/vendor.js:71203:160)
    at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30)
    at Object.<anonymous> (http://localhost:8100/build/vendor.js:71154:71)
    at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30)
    at Object.<anonymous> (http://localhost:8100/build/vendor.js:109392:79)
    at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30)
    at Object.<anonymous> (http://localhost:8100/build/vendor.js:109376:72)
    at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30)
    at Object.<anonymous> (http://localhost:8100/build/vendor.js:36504:70)

Working environment: cli packages:

@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:

cordova (Cordova CLI) : 7.1.0
local packages:

@ionic/app-scripts : 2.1.4
Cordova Platforms : none
Ionic Framework : ionic-angular 3.9.2
System:

Node : v8.9.1
npm : 5.1.0
OS : macOS Sierra
Xcode : Xcode 9.1 Build version 9B55

There is only one issue I have found on stackoverflow and nobody answer to this problem. Any solution to this error.

Posts: 1

Participants: 1

Read full topic

Npm ERR! cb() never called!

$
0
0

@koringa wrote:

Firstofall I installed nodejs 8.9.1 and npm 5.5.1 version when i try to run “npm install -g cordova ionic” , I am getting “npm ERR! cb() never called!” error. I have really tried many option that written on internet, I couldn’t get any solution :frowning: Could you please help me?

Thanks.

Posts: 1

Participants: 1

Read full topic

Get random object from local json

$
0
0

@Olivier-Tvx wrote:

I try to get a random object from a local Json file in my Ionic3 App.

When I click a button, I would like to get a random object from my json file and display specific datas from this object.
Currently, I can get a random object but I don’t know to display its data in the view.
This is a dummy project and I am not sure what’s the appropriate way to do this.

home.ts

cards: any;

  getLocalData() {
    this.http.get('assets/data/cards.json').map(res => res.json()).subscribe(res => {
        this.cards = res.cards;
        this.cards.rd = this.cards[Math.floor(Math.random() * this.cards.length)];
        console.log(this.cards.rd);
    },
     (err) => {
      alert("failed loading json data");
    })
  }

home.html

 <button ion-button round (click)="getLocalData()">Charger</button>

    <ion-list>
      <ion-item *ngFor="let card of cards">
        <h2>{{card.question}}</h2>
        <h2>{{card.answer}}</h2>
        <h2>{{card.hint}}</h2>
      </ion-item>
    </ion-list>

cards.json

{
  "cards": [
    {
      "id": "1",
      "question": "question 1",
      "answer": "reponse 1",
      "hint": "hint 1"
    },
    {
      "id": "2",
      "question": "question 2",
      "answer": "reponse 2",
      "hint": "hint 2"
    },
    {
      "id": "3",
      "question": "question 3",
      "answer": "reponse 3",
      "hint": "hint 3"
    }
  ]
}

Posts: 1

Participants: 1

Read full topic

Wait for Firebase signInWithEmailAndPassword response

$
0
0

@chrisklus wrote:

I am signing in a user with Firebase’s signInWithEmailAndPassword() and then get that users information with var fbuser = this.afAuth.auth.currentUser;. However, the call is asynchronous, so in order for fbuser to contain the newly submitted information, I have to call a wait function for 5 seconds to allow enough time for the user to be assigned the current user. This is obviously an awful way to do this but I can’t find anything on how to wait for fbuser to be valid. Any help would be great, thanks.

Here is the my login.ts: https://github.com/CSFoodRescueCapstone/foodfinder/blob/master/src/pages/login/login.ts

Posts: 3

Participants: 2

Read full topic

Viewing all 49526 articles
Browse latest View live