ionic-framework

Parse.com push notifications not shown in background on android

落爺英雄遲暮 提交于 2020-01-02 10:25:20
问题 I'm using Parse.com with an Ionic app and the PushPlugin and trying to implement Parse's Push Notifications through GCM with a custom Sender ID. When I'm sending a message to all devices, or using the REST API with cURL, iOS notifications trigger fine when the app is in the background but android notifications are not. Here's what I tried with the rest API First for iOS, which is working well: curl -X POST \ -H "X-Parse-Application-Id: APP-ID" \ -H "X-Parse-REST-API-Key: API-KEY" \ -H

Ionic prevent exit app on hardware back button

戏子无情 提交于 2020-01-02 10:23:31
问题 I am using ionic to develop hybrid app. But recently I found that whenever I click on the hardware back button, the app will exit no matter on which page. I tried to add the following code, it does shows the alert box but this doesn't stop the app from exit (alert box is not clicked). $ionicPlatform.onHardwareBackButton(function() { alert("click on hardware back button"); } How can I prevent the app from exit from hardware back button? 回答1: Normally the apps exists when you're on a root view

External images in the Ionic default tab template won’t load in the emulator and on the device

▼魔方 西西 提交于 2020-01-02 09:59:36
问题 The tab app template in Ionic contains a few external images, and they won't load when I open the app in my Android emulator or my Nexus 5. Both the device and the emulatir do have internet connection and I can load these images manually in the browser. It works OK in the browser (ionic serve). That is: ionic start myApp tabs cd myApp ionic serve # OK ionic platform add android ionic build android ionic emulate android # Images are not loaded ionic run android # Images are not loaded ionic

Embedding an Iframe having CSP 2.0 in a mobile app: “frame-ancestors” issue

蓝咒 提交于 2020-01-02 08:54:11
问题 Building an hybrid app with the Ionic framework, I need to embed to one of my page an Iframe. My problem is that the page loaded with the iframe does have the following CSP: "frame-ancestors http://foo.somedomain.com" Which works just fine on my browser. However whenever I try this on the application itself the content is not loaded due to: Refused to display 'http://foo.somedomain.com' in a frame because an ancestor violates the following Content Security Policy directive "frame-ancestors

Typescript Angular2 errors when returning a promise and creating an observable from it

房东的猫 提交于 2020-01-02 08:18:47
问题 I am attempting to retrieve a token from ionics storage in getToken() and than use it in refreshToken() to see if the token is expired by passing it to (this.jwtHelper.isTokenExpired(this.token) which returns a true or false depending on if the token is expired or not. I have put comments in refreshToken() where I am getting the following errors Error 1: Error: TS2345:Argument of type '(response: Response) => void' is not assignable to parameter of type '(value: Response) => void'. Types of

How to create ionic apps using visual studio 2013 Community?

被刻印的时光 ゝ 提交于 2020-01-02 07:53:13
问题 Is there a tutorial on how to build ionic apps on visual studio? Have anyone used ionic templates in VS? When I try to open this template, I'm getting this error: This extension is not installable on any of the currently installed products. If I download and install through VS 2013 Community templates (in new project dialogue) I get this error after creating the project: The imported (CordovaTools) project was not found Question: How can I get those .targets files here which could not be

Ionic pro - Build AND Publish to Apple Store

岁酱吖の 提交于 2020-01-02 07:35:13
问题 I have a Apple Developer account, BUT I don't have a Mac, and I need to do the following with my Ionic project: Package a native Ionic iOS app AND Publish it to the Apple Store. I've read about the limitations to compiling and publishing an iOS app in the Apple Store without a Mac, but I am in doubt about the Ionic pro. There says that Ionic pro can 'Package native app builds in the cloud' , but does this mean that I can publish the generated cloud Package from Ionic Pro directly to the Apple

How to programmatically enable and disable GPS in Ionic Framework or Cordova

天大地大妈咪最大 提交于 2020-01-02 06:42:20
问题 My problem is simple. I need a way to turn on and off GPS using a button inside an Ionic app. I've check the docs and read this ng-cordova plugin http://ngcordova.com/docs/plugins/geolocation/ but they don't seem have this funcction. Am I just missing something or is this even possible in Ionic Framework? Thanks! 回答1: As far as I'm aware there isn't the ability to directly disable GPS from your app. If you are trying to allow the user to disable GPS, I achieved this by adding a setting to

Ionic 3 - I want a modal screen not full size

烈酒焚心 提交于 2020-01-02 05:46:12
问题 I need a modal page with no full size (80% width, <60% height, centered) to select some items, like an alert control. How to implement the CSS for this case? 回答1: Initialize modal with cssClass let modal = this.modalCtrl.create(CustomSelectPage, {data: data}, {cssClass: 'select-modal' }); Then add CSS to the class in app.scss .select-modal { background: rgba(0, 0, 0, 0.5) !important; padding: 20% 10% !important; } Change the numbers according to your design. 来源: https://stackoverflow.com

Smart Watch (Android & Apple) integration in Ionic Framework

僤鯓⒐⒋嵵緔 提交于 2020-01-02 05:39:06
问题 I am working on Ionic Framework from couple of months, I also checked out new Ionic version out 1.0.1. Actually I post this question regarding creating smart watch application in ionic framework. Until now I Google and I just found this cordova plugin which interact with Apple watch https://github.com/20steps/cordova-plugin-watch. This is only support for iOs. There are several cordova plugin available but I did't find any relevant answer or tutorial or blog using which I can learn smart