ionic3

Using a third-party cordova plugin in Ionic 2 with TypeScript

旧城冷巷雨未停 提交于 2019-11-28 11:16:37
In my Ionic 2 app (TypeScript), where I use plugins, for example the Camera plugin from ionic-native which works fine. Now I want to use BackgroundMode plugin : https://github.com/katzer/cordova-plugin-background-mode . I read the README, I did the installation as described. Under Usage it says that the plugin can be used like this: cordova.plugins.backgroundMode.enable(); In my IDE (Atom), when I type that, it says it can't find cordova. I googled a lot about cordova plugins and Ionic 2 and in some cases they use navigator.somePlugin.someFunction() (the window.navigator object if I understand

Ionic-3 Can't find Pipe

半城伤御伤魂 提交于 2019-11-28 10:50:06
I have just upgraded to Ionic 3.0.1 so I can use LazyLoading , and since that I can't use my custom Pipes : import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'StripHTML' }) export class StripHTML implements PipeTransform { transform(value, args) { let striped = value.replace(/(<([^>]+)>)/g, ""); if (args != null) { if (args.split != null) { striped = striped.split(args.split); if (args.index != null) { striped = striped[args.index]; } } } return striped; } } and in app.module.ts I have added it to the declarations : @NgModule({ declarations: [ ........, StripHTML ], ... now

ionic cordova run android --prod not working [duplicate]

谁都会走 提交于 2019-11-28 10:30:24
问题 This question already has answers here : Page is part of the declarations of 2 modules: Error in ionic build prod (3 answers) Closed last year . when I try to run my app in a device by using --prod command I get this Error: ionic info: C:\Users\INPT1\Desktop\ionic3\myApp>ionic info cli packages: `(C:\Users\INPT1\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.5

IONIC 2 native Network.onDisconnect() running code twice

ぃ、小莉子 提交于 2019-11-28 10:27:41
i am working with ionic 2 RC1 and using sublime as text editor. i need to check if the network connection is connected or not. so for this purpose i am using ionic native Network for this purpose. but i am facing problem with the Network.onDisconnect() Observable. I have edited initializeApp() method in which i check for network connection and show alert if connection got disconnected. the I have the following code written in app.component.ts showAlert(title, msg) { let alert = this.alertCtrl.create({ title: title, subTitle: msg, buttons: ['OK'] }); alert.present(); } initializeApp() { this

IONIC 3 CORS ISSUE

痞子三分冷 提交于 2019-11-28 09:13:49
I am having a CORS issue with Ionic 3 when attempting to make GET calls to an API. I am using Ionic local server, running ionic serve in the command line for live server. Error No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access. I tried updating ionic.config.json with proxy setting but that does not seem to be working.. { "name": "projectLeagueApp", "app_id": "47182aef", "type": "ionic-angular", "integrations": { "cordova": {} }, "proxies": [ { "path":"/games", "proxyUrl": "https://api-2445582011268

Ionic - how to slide ion-segments?

荒凉一梦 提交于 2019-11-28 08:46:19
问题 How can I slide to switch segment like many apps in ionic? I can't find any api in ionic official documentation. I can only find this useful thread. But it does notseem perfect. Is there some better solution? ionic info: Cordova CLI: 6.5.0 Ionic CLI Version: 2.2.2 Ionic App Lib Version: 2.2.1 ios-deploy version: Not installed ios-sim version: Not installed OS: Windows 8.1 Node Version: v6.10.2 Xcode version: Not installed 回答1: Sliding segments or tabs have long been expected in ionic but it's

Ionic3 ionic native google maps doesn't show map but only google logo (display grey blank map )

寵の児 提交于 2019-11-28 08:10:33
问题 Update Thanks for the answer of wf9a5m75. I had a concept misunderststand on the API Keys. The Android and IOS API Key are generated from Google Cloud Platform Console (https://cloud.google.com/maps-platform/). I was using https://console.developers.google.com/ which is for Google Maps Javascript and that's why when I test the API Key on web application it works but not for mobiles. For anyone who follows the Ionic native google maps guide, use https://cloud.google.com/maps-platform to

Error: more than one library with package name com.google.android.gms.license

◇◆丶佛笑我妖孽 提交于 2019-11-28 08:08:01
When I try to run the command ionic cordova build android out error as title above. Then I try to remove one of the gms , when I build again the deleted it appears again. how to solve this?. Here is my dependencies of my build.gradle : dependencies { compile fileTree(dir: 'libs', include: '*.jar') // SUB-PROJECT DEPENDENCIES START debugCompile(project(path: "CordovaLib", configuration: "debug")) releaseCompile(project(path: "CordovaLib", configuration: "release")) compile "com.google.android.gms:play-services-auth:+" // i remove this compile "com.google.android.gms:play-services-identity:+"

Ionic 3 refresh side menu after login

不羁岁月 提交于 2019-11-28 07:41:56
I need to display side menu items according to the role of the user. so I check in app.html if the page (role) is equal to logged in role. But it does not display items inside menu just after login but after refreshing the app using browser refresh button it displays correct items as it should. I guess the problem is ionic is caching the menu view if it is so how can I refresh the app for new menu items to display. Every time I login with another user/role, it displays menu according to the previous user/role. app.component.ts constructor() { this.initializeApp(); this.pages = [ { title: 'Home

How to resolve app validation “The app references non-public selectors in Payload/MyApp.app/MyApp: _setAlwaysRunsAtForegroundPriority:”?

被刻印的时光 ゝ 提交于 2019-11-28 07:33:10
Just days ago I successfully upload Ionic app to Apple Store, and on this day I am receiving validation warning: The app references non-public selectors in Payload/something.app/something: _setAlwaysRunsAtForegroundPriority: While I was unable to resolve, I was able to upload app to App Store. Does anyone know where it is documented or have any insights on how to resolve? Thanks. Expanding on @Véger Lóránd answer: The bug was re-introduced in the 4.1.1 version. Installing the latest version will get your app rejected. The solution for now is: cordova plugin rm cordova-plugin-ionic-webview