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

Pushtoken Vue + Ionic

$
0
0

@moiset wrote:

I’m developing an application with Vue and IONIC. I want to request the permissions of notifications and store in my database the pushtoken for sending push notifications.

All the examples I have seen are with Angular :(. Does anyone have documentation of how this process is done?

Thanks beforehand.

Posts: 1

Participants: 1

Read full topic


How can I display errors that display in XCode in Ionic?

$
0
0

@brianmackey wrote:

I have some network errors like this:

2019-07-25 13:20:33.436282-0500 Project[451:26234] TIC TCP Conn Failed [18:0x2827fd8c0]: 3:-9816 Err(-9816)

2019-07-25 13:20:45.061083-0500 Project[451:26235] Task .<0> HTTP load failed (error code: -999 [1:89])

I also setup an interceptor that I thought was going to catch and display any such error. It doesn’t display these errors:

intercept(
    req: HttpRequest<any>,
    next: HttpHandler,
  ): Observable<HttpSentEvent | HttpHeaderResponse | HttpProgressEvent | HttpResponse<any> | HttpUserEvent<any>> {

    req = req.clone({
      setHeaders: {
        Authorization: `Bearer ${token}`,
      },
    });

    return next.handle(req).pipe(
      tap({
        error: this.errorHandler,
      }),
    );
  }

  private errorHandler = (error: any): void => {
    if (error instanceof HttpErrorResponse) {
      const message = HTTPManager.getErrorMessage(error);

      this.alerts.showErrorMessage(message);
    }
  }

Posts: 1

Participants: 1

Read full topic

How can I log to a file?

$
0
0

@brianmackey wrote:

I am having internet connection issues on client sites. I want to be able to log to a file /non internet source. How can I do this on an iPad?

Ionic 3. Plugins are fine.

Posts: 1

Participants: 1

Read full topic

Duvida com Ionic

$
0
0

@guilber wrote:

Olá pessoal já faz um tempo que venho tentando instalar a versão 3 do ionic mais sempre que instalo vem a 4 como faço pra instalar a 3 de uma vez e iniciar projetos nela ?

Posts: 1

Participants: 1

Read full topic

Ionic 4 firebase logged in user doesn't stay logged on

$
0
0

@obinnae wrote:

My app uses AngularFire to authenticate with email/password. After logging in, it shows a list of Firestore records (at least it’s supposed to) for the logged-in user.
What’s happening is that the first time I run it via ionic serve, it works fine (shows the login screen, I enter email & password and login, it goes to the list page with the records shown). After updating the code & reloading, the records aren’t showing. I log out and log in again, and the records still won’t show.
I added the following to ngOnInit() see if I’m still logged in…

if (this.fAuth.auth.currentUser) 
      console.log("logged in user: ", this.fAuth.auth.currentUser.email);
    else
      console.log("Not logged in!!");
    });

First time I log in, “logged in user” shows. After code update & reload, sometimes it says “Not logged in”, sometimes nothing shows! I added the same code to the constructor, no luck!
The only way to show the records is to stop the ionic serve (via ctrl+c) and run it again.

What the heck? Is this a bug? How can I get it to always stay logged on, with the records showing everytime I update the code and it reloads??
Please help!

Posts: 1

Participants: 1

Read full topic

AppFlow fails to build

$
0
0

@mydoal2 wrote:

Appflow using node 10 fails to build.
Previous build using node 8 passed successfully.
Does anyone know how to force AppFlow to use specific node version?

22:22:53: — Step: build_pro_app —
22:22:53: ---------------------------
22:22:53: Installing Dependencies
22:22:53: $ npm install --quiet --no-optional
[22:23:14]: ▸ > grpc@1.10.1 install /builds/project-0/node_modules/grpc
[22:23:14]: ▸ > node-pre-gyp install --fallback-to-build --library=static_library
[22:23:15]: ▸ node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.10.1/node-v64-linux-x64-glibc.tar.gz
[22:23:15]: ▸ node-pre-gyp ERR! Pre-built binaries not found for grpc@1.10.1 and node@10.16.0 (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
[22:23:15]: ▸ node-pre-gyp ERR! Pre-built binaries not installable for grpc@1.10.1 and node@10.16.0 (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
[22:23:15]: ▸ node-pre-gyp ERR! Hit error Connection closed while downloading tarball file
[22:23:17]: ▸ make: Entering directory ‘/builds/project-0/node_modules/grpc/build’
[22:23:17]: ▸ CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
[22:23:17]: ▸ make: Entering directory ‘/builds/project-0/node_modules/grpc/build’
[22:23:17]: ▸ CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
[22:23:17]: ▸ CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o
[22:23:17]: ▸ sed: can’t read ./Release/.deps/Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o.d.raw: No such file or directory
[22:23:17]: ▸ rm: cannot remove ‘./Release/.deps/Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o.d.raw’: No such file or directory
[22:23:17]: ▸ grpc.target.mk:394: recipe for target ‘Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o’ failed
[22:23:17]: ▸ make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o] Error 1
[22:23:17]: ▸ make: Leaving directory ‘/builds/project-0/node_modules/grpc/build’
[22:23:17]: ▸ gyp ERR! build error
[22:23:17]: ▸ gyp ERR! stack Error: make failed with exit code: 2
[22:23:17]: ▸ gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
[22:23:17]: ▸ gyp ERR! stack at ChildProcess.emit (events.js:198:13)
[22:23:17]: ▸ gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
[22:23:17]: ▸ gyp ERR! System Linux 4.14.97-90.72.amzn2.x86_64
[22:23:17]: ▸ gyp ERR! command “/usr/local/bin/node” “/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “build” “–fallback-to-build” “–library=static_library” “–module=/builds/project-0/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node” “–module_name=grpc_node” “–module_path=/builds/project-0/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc”
[22:23:17]: ▸ gyp ERR! cwd /builds/project-0/node_modules/grpc
[22:23:17]: ▸ gyp ERR! node -v v10.16.0
[22:23:17]: ▸ gyp ERR! node-gyp -v v3.8.0
[22:23:17]: ▸ gyp ERR! not ok
[22:23:17]: ▸ node-pre-gyp ERR! build error
[22:23:17]: ▸ node-pre-gyp ERR! stack Error: Failed to execute ‘/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/builds/project-0/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/builds/project-0/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc’ (1)
[22:23:17]: ▸ node-pre-gyp ERR! stack at ChildProcess. (/builds/project-0/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
[22:23:17]: ▸ node-pre-gyp ERR! stack at ChildProcess.emit (events.js:198:13)
[22:23:17]: ▸ node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:982:16)
[22:23:17]: ▸ node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
[22:23:17]: ▸ node-pre-gyp ERR! System Linux 4.14.97-90.72.amzn2.x86_64
[22:23:17]: ▸ node-pre-gyp ERR! command “/usr/local/bin/node” “/builds/project-0/node_modules/grpc/node_modules/.bin/node-pre-gyp” “install” “–fallback-to-build” “–library=static_library”
[22:23:17]: ▸ node-pre-gyp ERR! cwd /builds/project-0/node_modules/grpc
[22:23:17]: ▸ node-pre-gyp ERR! node -v v10.16.0
[22:23:17]: ▸ node-pre-gyp ERR! node-pre-gyp -v v0.7.0
[22:23:17]: ▸ node-pre-gyp ERR! not ok
[22:23:17]: ▸ Failed to execute ‘/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/builds/project-0/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/builds/project-0/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc’ (1)
[22:23:17]: ▸ Assembler messages:
[22:23:17]: ▸ Error: can’t open /builds/project-0/node_modules/grpc/ccEhUZip.s for reading: No such file or directory
[22:23:17]: ▸ grpc.target.mk:394: recipe for target ‘Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o’ failed
[22:23:17]: ▸ make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o] Error 1
[22:23:17]: ▸ make: Leaving directory ‘/builds/project-0/node_modules/grpc/build’
[22:23:17]: ▸ gyp ERR! build error
[22:23:17]: ▸ gyp ERR! stack Error: make failed with exit code: 2
[22:23:17]: ▸ gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
[22:23:17]: ▸ gyp ERR! stack at ChildProcess.emit (events.js:198:13)
[22:23:17]: ▸ gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
[22:23:17]: ▸ gyp ERR! System Linux 4.14.97-90.72.amzn2.x86_64
[22:23:17]: ▸ gyp ERR! command “/usr/local/bin/node” “/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “build” “–fallback-to-build” “–library=static_library” “–module=/builds/project-0/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node” “–module_name=grpc_node” “–module_path=/builds/project-0/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc”
[22:23:17]: ▸ gyp ERR! cwd /builds/project-0/node_modules/grpc
[22:23:17]: ▸ gyp ERR! node -v v10.16.0
[22:23:17]: ▸ gyp ERR! node-gyp -v v3.8.0
[22:23:17]: ▸ gyp ERR! not ok
[22:23:18]: ▸ npm ERR! code ELIFECYCLE
[22:23:18]: ▸ npm ERR! errno 1
[22:23:18]: ▸ npm ERR! grpc@1.10.1 install: node-pre-gyp install --fallback-to-build --library=static_library
[22:23:18]: ▸ npm ERR! Exit status 1
[22:23:18]: ▸ npm ERR!
[22:23:18]: ▸ npm ERR! Failed at the grpc@1.10.1 install script.
[22:23:18]: ▸ npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Posts: 1

Participants: 1

Read full topic

Ionic 4: global.scss cause blank screen - only to browser

$
0
0

@devmob-firb wrote:

I’ve read the doc, searched for GitHub all open and closed issues and other sources but can’t solve this issue.

Specifically, inside global.scss there is the line @import '~@ionic/angular/css/structure.css' that gives blank screen without throwing any error when compiling to browser (Chrome), but works fine when compiling to Mobile (Capacitor + Android Studio + physical device).

Workaround: I have to commented out that line to make it work on Browser, but on Mobile I lose the structure of this specific global stylesheet and therefore all predefined CSS structure.

Ionic:

   ionic (Ionic CLI): 5.2.3
   Ionic Framework: @ionic/angular: 4.4.2
   @angular-devkit/build-angular: 0.13.9
   @angular-devkit/schematics: 7.3.9
   @angular/cli: 7.3.9
   @ionic/angular-toolkit: 1.5.1

Capacitor:

   capacitor/cli: 1.0.0
   capacitor/android: 1.0.0
   capacitor/core: 1.0.0

System:

   Android SDK Tools: 28
   NodeJS: v11.15.0
   npm: 6.10.1
   OS: Windows 10 Version 1089 (OS Build 17763.615)
   Android Studio: 3.4.2

Posts: 1

Participants: 1

Read full topic

Error in command ionic cordova run --list --verbose


Routing from Json page to page

Integration with TLS Server

Ion-input touch not working while loading the application in android 9

$
0
0

@Subodh18 wrote:

Hii guys,

i am using one login screen which contains two input fields .when coming to android 7,8 the touch is working fine.while coming to android 9 ,the touch on input is not generating any event ,and keyboard is not coming up.if , i am touching outside on screen anywhere first,then touching the input .it’s working fine .so, if anybody has faced this issue and solved.please suggest or any help will be appreciated.

thanking you,
Subodh kumar Rai

Posts: 1

Participants: 1

Read full topic

Ionic 4 Infinite scroll not showing

$
0
0

@jirikralovec wrote:

Hi all,
for some reason, my infinite scroll stopped working. When I pull the page, nothing is shown and event is not triggered. The odd thing is - the setup (the same setup) worked for me yesterday and I really don’t know what went wrong here :smile:

For testing purposes, I moved the login to app.component:

image

This is my Ionic project config:

I will appreciate any help as this is getting quite annoying…

Thanks!

Posts: 1

Participants: 1

Read full topic

Error in routing

$
0
0

@mavillavishnu wrote:

Hello all,
I am facing an error while routing inside my app.
The problem is this.
I have a tabs page and my app.routing code this:

const routes: Routes = [
  { path: '', loadChildren: './tabs/tabs.module#TabsPageModule' },
  { path: 'account', loadChildren: './account/account.module#AccountPageModule' },
];
@NgModule({
  imports: [
    RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
  ],
  exports: [RouterModule]
})

But when the app is initialized another page “signin.page” which is not declared in the routes is loading as home page. The signin.page is a modal page by the way.

Struck with this from yesterday

Please help!! Thaks in advance.

Posts: 1

Participants: 1

Read full topic

Ionic app continuously shows white screen on opening

$
0
0

@shree12 wrote:

I have developed one ionic app which works fine before June 15,2019. After that it continuously shows white screen after splash.Lazy loading is implemented in app.

I tried below steps for building apk

ionic cordova platform rm android
ionic cordova platform add android@8.0.0 
ionic cordova plugin add cordova-plugin-androidx 
ionic cordova plugin add cordova-plugin-androidx-adapter
cordova plugin add cordova-android-support-gradle-release --save

Terminal log of app on android studio is as below

07-26 12:12:45.241 19749-19799/io.ionic.starter E/libEGL:
validate_display:255 error 3008 (EGL_BAD_DISPLAY) 07-26 12:12:45.521
19749-19782/io.ionic.starter E/AndroidProtocolHandler: Unable to open
asset URL:
file:///android_asset/www/lib/ngCordova/dist/ng-cordova.min.js 07-26
12:12:45.536 19749-19804/io.ionic.starter E/AndroidProtocolHandler:
Unable to open asset URL:
file:///android_asset/www/lib/ion-autocomplete/dist/ion-autocomplete.js
07-26 12:12:45.536 19749-19804/io.ionic.starter
E/AndroidProtocolHandler: Unable to open asset URL:
file:///android_asset/www/lib/ion-autocomplete/dist/ion-autocomplete.css
07-26 12:12:45.541 19749-19782/io.ionic.starter
E/AndroidProtocolHandler: Unable to open asset URL:
file:///android_asset/www/js/Calendar.js 07-26 12:12:50.181
19749-19749/io.ionic.starter E/ViewRootImpl: sendUserActionEvent()
mView == null

Please help me

Posts: 1

Participants: 1

Read full topic

Cordova dev build - slow boot (15s)

$
0
0

@derceto wrote:

This Ionic 3 app (see package.json below) has been building properly so far. After having trouble with the IonicPro not redeploying my app, I decided to remove all Cordova integration and set it up from scratch (config.xml, package.json, node_modules, code references, folders, etc.)

What didn’t change:

  • building still works
  • The prod package is still starting very quickly - which is good (<3 seconds of splash screen, 20 page app, apk ~15MB).

What changed:

  • the dev .apk used to boot immediately after the splash screen displayed for ~3 seconds (which was good)
  • The dev .apk now shows a white screen for 10-15s after the spash screen is gone (splash screen lasts the same 3 seconds as before).

It’s dev, so it’s not a big deal - BUT that means I’m missing something that might be an issue later. Posting here with the hopes that anyone has faced this before…

What I’ve attempted so far with no improvement:

  • remove cordova fro project and start over, again.
  • followed some indications from the topic: Help with Ionic app Slow startup :
  • uninstall node.js, delete ~\AppData\Roaming\npm & npm-cache
  • reinstall node.js, ionic, cordova, native-run, etc.
  • remove node_modules & cordova again
  • re-try, no improvement.
  • create a new template project from scratch using CLI, dev build for android, adb deploy and it boots immediately after splash screen - no delay. It seems linked to my project and I’m 130% sure that a dev build used to boot immediately after the splash screen.

Connecting the debugger (chrome://inspect):

  • notice the long delay between keyboard.js was loaded and the next step. That’s where the “white screen” appears.
  • I notice now a warning about “inconsistent states” as being a potential issue. I’ve disregarded this since the prod build doesn’t have the issue.

What else should I try? Thanks in advance for your ideas :slight_smile:

config.xml


<?xml version='1.0' encoding='utf-8'?>
<widget id="..." version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Mood Companion</name>
    <description>...</description>
    <content src="index.html" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <preference name="phonegap-version" value="cli-8.0.0" />
    <preference name="orientation" value="portrait" />
    <preference name="ScrollEnabled" value="false" />
    <preference name="android-minSdkVersion" value="19" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="SplashMaintainAspectRatio" value="true" />
    <preference name="FadeSplashScreenDuration" value="300" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <preference name="SplashScreen" value="screen" />
    <preference name="SplashScreenDelay" value="3000" />
    <platform name="android">
        <allow-intent href="market:*" />
        ... icons & splash...
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
               ... icons & splash...
    </platform>
    <allow-navigation href="http://172.26.194.76:8100" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
    <plugin name="cordova-plugin-device" spec="^2.0.2" />
    <plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
    <plugin name="cordova-plugin-ionic-webview" spec="^2.0.3" />
    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.1.2" />
    <plugin name="cordova-plugin-statusbar" spec="^2.4.2" />
    <engine name="browser" spec="5.0.4" />
    <engine name="android" spec="7.0.0" />
    <engine name="ios" spec="4.5.5" />
</widget>

Package.json contents

  "dependencies": {
    "@angular/animations": "5.2.11",
    "@angular/cdk": "^5.1.0",
    "@angular/common": "5.2.11",
    "@angular/compiler": "5.2.11",
    "@angular/compiler-cli": "5.2.11",
    "@angular/core": "5.2.11",
    "@angular/fire": "^5.2.1",
    "@angular/flex-layout": "^5.0.0-beta.15",
    "@angular/forms": "5.2.11",
    "@angular/http": "5.2.11",
    "@angular/platform-browser": "5.2.11",
    "@angular/platform-browser-dynamic": "5.2.11",
    "@ionic-native/core": "~4.11.0",
    "@ionic-native/splash-screen": "~4.11.0",
    "@ionic-native/status-bar": "~4.11.0",
    "@ionic/pro": "^2.0.3",
    "@ionic/storage": "^2.2.0",
    "@ngrx/effects": "^5.2.0",
    "@ngrx/store": "^5.2.0",
    "@ngrx/store-devtools": "^5.2.0",
    "@types/cordova": "0.0.34",
    "cordova-android": "^8.0.0",
    "cordova-browser": "^6.0.0",
    "cordova-ios": "^5.0.1",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-file": "^6.0.2",
    "cordova-plugin-file-transfer": "^1.7.1",
    "cordova-plugin-ionic": "^5.3.1",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^2.5.1",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "firebase": "^6.2.4",
    "firebase-admin": "^8.2.0",
    "firebase-functions": "^3.1.0",
    "ionic-angular": "3.9.2",
    "ionic2-auto-complete": "^1.6.2-alpha",
    "ionicons": "3.0.0",
    "ng2-nvd3": "^2.0.0",
    "ngx-perfect-scrollbar": "^5.3.5",
    "rxjs": "6.2.0",
    "rxjs-compat": "6.2.0",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.1.11",
    "chalk": "^2.4.1",
    "gulp": "^3.9.1",
    "gulp-watch": "^5.0.0",
    "node-firestore-import-export": "^0.9.0",
    "redux-devtools-extension": "^2.13.2",
    "through2": "^2.0.3",
    "tslint": "^5.11.0",
    "typescript": "2.8.4"
  },
  "cordova": {
    "plugins": {
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-ionic": {},
      "cordova-plugin-whitelist": {}
    },
    "platforms": [
      "browser",
      "android",
      "ios"
    ]
  }

** ionic info **

Ionic:

   Ionic CLI          : 5.2.3 (C:\Users\jem\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.1.11

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.0.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 4 other plugins)

Utility:

   cordova-res : 0.6.0
   native-run  : 0.2.8

System:

   Android SDK Tools : 26.1.1 (C:\NVPACK\android-sdk-windows)
   NodeJS            : v10.16.0 (C:\Program Files\nodejs\node.exe)
   npm               : 6.9.0
   OS                : Windows 10

Posts: 1

Participants: 1

Read full topic


How to fix error ionic 4 Build failed 4 using code push

Difference between service and class

LocalNotifications trigger every day at certain time

$
0
0

@GeorgeDoit wrote:

Hello, get the input values from the user (hour and minute) and i want to trigger a notification everyday at the users input time.I run it on a real android device.Can you help?

I use timer for the users input

change(timer) {

let i = 1;

var hs = timer.time.slice(0, 2);
var mins = timer.time.slice(3, 5);.

//To make them number.
var hours = +hs;
var minutes = +mins;


var displayDate = new Date();
displayDate.setHours(hours);
displayDate.setMinutes(minutes);

if (timer.toggle === true) {

  this.localNotifications.schedule({

    id: i,
    title: 'Hey',
    text: "Time to train again!",

    trigger: { firstAt: displayDate, every: { hour: hours, minute: minutes } }
  });
}

i++;

}

With the code above the notification fires immediately.

Posts: 1

Participants: 1

Read full topic

Play video in video tag

$
0
0

@TaimoorMughal wrote:

Hi,

I am facing an issue that, i want to get video form gallery and play it in video tag,

<ion-content>
  <ion-button (click)="addVideo()">Play Video</ion-button>
<video controls autoplay #myvideo>
  </video>
 </ion-content>

I am getting video from camera plugin and error is that it isn’t working in video tag

  @ViewChild('myvideo') myVideo: any;

async addVideo(){

    const options: CameraOptions = {
      quality: 100,
      sourceType : this.camera.PictureSourceType.PHOTOLIBRARY,
      destinationType: this.camera.DestinationType.FILE_URI,
      encodingType: this.camera.EncodingType.JPEG,
      mediaType: this.camera.MediaType.VIDEO
    }

    this.camera.getPicture(options).then((imageData) => {

      let url = imageData;
      
      let video = this.myVideo.nativeElement;
      video.src = url;
      video.play();
    }, (err) => {
      alert(err)
      console.error(err);
    });

  }

Here is my complete code,

Thanks

Posts: 1

Participants: 1

Read full topic

How to select text in PDF files

$
0
0

@saltit wrote:

I have JSON + PDF files and created app with PDF files reading.
But I can’t make possible to select text in PDF files.
Any suggestions, how to select text in PDF files?

Posts: 1

Participants: 1

Read full topic

Viewing all 71526 articles
Browse latest View live


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