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

Configuration file best practices

$
0
0

@lsantaniello wrote:

Hi guys,
I need to understand the best practices for configure my app. Could you please give me an advice? In java project, for example, we have a properties file. What is the common approach for ionic app? Can I use the ionic.config.json file and access to properties programmatically?

Thanks
Luca

Posts: 1

Participants: 1

Read full topic


Long press

$
0
0

@iampushpendra wrote:

How do i select item on Long press. i had used press but i m not satisfy with that implementation. i want to increase the time interval.
actually i had used press in tag but want some mo delay on press or use long press event… i don’t get any help from any where regarding long-press.

thankyou in advance

Posts: 4

Participants: 2

Read full topic

Angularfire2 listener/observer problem on logout

$
0
0

@jeffreysi wrote:

first of all my app already has an authentication process using angularfireauth.

import { Injectable } from '@angular/core';
import { AngularFireDatabase, AngularFireList, listChanges } from 'angularfire2/database';
import { AngularFireAuth } from 'angularfire2/auth';
import { Observable } from 'rxjs/Observable';

@Injectable()
export class FirebaseProvider {

itemsRef: AngularFireList<any>;
items: Observable<any[]>;

constructor(public afDatabase: AngularFireDatabase, private afAuth: AngularFireAuth ) {
    
    this.itemsRef = afDatabase.list('/messages');
 
    this.items = this.itemsRef.valueChanges();

 }
 
}

and on my html…(can only be viewed once logged-in)

<ion-item *ngFor="let item of items | async">
    {{item | json}}
  </ion-item>

this successfully prints a list of my firebase database. however… when i click logout on my app i get the ff…

permission_denied at /messages: Client doesn’t have permission to access the desired data.

i had thoroughly searched google for answers. mostly saying to ‘unsubscribe’ from a listener/observer etc.
unfortunately nothing worked out.

and please don’t tell me to change my firebase rules to allow read and write to public.

Posts: 1

Participants: 1

Read full topic

when i call post api in ionic 2 i have accur cros error

$
0
0

@pradhan7 wrote:

i think i’m writing some mistake in my code i was struggle last 2 days i haven’t solution please help…

  1. error is :- [Error] WebSocket network error: The operation couldn’t be completed. Connection refused (x192) [Error] ERROR – Response {_body: XMLHttpRequestProgressEvent, status: 0, ok: false, …} Response {_body: XMLHttpRequestProgressEvent, status: 0, ok: false, statusText: “”, headers: Headers, …}Response

  2. and my code is :-

import { Http, Headers, RequestOptions } from ‘@angular/http’; import { Injectable } from ‘@angular/core’; import ‘rxjs/add/operator/map’;

/* Generated class for the RestapiServiceProvider provider.

See https://angular.io/guide/dependency-injection for more info on providers and Angular DI. */

@Injectable() export class RestapiServiceProvider {

apiUrl = ‘http://localhost:8100/development/abc/public/api/v1/apiName’;

constructor(public http: Http) { console.log(‘Hello RestapiServiceProvider Provider’); }

getUsers() {

let headers = new Headers(); headers.append(‘Content-Type’, ‘application/json’); headers.append(‘Access-Control-Allow-Origin’, ‘*’); headers.append(‘Access-Control-Allow-Methods’, ‘POST, GET, OPTIONS, PUT’); headers.append(‘Accept’,‘application/json’); headers.append(“Access-Control-Allow-Headers”, “X-Requested-With”);

let options = new RequestOptions({ headers: headers,withCredentials: true });

let data1 = JSON.stringify({ user_id: 14, token: “dsfdsffsfsffsdfffsdffsfs” });

if (this.data) { return Promise.resolve(this.data); }

return new Promise(resolve => {

// app.post(’/’, function(req, res, next) { // Handle the post for this route // }) this.http.post(this.apiUrl, data1, options)

.map(res => res.json())

.subscribe(data => { this.data = data; resolve(this.data); }); }); }

}

Posts: 1

Participants: 1

Read full topic

How to print using print.js in ionic application without opening printer setup page

$
0
0

@muru1778 wrote:

We are developing ionic web application with printer functionality. We used Print.js npm to print the content. There is a page open in browser when we call print method. We can see the information like printer name, no.of pages and so on. Our requirement is to print the content without showing that setup page ionic application.

Posts: 1

Participants: 1

Read full topic

Get image from gallery

$
0
0

@duclt wrote:

How can get image from gallery on device and show on app ? thanks for any solutions

Posts: 2

Participants: 2

Read full topic

Checkbox in ion-slides with loop

$
0
0

@UhadesK wrote:

Hi,
I have a page which contains ion-slides with loop enabled. Each slide is generated with *ngFor and each one contains a checkbox. The problem I am facing is that the checkbox is not getting checked on first and last slides. I have found that its because there are duplicate slides for the first slide and last slide so clicking on the checkbox is not triggering it since there are duplicates for the same. I have tried giving Id to checkbox to make it unique but since the slides are generated dynamically whatever change I give is also getting replicated. Is there any workaround for this? Any help is much appreciated.
Thank you

Posts: 2

Participants: 2

Read full topic

Ionic 2 ios runtime permission check

$
0
0

@ramkumar2595 wrote:

This plugin works fine for android, which checks the microphone permission grant at run time. But there is no such equivalent of it ios. Could you share me how to check the microphone permission in run time in ios, and how to handle the deny events which user clicks in runtime.?

Posts: 1

Participants: 1

Read full topic


Import custom Components? Please help!

$
0
0

@felix9607 wrote:

Hello Guys,

I’ trying to create a custom Component as a repetitiv header for most of my pages.
So I used this command:

ionic g component profile-header

This folder got generated:
image

Somhow I can’t figure out how to use this component somewhere else now.
I call the component in another html like this:

<profile-header></profile-header>

I tried all kind of possibilites like importing components.module to app.module…importing ProfileHeaderComponent to the new page… but nothing worked :confused:

Most of the time I get this error:
image

I’m thankfull for any suggestions!

Posts: 1

Participants: 1

Read full topic

Best practices for multiple listener on single event

$
0
0

@gaurangkela wrote:

events are published while making chat with XMPP server, server published events like…

this.client.on('message:sent', function (msg) {
      console.log("message:sent");
      console.log(msg);
);

 this.client.on('pubsub:event', function (msg) {
      console.log("pubsub:event");
      console.log(msg);
);

 this.client.on('message', function (msg) {
      console.log("message");
      console.log(msg);
      );

this.client.on('stanza', function (msg) {
      console.log("stanza")

      console.log(msg);
    });

what will be impact on app if i use this events listener multiple times? does it will increase the load on application or anything else problem occurred? or any other side effect?

Posts: 1

Participants: 1

Read full topic

FCM notification

$
0
0

@mohammad7 wrote:

I’m trying to test the FCM notification. I followed everything in this youtube vid: https://www.youtube.com/watch?v=0AiTitxV7mk

When I try the app, it shows me an error:
uncaught (in promise) cordova not available

I tried running the app in my phone, it still shows me the same error. When I close the error window and try to send the notification; I do not receive the notification.

I’m basically trying to make an app that can send and receive notification, if there is another and better way to do it, please let me know.

Posts: 2

Participants: 2

Read full topic

Ionic build failed on android

$
0
0

@shriharip wrote:

Hello,

I am new to Ionic and programming and this is my first question, so please bear with me.
I am trying to build the app on android to do better debugging and check for geolocation and camera apis. But I am not successful.

I have more than 50 errors showing on my build. But everything looks like more or less related to the environment is what I believe looking at the various support forums.

My enviroment ( building on Ubuntu 16.x)
Node version 9 and npm version 5

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

@ionic/cli-utils  : 1.19.1
ionic (Ionic CLI) : 3.19.1

global packages:

cordova (Cordova CLI) : 8.0.0 

local packages:

@ionic/app-scripts : 3.1.8
Cordova Platforms  : android 7.0.0
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
Node              : v9.0.0
npm               : 5.6.0 
OS                : Linux 4.13

Environment Variables:

ANDROID_HOME : /home/hari/Android/Sdk

My plugin list
cordova-plugin-advanced-http 1.10.1 "Advanced HTTP plugin"
cordova-plugin-contacts 3.0.1 "Contacts"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-ionic-keyboard 2.0.5 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 1.1.16 "cordova-plugin-ionic-webview"
cordova-plugin-mauron85-background-geolocation 2.3.3 "CDVBackgroundGeolocation"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-whitelist 1.3.1 “Whitelist”

My package.json
"dependencies": {
"@angular/common": “5.0.3”,
"@angular/compiler": “5.0.3”,
"@angular/compiler-cli": “5.0.3”,
"@angular/core": “5.0.3”,
"@angular/forms": “5.0.3”,
"@angular/http": “5.0.3”,
"@angular/platform-browser": “5.0.3”,
"@angular/platform-browser-dynamic": “5.0.3”,
"@ionic-native/background-geolocation": “^4.5.3”,
"@ionic-native/camera": “4.3.3”,
"@ionic-native/contacts": “^4.5.3”,
"@ionic-native/core": “4.4.0”,
"@ionic-native/geolocation": “^4.5.3”,
"@ionic-native/http": “^4.5.3”,
"@ionic-native/splash-screen": “4.4.0”,
"@ionic-native/status-bar": “4.4.0”,
"@ionic/pro": “1.0.17”,
"@ionic/storage": “2.1.3”,
"@ngx-translate/core": “8.0.0”,
"@ngx-translate/http-loader": “^2.0.0”,
"@types/lodash": “^4.14.100”,
“cordova-android”: “^7.0.0”,
“cordova-plugin-advanced-http”: “^1.10.1”,
“cordova-plugin-contacts”: “^3.0.1”,
“cordova-plugin-device”: “^1.1.4”,
“cordova-plugin-file”: “^6.0.1”,
“cordova-plugin-geolocation”: “^4.0.1”,
“cordova-plugin-ionic-keyboard”: “^2.0.5”,
“cordova-plugin-ionic-webview”: “^1.1.16”,
“cordova-plugin-mauron85-background-geolocation”: “^2.3.3”,
“cordova-plugin-splashscreen”: “^4.0.3”,
“cordova-plugin-whitelist”: “^1.3.1”,
“core-js”: “^2.5.3”,
“firebase”: “^4.9.0”,
“geofire”: “^4.1.2”,
“ionic-angular”: “3.9.2”,
“ionicons”: “3.0.0”,
“lodash”: “^4.17.4”,
“mobx”: “^3.4.1”,
“mobx-angular”: “^2.1.1”,
“rxjs”: “5.5.2”,
“sw-toolbox”: “3.6.0”,
“zone.js”: “0.8.18”
},
“devDependencies”: {
"@ionic/app-scripts": “3.1.8”,
“prettier”: “^1.10.2”,
“typescript”: “2.4.2”
},
“description”: “An Ionic project”,
“cordova”: {
“plugins”: {
“cordova-plugin-geolocation”: {
“GEOLOCATION_USAGE_DESCRIPTION”: “To locate you”
},
“cordova-plugin-mauron85-background-geolocation”: {
“GOOGLE_PLAY_SERVICES_VERSION”: “+”,
“ICON”: “@mipmap/icon”,
“SMALL_ICON”: “@mipmap/icon”,
“ACCOUNT_NAME”: “@string/app_name”,
“ACCOUNT_LABEL”: “@string/app_name”,
“ACCOUNT_TYPE”: “$PACKAGE_NAME.account”,
“CONTENT_AUTHORITY”: “$PACKAGE_NAME”
},
“cordova-plugin-contacts”: {},
“cordova-plugin-advanced-http”: {},
“cordova-plugin-whitelist”: {},
“cordova-plugin-device”: {},
“cordova-plugin-splashscreen”: {},
“cordova-plugin-ionic-webview”: {},
“cordova-plugin-ionic-keyboard”: {},
“cordova-plugin-file”: {}
},
“platforms”: [
“android”
]
}

ANDROID_HOME=/home/hari/Android/Sdk
JAVA_HOME=/usr/lib/jvm/java-8-oracle

And finally the build errors
cordova/BackgroundGeolocationPlugin.java:563: error: cannot find symbol
@TargetApi(Build.VERSION_CODES.KITKAT)
^
symbol: variable KITKAT
location: class VERSION_CODES

cordova/file/FileUtils.java:97: error: cannot find symbol
Manifest.permission.READ_EXTERNAL_STORAGE,
^
symbol: variable READ_EXTERNAL_STORAGE
location: class permission

android/app/src/main/java/org/apache/cordova/file/FileUtils.java:998: error: cannot find symbol
ret.put(“externalDataDirectory”, toDirUrl(context.getExternalFilesDir(null)));
^
symbol: method getExternalFilesDir()

symbol: variable LOLLIPOP
location: class VERSION_CODES
/home/hari/mysharedv1/platforms/android/app/src/main/java/org/apache/cordova/file/LocalFilesystem.java:424: error: cannot find symbol
for (File f : context.getExternalMediaDirs()) {
^
symbol: method getExternalMediaDirs()
location: variable context of type Context
/home/hari/mysharedv1/platforms/android/app/src/main/java/org/apache/cordova/contacts/ContactAccessorSdk5.java:999: error: cannot find symbol
photoCursor = mApp.getActivity().getContentResolver().query(photoUri, new String[] {ContactsContract.Contacts.Photo.PHOTO}, null, null, null);
^
symbol: variable PHOTO
location: class Photo
/home/hari/mysharedv1/platforms/android/app/src/main/java/org/apache/cordova/splashscreen/SplashScreen.java:290: error: cannot find symbol
LayoutParams layoutParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
^
symbol: variable MATCH_PARENT
location: class LayoutParams
/home/hari/mysharedv1/platforms/android/app/src/main/java/org/apache/cordova/splashscreen/SplashScreen.java:290: error: cannot find symbol
LayoutParams layoutParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
^
symbol: variable MATCH_PARENT
location: class LayoutParams
/home/hari/mysharedv1/platforms/android/app/src/main/java/org/apache/cordova/device/Device.java:132: error: cannot find symbol
String serial = android.os.Build.SERIAL;
^
symbol: variable SERIAL
location: class Build
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/marianhello/bgloc/LocationService.java:189: error: cannot find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
^
symbol: variable JELLY_BEAN_MR2
location: class VERSION_CODES
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/marianhello/bgloc/LocationService.java:190: error: cannot find symbol
handlerThread.quitSafely();
^
symbol: method quitSafely()
location: variable handlerThread of type HandlerThread
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/marianhello/bgloc/LocationService.java:198: error: method does not override or implement a method from a supertype
@Override
^
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/marianhello/bgloc/LocationService.java:207: error: cannot find symbol
super.onTaskRemoved(rootIntent);
^
symbol: method onTaskRemoved(Intent)
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/marianhello/bgloc/LocationService.java:421: error: cannot find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
^
symbol: variable HONEYCOMB
location: class VERSION_CODES
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/marianhello/bgloc/LocationService.java:422: error: cannot find symbol
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, location);
^
symbol: variable THREAD_POOL_EXECUTOR
location: class AsyncTask
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/marianhello/bgloc/data/BackgroundLocation.java:55: error: cannot find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
^
symbol: variable JELLY_BEAN_MR1
location: class VERSION_CODES
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/marianhello/bgloc/data/BackgroundLocation.java:56: error: cannot find symbol
elapsedRealtimeNanos = location.getElapsedRealtimeNanos();
^
symbol: method getElapsedRealtimeNanos()
location: variable location of type Location
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/marianhello/bgloc/data/BackgroundLocation.java:58: error: cannot find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
^
symbol: variable JELLY_BEAN_MR2
location: class VERSION_CODES
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/marianhello/bgloc/data/BackgroundLocation.java:59: error: cannot find symbol
isFromMockProvider = location.isFromMockProvider();
^
symbol: method isFromMockProvider()
location: variable location of type Location
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/marianhello/bgloc/data/BackgroundLocation.java:567: error: cannot find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
^
symbol: variable JELLY_BEAN_MR1
location: class VERSION_CODES
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/marianhello/bgloc/data/BackgroundLocation.java:568: error: cannot find symbol
l.setElapsedRealtimeNanos(elapsedRealtimeNanos);
^
symbol: method setElapsedRealtimeNanos(long)
location: variable l of type Location
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/marianhello/bgloc/data/BackgroundLocation.java:592: error: cannot find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
^
symbol: variable JELLY_BEAN_MR1
location: class VERSION_CODES
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/marianhello/bgloc/data/sqlite/SQLiteOpenHelper.java:118: error: cannot find symbol
Log.d(TAG, "Creating db: " + this.getDatabaseName());
^
symbol: method getDatabaseName()
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/marianhello/bgloc/data/sqlite/SQLiteOpenHelper.java:172: error: method does not override or implement a method from a supertype
@Override
^
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/marianhello/bgloc/data/sqlite/SQLiteLocationDAO.java:113: error: method queryNumEntries in class DatabaseUtils cannot be applied to given types;
return DatabaseUtils.queryNumEntries(db, LocationEntry.TABLE_NAME, whereClause, whereArgs);
^
required: SQLiteDatabase,String
found: SQLiteDatabase,String,String,String[]
reason: actual and formal argument lists differ in length
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/marianhello/bgloc/data/sqlite/SQLiteLocationDAO.java:154: error: cannot find symbol
db.beginTransactionNonExclusive();
^
symbol: method beginTransactionNonExclusive()
location: variable db of type SQLiteDatabase
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/marianhello/bgloc/sync/BatchManager.java:70: error: cannot find symbol
db.beginTransactionNonExclusive();
^
symbol: method beginTransactionNonExclusive()
location: variable db of type SQLiteDatabase
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/marianhello/bgloc/sync/SyncAdapter.java:71: error: constructor AbstractThreadedSyncAdapter in class AbstractThreadedSyncAdapter cannot be applied to given types;
super(context, autoInitialize, allowParallelSyncs);
^
required: Context,boolean
found: Context,boolean,boolean
reason: actual and formal argument lists differ in length
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/marianhello/bgloc/sync/SyncService.java:60: error: cannot find symbol
settingsBundle.putBoolean(ContentResolver.SYNC_EXTRAS_DO_NOT_RETRY, false);
^
symbol: variable SYNC_EXTRAS_DO_NOT_RETRY
location: class ContentResolver
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/marianhello/bgloc/HttpPostService.java:59: error: cannot find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
^
symbol: variable KITKAT
location: class VERSION_CODES
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/tenforwardconsulting/bgloc/DistanceFilterLocationProvider.java:148: error: cannot find symbol
criteria.setHorizontalAccuracy(translateDesiredAccuracy(config.getDesiredAccuracy()));
^
symbol: method setHorizontalAccuracy(Integer)
location: variable criteria of type Criteria
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/tenforwardconsulting/bgloc/DistanceFilterLocationProvider.java:166: error: cannot find symbol
if (provider != LocationManager.PASSIVE_PROVIDER) {
^
symbol: variable PASSIVE_PROVIDER
location: class LocationManager
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/tenforwardconsulting/bgloc/DistanceFilterLocationProvider.java:187: error: cannot find symbol
accuracy = Criteria.ACCURACY_LOW;
^
symbol: variable ACCURACY_LOW
location: class Criteria
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/tenforwardconsulting/bgloc/DistanceFilterLocationProvider.java:190: error: cannot find symbol
accuracy = Criteria.ACCURACY_MEDIUM;
^
symbol: variable ACCURACY_MEDIUM
location: class Criteria
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/tenforwardconsulting/bgloc/DistanceFilterLocationProvider.java:193: error: cannot find symbol
accuracy = Criteria.ACCURACY_HIGH;
^
symbol: variable ACCURACY_HIGH
location: class Criteria
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/tenforwardconsulting/bgloc/DistanceFilterLocationProvider.java:196: error: cannot find symbol
accuracy = Criteria.ACCURACY_HIGH;
^
symbol: variable ACCURACY_HIGH
location: class Criteria
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/tenforwardconsulting/bgloc/DistanceFilterLocationProvider.java:199: error: cannot find symbol
accuracy = Criteria.ACCURACY_MEDIUM;
^
symbol: variable ACCURACY_MEDIUM
location: class Criteria
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/tenforwardconsulting/bgloc/DistanceFilterLocationProvider.java:463: error: cannot find symbol
criteria.setHorizontalAccuracy(Criteria.ACCURACY_HIGH);
^
symbol: variable ACCURACY_HIGH
location: class Criteria
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/tenforwardconsulting/bgloc/DistanceFilterLocationProvider.java:467: error: cannot find symbol
locationManager.requestSingleUpdate(criteria, singleUpdatePI);
^
symbol: method requestSingleUpdate(Criteria,PendingIntent)
location: variable locationManager of type LocationManager
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/tenforwardconsulting/cordova/BackgroundGeolocationPlugin.java:535: error: cannot find symbol
activity.bindService(locationServiceIntent, mConnection, Context.BIND_IMPORTANT);
^
symbol: variable BIND_IMPORTANT
location: class Context
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/tenforwardconsulting/cordova/BackgroundGeolocationPlugin.java:569: error: cannot find symbol
return getContext().registerReceiver(locationModeChangeReceiver, new IntentFilter(LocationManager.MODE_CHANGED_ACTION));
^
symbol: variable MODE_CHANGED_ACTION
location: class LocationManager
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/tenforwardconsulting/cordova/BackgroundGeolocationPlugin.java:585: error: cannot find symbol
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
^
symbol: variable ACTION_APPLICATION_DETAILS_SETTINGS
location: class Settings
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/tenforwardconsulting/cordova/BackgroundGeolocationPlugin.java:598: error: cannot find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
^
symbol: variable KITKAT
location: class VERSION_CODES
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/tenforwardconsulting/cordova/BackgroundGeolocationPlugin.java:599: error: cannot find symbol
locationMode = Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.LOCATION_MODE);
^
symbol: variable LOCATION_MODE
location: class Secure
/home/hari/mysharedv1/platforms/android/app/src/main/java/com/tenforwardconsulting/cordova/BackgroundGeolocationPlugin.java:600: error: cannot find symbol
return locationMode != Settings.Secure.LOCATION_MODE_OFF;
^
symbol: variable LOCATION_MODE_OFF
location: class Secure
/home/hari/mysharedv1/platforms/android/app/src/main/java/io/ionic/keyboard/IonicKeyboard.java:91: error: cannot find symbol
display.getSize(size);
^
symbol: method getSize(Point)
location: variable display of type Display
/home/hari/mysharedv1/platforms/android/app/src/main/java/io/ionic/keyboard/IonicKeyboard.java:131: error: cannot find symbol
rootView.getViewTreeObserver().removeOnGlobalLayoutListener(list);
^
symbol: method removeOnGlobalLayoutListener(OnGlobalLayoutListener)
location: class ViewTreeObserver
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
53 errors

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:compileDebugJavaWithJavac’.

Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Requesting help with how to proceed further from here.

I tried to remove and add plugins, I moved to different api level ,

Which way should i proceed?

Posts: 2

Participants: 2

Read full topic

Ionic Pro upgrade, what are happened?

$
0
0

@lsantaniello wrote:

Hi guys,
today I come back to work on ionic but all commands are changed. I don’t understand what are happened. Did Ionic migrate on ionic Pro platform? Is it free or I need to buy an pro account in order to use the features that I used before?

  1. Is mandatory to use Git repo on Ionic Pro if I want to upload my app on Ionic View?
  2. On my iphone, I installed Ionic Viw app but all apps are not available. And I cannot load a new app. Why?

Could you please support me?

Thanks

Posts: 1

Participants: 1

Read full topic

Click event slow IOS with list over 20 items

$
0
0

@sdetweil wrote:

I have this ionic 2 app, with a modal page, with a list of rows. one of the gestures is double click to action a row and refresh the data. this is a file browser type UI. , you can also select one or more rows (files) via click.
so there is a click handler and a double click handler per row,

sometimes the list is 10 items, sometimes over 100… it scrolls to show additional data.

on android, note 3, double click works fine regardless of how many items are in the list
ipad Air, the click handler is real slow ~5 seconds, when the list is over 20 items. and double click never works (timeout is 400ms)

i added a press gesture as a workaround to not being able to double click, but that seems unnatural

is this a device performance thing, or an IOS thing, or a page design thing?

the modal page

<ion-header padding width="100%">

  <ion-toolbar>
    <ion-title>{{dialog_title}}</ion-title>
  </ion-toolbar>

 	<ion-row>
 		<div class="col dashed-border" >{{parentpath}}</div>
	</ion-row>      
	<ion-toolbar no-padding>
		<ion-row >
			<ion-col col-2  class=" colb  center">Select</ion-col >
			<ion-col col-2  class=" colb  center">Type</ion-col  >
			<ion-col col-8  class=" colb ">Name</ion-col>
		</ion-row>			
	</ion-toolbar>     	
</ion-header>
<ion-content padding  width="100%">
 <!--- file modal here --->   									
<ion-row  *ngFor="let file of files; let i = index" (click)="setClickedRow(i,'file','any')"
                       (press)="doubleClick(i,file)"> 									 
	 <ion-col col-2 text-center class="colb " no-padding >				 					
		 <ion-checkbox  [(ngModel)]="file.selected" (click)="setClickedRow(i,'file','any')"></ion-checkbox>  
	 	 </ion-col>
	 <ion-col col-2 class = "colb center" >{{file.filetype}}</ion-col> 									 
	 <ion-col col-8 class = "colb" (dblTap)="doubleClick(i,file)"   
			no-padding>{{file.name}}</ion-col> 
	 <ion-col col-0 style="display:none" >{{file.id}}</ion-col> 										 													
</ion-row>										 

</ion-content>

Posts: 1

Participants: 1

Read full topic

Accessing an interface inside a declared module... I have no clue

$
0
0

@Slitelee wrote:

Does anyone know how to do this?

I need to be able to access or loop through the property keys of the embedded interface.

let server = server.calendar;
server = undefined

Why is this undefined?

This seems like it should be simple to do but I spent way more than is reasonable on it. I’m still relatively new to Typescript and Ionic so any help would greatly be appreciated.

Calendar.d.ts file looks like…

declare module server {

interface calendar {

mobileID: string;
extid: string;
date?: Date;
contactid: string;

Posts: 2

Participants: 2

Read full topic


Displaying and receiving notification from a web api

$
0
0

@olajhidey wrote:

I am developing a mobile application with a web platform. The web platform assign some task to the mobile application and the mobile application then reply concerning the task been assigned. The web platform connects to the mobile using an API. But i have been unable to send and implement notification into both the web and the mobile application. I would be so glad if i can get probably a blog or link that implements Receiving and sending notification between web and mobile.

Thank you

Posts: 1

Participants: 1

Read full topic

How to detect printer connected with system using ionic web application

$
0
0

@muru1778 wrote:

We are developing ionic web application with printer functionality. We used Print.js npm to print the content. If in case the printer not connected with system, I need to show some message about this. how can I determine whether the printer is connected or not. Is there any way in print.js npm or any other npm to determine this requirement.

Posts: 1

Participants: 1

Read full topic

Ionic cordova run/build/emulate android not working

$
0
0

@Mikebarson wrote:

When I do
adb devices -l I could see my Oneplus in the list.

Doing ionic cordova run android doesn’t open my app on my phone.
I also tried doing ionic cordova --device=<device_address> but that didn’t work also.

I also noticed that doing ionic cordova build android didn’t make an apk that I could copy and past over to my device so that I could manually install it.

Tried ionic cordova emulate android that also didn’t work,

Any idea on how to get this running?

Posts: 1

Participants: 1

Read full topic

Ionic Android 5.1.1 SyntaxError: Use of const in strict mode

$
0
0

@crisp978 wrote:

Hi,
I have this runtime error on android devices 5.1.1 or 4.4.2
After splashscreen the app remain on a white page.
The errors that I found are :
02-23 16:41:33.020 4088-4088/com.farmamob.farmaciafavarin D/SystemWebChromeClient: file:///android_asset/www/index.html: Line 10 : Viewport argument key “viewport-fit” not recognized and ignored.
02-23 16:41:33.020 4088-4088/com.farmamob.farmaciafavarin I/chromium: [INFO:CONSOLE(10)] “Viewport argument key “viewport-fit” not recognized and ignored.”, source: file:///android_asset/www/index.html (10)
02-23 16:41:33.030 4088-4088/com.farmamob.farmaciafavarin D/JsMessageQueue: Set native->JS mode to EvalBridgeMode
02-23 16:41:33.300 4088-4088/com.farmamob.farmaciafavarin D/SystemWebChromeClient: file:///android_asset/www/build/vendor.js: Line 1 : Uncaught SyntaxError: Use of const in strict mode.
02-23 16:41:33.300 4088-4088/com.farmamob.farmaciafavarin I/chromium: [INFO:CONSOLE(1)] “Uncaught SyntaxError: Use of const in strict mode.”, source: file:///android_asset/www/build/vendor.js (1)
02-23 16:41:33.300 4088-4088/com.farmamob.farmaciafavarin D/SystemWebChromeClient: file:///android_asset/www/build/main.js: Line 1 : Uncaught ReferenceError: webpackJsonp is not defined
02-23 16:41:33.300 4088-4088/com.farmamob.farmaciafavarin I/chromium: [INFO:CONSOLE(1)] “Uncaught ReferenceError: webpackJsonp is not defined”, source: file:///android_asset/www/build/main.js (1)

My Ionic info is :
cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.1
ionic (Ionic CLI) : 3.19.1

global packages:

cordova (Cordova CLI) : 8.0.0

local packages:

@ionic/app-scripts : 3.1.2
Cordova Platforms  : android 7.0.0 browser 5.0.3 ios 4.5.4
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
ios-deploy        : 1.9.0
ios-sim           : 5.0.13
Node              : v9.4.0
npm               : 5.6.0
OS                : macOS Sierra
Xcode             : Xcode 9.2 Build version 9C40b

Environment Variables:

ANDROID_HOME : /Users/cristianpuscasiu/Library/Android/sdk

Misc:

backend : pro

My package.json is :slight_smile:
{
“name”: “Farmacia-Favarin”,
“version”: “1.0.0”,
“author”: “CrisPSoft”,
“homepage”: “www.farmamob.it”,
“private”: true,
“config”: {
“ionic_webpack”: “./config/webpack.config.js”
},
“scripts”: {
“clean”: “ionic-app-scripts clean”,
“build”: “ionic-app-scripts build --webpack ./config/webpack.config.js”,
“lint”: “ionic-app-scripts lint”,
“ionic:build”: “ionic-app-scripts build --webpack ./config/webpack.config.js”,
“ionic:serve”: “ionic-app-scripts serve”
},
“dependencies”: {
"@angular/common": “5.0.1”,
"@angular/compiler": “5.0.1”,
"@angular/compiler-cli": “5.0.1”,
"@angular/core": “5.0.1”,
"@angular/forms": “5.0.1”,
"@angular/http": “5.0.1”,
"@angular/platform-browser": “5.0.1”,
"@angular/platform-browser-dynamic": “5.0.1”,
"@aspnet/signalr-client": “^1.0.0-alpha2-final”,
"@ionic-native/camera": “^4.5.2”,
"@ionic-native/core": “4.4.0”,
"@ionic-native/device": “^4.5.2”,
"@ionic-native/file": “^4.5.2”,
"@ionic-native/file-path": “^4.5.2”,
"@ionic-native/push": “^4.5.2”,
"@ionic-native/splash-screen": “4.4.0”,
"@ionic-native/status-bar": “4.4.0”,
"@ionic/storage": “^2.1.3”,
“cordova-android”: “7.0.0”,
“cordova-android-support-gradle-release”: “^1.2.0”,
“cordova-browser”: “5.0.3”,
“cordova-ios”: “4.5.4”,
“cordova-plugin-camera”: “^4.0.1”,
“cordova-plugin-device”: “^1.1.7”,
“cordova-plugin-file”: “^6.0.1”,
“cordova-plugin-filepath”: “^1.1.0”,
“cordova-plugin-ionic-webview”: “^1.1.16”,
“cordova-plugin-splashscreen”: “^4.1.0”,
“cordova-plugin-whitelist”: “^1.3.3”,
“cordova-sqlite-storage”: “^2.2.0”,
“ionic-angular”: “3.9.2”,
“ionic-plugin-keyboard”: “^2.2.1”,
“ionicons”: “3.0.0”,
“phonegap-plugin-push”: “^2.1.2”,
“rxjs”: “5.5.2”,
“sw-toolbox”: “3.6.0”,
“zone.js”: “0.8.18”
},
“devDependencies”: {
"@ionic/app-scripts": “3.1.2”,
“typescript”: “2.4.2”
},
“description”: “An Ionic project”,
“cordova”: {
“plugins”: {
“cordova-sqlite-storage”: {},
“cordova-plugin-camera”: {},
“cordova-plugin-file”: {},
“cordova-plugin-filepath”: {},
“ionic-plugin-keyboard”: {},
“cordova-plugin-device”: {},
“cordova-plugin-splashscreen”: {},
“cordova-plugin-ionic-webview”: {},
“phonegap-plugin-push”: {
“SENDER_ID”: “997597322709”
},
“cordova-plugin-whitelist”: {},
“cordova-android-support-gradle-release”: {
“ANDROID_SUPPORT_VERSION”: “25.+”
}
},
“platforms”: [
“browser”,
“ios”,
“android”
]
}
}

I tried to compile with --prod but doesn’t change the error.

Anybody can help me?
Thanks,
Cristian

Posts: 1

Participants: 1

Read full topic

Ionic bluetooth serial write html content

$
0
0

@emiljenson wrote:

Hi,

I am trying to print some content in my app into a thermal printer. When i print a normal text , it works perfectly. But i want is a formatted data. I am trying to print a product bill. So i tried adding HTML table , but it does not print the table , instead it prints the html code as it is.

Any idea on how to solve this ??

Find below sample of the code which i tried

      printData += "<table><tr><th>No</th> <th>Item</th> <th>Price</th></tr></table>";
      printData += "<tr><td>1</td> <td>Dhoti Lungi Pagiti big name</td> <td>150</td></tr>";
      printData += "<tr><td>1</td> <td>Dhoti </td> <td>250</td></tr>";
      printData += "</table>";
      printData += "\n\n\n";

     let xyz=this.connectBT(address).subscribe(data=>{
      this.btSerial.write(printData).then(dataz=>{
        console.log("WRITE SUCCESS",dataz);

        let mno=this.alertCtrl.create({
          title:"Print SUCCESS!",
          buttons:['Dismiss']
        });
        mno.present();

        xyz.unsubscribe();
      },errx=>{
        console.log("WRITE FAILED",errx);
        let mno=this.alertCtrl.create({
          title:"ERROR "+errx,
          buttons:['Dismiss']
        });
        mno.present();
      });
      },err=>{
        console.log("CONNECTION ERROR",err);
        let mno=this.alertCtrl.create({
          title:"ERROR "+err,
          buttons:['Dismiss']
        });
        mno.present();
      });


Posts: 1

Participants: 1

Read full topic

Viewing all 49323 articles
Browse latest View live


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