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

Is there any plugin that make application work in background mode?

$
0
0

@YousefRabieKhalil wrote:

al slam alykoum
i use this plugin to run the bakcgound mode in my ionic 2 application
i used this plugin to display some local notification while the app in background mode

but my app has been rejected because of this plugin use the audio permission.
so my question is there is any plugin that make application work in background without have audio permission ?

Posts: 5

Participants: 4

Read full topic


Badge notification issue an android ionic app

$
0
0

@youbapi wrote:

Hi, We Technotrick Systems are developing an Android app on IONIC Framework. We want to integrate Badge function to our app but IONIC framework is not supporting it. It would be very helpful for us if you could guide on it. Regards, TTS Team

Posts: 2

Participants: 2

Read full topic

Ionic firebase push subscription error

$
0
0

@SangeethSudha wrote:

Guys, Im getting this subscription error, even after registering the device in firebase. All connectivity is correct and finally im getting this error when i run.

core.es5.js:1084 ERROR Error: Uncaught (in promise): Error: Error subscribing for Push notifications.
Error: Error subscribing for Push notifications.
** at push.js:82**
** at t.invoke (polyfills.js:3)**
** at Object.onInvoke (core.es5.js:4149)**
** at t.invoke (polyfills.js:3)**
** at r.run (polyfills.js:3)**
** at polyfills.js:3**
** at t.invokeTask (polyfills.js:3)**
** at Object.onInvokeTask (core.es5.js:4140)**
** at t.invokeTask (polyfills.js:3)**
** at r.runTask (polyfills.js:3)**
** at push.js:82**
** at t.invoke (polyfills.js:3)**
** at Object.onInvoke (core.es5.js:4149)**
** at t.invoke (polyfills.js:3)**
** at r.run (polyfills.js:3)**
** at polyfills.js:3**
** at t.invokeTask (polyfills.js:3)**
** at Object.onInvokeTask (core.es5.js:4140)**
** at t.invokeTask (polyfills.js:3)**
** at r.runTask (polyfills.js:3)**
** at c (polyfills.js:3)**
** at polyfills.js:3**
** at t.invokeTask (polyfills.js:3)**
** at Object.onInvokeTask (core.es5.js:4140)**
** at t.invokeTask (polyfills.js:3)**
** at r.runTask (polyfills.js:3)**
** at o (polyfills.js:3)**
** at **

Can some one help on this?

Posts: 1

Participants: 1

Read full topic

Auth http: No JWT present or has expired

$
0
0

@nathantaal wrote:

I know there is a lot on different forums on this issue. I looked here, on Auth0 forum and on stackoverflow.

When I’m trying to make an api call I get the response 401 (Unauthorized): No JWT present or has expired.

in my app.module.ts, above @ngmodule I have an getAuthHttp function:

export function getAuthHttp(http) {
    return new AuthHttp(new AuthConfig({
        headerPrefix: 'bearer',
        noJwtError: true,
        globalHeaders: [{'Accept': 'application/json'}],
        tokenGetter: (() => JSON.parse(window.localStorage.getItem('id_token'))),
    }), http);
}

(I tried to fix tokengetter by getting token from localstorage instead of creating new storage as is suggested in some official documentation)

this is my providers array:

providers: [
    StatusBar,
    SplashScreen,
    {provide: ErrorHandler, useClass: IonicErrorHandler},
    {provide: AuthHttp, useFactory: getAuthHttp, deps: [Http] },
    AUTH_PROVIDERS,
    ChallengeService, SettingsService, UserdataService, AuthService
  ]

and of course I have an authservice file which handles login and logout and probaly more which I don’t use at the moment.

My service which calls the api:

import { Injectable} from '@angular/core';
import { AuthService} from "./auth.service";
import { AuthHttp } from "angular2-jwt";
import 'rxjs/Rx';

@Injectable()
export class MessageService{

    http: any;
    messages: any;
    authService: any;

    constructor(authService:AuthService, private authHttp:AuthHttp){
        this.storage = storage;
        this.authService = authService;
        this.authHttp = authHttp;
    }

    getMessage(level, location)
    {
        this.messages=  this.authHttp.get('http://10.0.2.2:8080/api/message/1');

        return this.messages;
    }
};

Now this goes wrong, obviously.

I 'm pretty sure i’m forgetting something but i can’t pinpoint it and after days of getting closer now i’m totally stuck. Who can help me fix this? I would also be okay with just using angular http but I cannot get it working with sending the headers myself as well.

My system:

@ionic/cli-utils  : 1.12.0
ionic (Ionic CLI) : 3.12.0

global packages:

cordova (Cordova CLI) : not installed

local packages:

@ionic/app-scripts : 2.1.3
Cordova Platforms  : android 6.2.3 browser 4.1.0 ios 4.4.0
Ionic Framework    : ionic-angular 3.6.0

System:

Node : v6.11.4
npm  : 5.4.2
OS   : Windows 10

Misc:

backend : pro

Posts: 1

Participants: 1

Read full topic

Present component on top of ion-tabs

$
0
0

@Daskus wrote:

I want to implement Material Design Feature Discovery.
The implementation of the component itself is not a problem but when I try to display it the ion-tabs component is always on top of it and partially overlays/hides my component.

How can I put my component on top of every other component, like navbar, ion-tabs, ion-fab? Something like action-sheet or alert (Those are always on top of everything else)…

Posts: 1

Participants: 1

Read full topic

Admob-free with ionic

$
0
0

@samikoren1 wrote:

I am trying to install admob-free to ionic2 project. after installing:
$ ionic cordova plugin add cordova-plugin-admob-free
$ npm install --save @ionic-native/admob-free

now running: ionic serve

I get this error:
node_modules@ionic-native\admob-free\index.js:20
import { Plugin, Cordova, IonicNativePlugin } from ‘@ionic-native/core’;
ParseError: ‘import’ and ‘export’ may appear only with ‘sourceType: module’

anyone can help? how should I resolve it?
Thanks.

Posts: 3

Participants: 2

Read full topic

WKWebView / Crosswalk

$
0
0

@JayKay wrote:

Mike currently released a post about the WKWebView.
I’m not sure what this means to me, as I use Crosswalk (cordova-plugin-crosswalk-webview) in my Ionic 3 app.

Does the WKWebView replace Crosswalk in my app and should I hence remove Crosswalk and add the WKWebView? How are they related? What are the advantages / disadvantages of using either one?

Any help on this is appreciated. Thank you!

Posts: 3

Participants: 2

Read full topic

Error with --prod

$
0
0

@nyffellare wrote:

Hello,

When i use ionic cordova build android --prod --release it gives a strange error. I tried to fix it but it always results in a broken app. Does anyone have an ideahow to solve this?
Ionic cordova build android --realease works perfect btw.

Thanks in advance!

Greetings,
Nyffellare

Here is the error:

PS D:\Personal_Files\Documenten\Ionic\ChecklistByBlackSuitDevelopers> ionic cordova build android --prod --release
[INFO] Running app-scripts build: --prod --platform android --target cordova

[15:35:02]  build prod started ...
[15:35:02]  clean started ...
[15:35:02]  clean finished in 1 ms
[15:35:02]  copy started ...
[15:35:02]  ngc started ...
Error: Type AboutPage in D:/Personal_Files/Documenten/Ionic/ChecklistByBlackSuitDevelopers/src/pages/about/about.ts is part of the declarations of 2 modules: AppModule in D:/Personal_Files/Documenten/Ion
ic/ChecklistByBlackSuitDevelopers/src/app/app.module.ts and AboutPageModule in D:/Personal_Files/Documenten/Ionic/ChecklistByBlackSuitDevelopers/src/pages/about/about.module.ts! Please consider moving Ab
outPage in D:/Personal_Files/Documenten/Ionic/ChecklistByBlackSuitDevelopers/src/pages/about/about.ts to a higher module that imports AppModule in D:/Personal_Files/Documenten/Ionic/ChecklistByBlackSuitD
evelopers/src/app/app.module.ts and AboutPageModule in D:/Personal_Files/Documenten/Ionic/ChecklistByBlackSuitDevelopers/src/pages/about/about.module.ts. You can also create a new NgModule that exports a
nd includes AboutPage in D:/Personal_Files/Documenten/Ionic/ChecklistByBlackSuitDevelopers/src/pages/about/about.ts then import that NgModule in AppModule in D:/Personal_Files/Documenten/Ionic/ChecklistB
yBlackSuitDevelopers/src/app/app.module.ts and AboutPageModule in D:/Personal_Files/Documenten/Ionic/ChecklistByBlackSuitDevelopers/src/pages/about/about.module.ts.
    at Error (native)
    at syntaxError (D:\Personal_Files\Documenten\Ionic\ChecklistByBlackSuitDevelopers\node_modules\@angular\compiler\bundles\compiler.umd.js:1550:34)
    at CompileMetadataResolver._addTypeToModule (D:\Personal_Files\Documenten\Ionic\ChecklistByBlackSuitDevelopers\node_modules\@angular\compiler\bundles\compiler.umd.js:14655:31)
    at D:\Personal_Files\Documenten\Ionic\ChecklistByBlackSuitDevelopers\node_modules\@angular\compiler\bundles\compiler.umd.js:14543:27
    at Array.forEach (native)
    at CompileMetadataResolver.getNgModuleMetadata (D:\Personal_Files\Documenten\Ionic\ChecklistByBlackSuitDevelopers\node_modules\@angular\compiler\bundles\compiler.umd.js:14534:54)
    at addNgModule (D:\Personal_Files\Documenten\Ionic\ChecklistByBlackSuitDevelopers\node_modules\@angular\compiler\bundles\compiler.umd.js:23050:58)
    at D:\Personal_Files\Documenten\Ionic\ChecklistByBlackSuitDevelopers\node_modules\@angular\compiler\bundles\compiler.umd.js:23061:14
    at Array.forEach (native)
    at _createNgModules (D:\Personal_Files\Documenten\Ionic\ChecklistByBlackSuitDevelopers\node_modules\@angular\compiler\bundles\compiler.umd.js:23060:26)

Posts: 2

Participants: 2

Read full topic


Cordova 7.0.1 - is it SAFE to update?

$
0
0

@jans-y wrote:

Hi guys!

Is it safe to update to Cordova 7.0.1 right now?

I am using a lot of plugins like intercom, facebook, googleplus, branch.

Is there a possibility I will have problems with any of this plugins?

What are the pros of updating?

Thank you very much for your answers!

Posts: 8

Participants: 4

Read full topic

Cordova-plugin-inappbrowser : download from external website with inAppBrowser in IONIC 3 app

$
0
0

@dvtopiya wrote:

Hello,

How can I download from external website which is opened in cordova inAppBrowser in IONIC 3. Currently I am using “cordova-plugin-inappbrowser”: “^1.7.1”.

Any help would be greatly appreciated.

Posts: 1

Participants: 1

Read full topic

Ios build error: Error: Command failed: xcrun simctl list --json

$
0
0

@lsantaniello wrote:

Hi guys,
I need of support for this error:

> ionic-app-scripts build "--prod" "--release"

[16:35:44]  ionic-app-scripts 1.3.7
[16:35:44]  build prod started ...
[16:35:44]  clean started ...
[16:35:44]  clean finished in 7 ms
[16:35:44]  copy started ...
[16:35:44]  ngc started ...
[16:35:58]  ngc finished in 13.93 s
[16:35:58]  preprocess started ...
[16:35:58]  deeplinks started ...
[16:36:00]  deeplinks finished in 1.63 s
[16:36:00]  optimization started ...
[16:36:00]  copy finished in 15.79 s
[16:36:20]  optimization finished in 20.26 s
[16:36:20]  preprocess finished in 21.88 s
[16:36:20]  webpack started ...
[16:36:44]  webpack finished in 23.61 s
[16:36:44]  sass started ...
[16:36:44]  uglifyjs started ...
[16:36:45]  sass finished in 1.58 s
[16:36:45]  cleancss started ...
[16:36:47]  cleancss finished in 2.15 s
[16:37:38]  uglifyjs finished in 54.76 s
[16:37:38]  postprocess started ...
[16:37:38]  postprocess finished in 52 ms
[16:37:38]  lint started ...
[16:37:38]  build prod finished in 114.30 s
[16:37:43]  lint finished in 4.26 s
Error: Command failed: xcrun simctl list --json
dyld: Library not loaded: /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator
  Referenced from: /Applications/Xcode.app/Contents/Developer/usr/bin/simctl
  Reason: image not found

Could you please help me?

Thanks in advance

Luca

Posts: 1

Participants: 1

Read full topic

Ionic openweathermap api call

$
0
0

@Louis101 wrote:

Im creating my first app in ionic 2, I am making a call to the api and that is working fine. The thing I am struggling with is the javascript side. My app doesnt have a .js file/folder so I am a little unsure in to where to put the javascript that handles the JSON from the API or if i create a javascript file then where do i call it from?

Posts: 6

Participants: 2

Read full topic

Enable pinch and zoom for entire app or entire page

$
0
0

@danzac wrote:

I’m searching in vain to find info on how to enable zoom in either the entire app, or at least on a per page basis. My pages usually consist of a mixture of text and images.

Is there a way to apply something like <ion-scroll zoom="true"></ion-scroll> to an entire page?

Any help would be appreciated.

Posts: 1

Participants: 1

Read full topic

Livereload problem

$
0
0

@gantonelli wrote:

Hi,
I’m new with Ionic, I have a problem with the lab livereload, it doesn’t work and in chrome console this error is showed:

VM54:164 WebSocket connection to ‘ws://localhost:35729/livereload’ failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED…

Does anyone have a solution?

Posts: 2

Participants: 1

Read full topic

Returning a value from a function

$
0
0

@Dubicki wrote:

Hello All,

I have the following function:

  getMonth(month) {
    this.calendarProvider.getMonths().then(data => {
      let months = data[0].months_of_year;
      for (let i = 0; i < months.length; i++) {
        if (i === month) {
          console.log(months[i]);
        }
      }
    });
  }

This function is called like so:

let now = new Date();
let month = this.getMonth(now.getMonth());

It is using a json file that is laid out like so:

[{
  "months_of_year": [
    "January",
    "February",
    "March",
    "April",
    "May",
    "June",
    "July",
    "August",
    "September",
    "October",
    "November",
    "December"
  ]
}]

Can some please tell me how to edit my function so that ii will return a string.

Posts: 2

Participants: 2

Read full topic


Failed to transpile program after ionic upload command

$
0
0

@shrivallabh wrote:

Hello,
Not able to upload the app .Getting below error after running command ionic upload


[22:59:08]  build dev started ...
[22:59:08]  clean started ...
[22:59:08]  clean finished in 1 ms
[22:59:08]  copy started ...
[22:59:08]  deeplinks started ...
[22:59:08]  deeplinks finished in 87 ms
[22:59:08]  transpile started ...
[22:59:10]  typescript: src/data/quotes.ts, line: 4
            Type '{ category: string; quotes: { id: string; person: string; text: string; }[]; icon: string; }[]' is not
            assignable to type '{ category: string; Quotes: quote[]; icon: String; }[]'. Type '{ category: string;
            quotes: { id: string; person: string; text: string; }[]; icon: string; }' is not assignable to type '{
            category: string; Quotes: quote[]; icon: String; }'. Object literal may only specify known properties, and
            'quotes' does not exist in type '{ category: string; Quotes: quote[]; icon: String; }'.

       L3:  category: 'inspirational',
       L4:  quotes: [

Error: Failed to transpile program
    at BuildError.Error (native)
    at new BuildError (/Users/shrivallabhdeshmukh/Desktop/Study/ionic 2 udemy/favQuotesTabsCli/favQuotesApp/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
    at /Users/shrivallabhdeshmukh/Desktop/Study/ionic 2 udemy/favQuotesTabsCli/favQuotesApp/node_modules/@ionic/app-scripts/dist/transpile.js:159:20
    at transpileWorker (/Users/shrivallabhdeshmukh/Desktop/Study/ionic 2 udemy/favQuotesTabsCli/favQuotesApp/node_modules/@ionic/app-scripts/dist/transpile.js:107:12)
    at Object.transpile (/Users/shrivallabhdeshmukh/Desktop/Study/ionic 2 udemy/favQuotesTabsCli/favQuotesApp/node_modules/@ionic/app-scripts/dist/transpile.js:64:12)
    at /Users/shrivallabhdeshmukh/Desktop/Study/ionic 2 udemy/favQuotesTabsCli/favQuotesApp/node_modules/@ionic/app-scripts/dist/build.js:106:82

Please check my ionic information below
cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.12.0
ionic (Ionic CLI) : 3.12.0

local packages:

@ionic/app-scripts : 3.0.0
Ionic Framework    : ionic-angular 3.7.1

System:

Node : v6.11.2
npm  : 3.10.10
OS   : macOS Sierra

Misc:

backend : legacy

Pleas help .Thanks in Advance

Posts: 3

Participants: 2

Read full topic

Ion Input is not working correctly

Refused to load the font when including $locationProvider

$
0
0

@TJL wrote:

After including the following bit of code to remove the base of the url ‘#’ i get the following error. Any suggestions on how to fix this?

    $locationProvider
      .html5Mode({
        enabled: true,
        requireBase: false
      })
      .hashPrefix('!');

Refused to load the font ‘’ because it violates the following Content Security Policy directive: “default-src ‘self’”. Note that ‘font-src’ was not explicitly set, so ‘default-src’ is used as a fallback.

Posts: 1

Participants: 1

Read full topic

How to reset/refresh virtualScroll headerFn on data change?

$
0
0

@mccumb01 wrote:

I’m using Ionic virtual scroll w/a custom headerFn, but it doesn’t reset/remove the headers after changing the data.

I want each “header” section to display the date of the report.
This works ok initially, but the virtual headers stick around incorrectly after the array data changes.

If I scroll a bit, some of the headers disappear, but the last one remains even when the data array is completely emptied/replaced. If array.length == 0, the headerFn is not even called, which leaves me no way to remove the errant headers.

Changing the array entirely should force a reset of the virtual scroll, right?
That doesn’t seem to happen, or, at least it doesn’t reset/remove the headers.

How can I completely destroy & recreate the header views?
Can I invoke headerFn directly myself somehow?
Is there some “removeChildren” function I can use?

Failing that, how can I destroy & recreate the entire virtual scroll view?
(Yes, I know that’s an expensive, slow operation … I just need this to work).

Thanks for any help or insight!!

<ion-list [virtualScroll]="reports" [approxItemHeight]="'60px'" [headerFn]="headerForDate">
  <ion-item-divider class="listHeader" *virtualHeader="let header">
    	<h2>{{ header }}</h2>
  </ion-item-divider>
  <ion-item class="reportTableCell" *virtualItem="let report" (click)="itemClicked($event, report)">
    <report-table-cell *ngIf="reports.length > 0" [item]=report></report-table-cell>
  </ion-item>
  <ion-item *ngIf="reports.length === 0">
     <h2>No Reports To Show</h2> <!-- This doesn't appear even if reports = []!? -->
  </ion-item>

...........

public reports: any[] = [];
public dividerKey = "";

filterReports(e){
  let filter = e.value;
  let res = dataSvc.getReportsFor(filter);
  this.reports = res; //I've tried both directly resetting "this.reports" and using a whole new array. Same issue.
  this.dividerKey = "";
}

//When reports array is reset to [], this is not called, so how can I remove header 0??
headerForDate = (report, index, reports) => {

    let reportDate = report.reportDate;
    let lastDivider = this.dividerKey;

    if (reportDate !== lastDivider) {
      this.dividerKey = reportDate;
      return this.dividerKey;
    }
    return null;
  }

Posts: 1

Participants: 1

Read full topic

In Ionic 3.x Back button showing as a square box in the header

Viewing all 70929 articles
Browse latest View live


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