nativescript

NativeScript: How do I disble zoom controls in WebView?

微笑、不失礼 提交于 2019-12-04 19:57:16
I found the way to enable/disable zoom controls in Android WebView from following question. How to remove zoom buttons on Android webview? I'm using NativeScript and I don't see similar method in NativeScript WebView. Is there any way I can access the methods of Android WebView from NativeScript? Or, is there any other way? Thanks. You can get hold of the actual android trough the android property of your WebView. So you can probably use something like that in the loaded event: var webView = page.getViewById("webViewID"); if(webView.android) { // in IOS android will be undefined webView

Nativescript webview and android back button

倖福魔咒の 提交于 2019-12-04 10:45:20
I have a made a page in nativescript that only containes a webview. Here is my code: <Page xmlns="http://www.nativescript.org/tns.xsd" actionBarHidden="true"> <WebView src="http://example.com/" /> </Page> And here is the JS: import * as webViewModule from "tns-core-modules/ui/web-view"; let webView = new webViewModule.WebView(); webView.on(webViewModule.WebView.loadFinishedEvent, function (args: webViewModule.LoadEventData) { let message; if (!args.error) { message = "WebView finished loading " + args.url; } else { message = "Error loading " + args.url + ": " + args.error; } }); webView.src =

How to set orientation in nativescript

核能气质少年 提交于 2019-12-04 10:22:58
问题 Hello I would like to know how to set device orientation in nativescript. Specifically I want the application that I am writing to stay in the same orientation (portrait) at all times so that rotating the device does not cause it to go into landscape. I tried the nativescript-orientation plugin and setOrientation. var orientation = require('nativescript-orientation'); console.log(JSON.stringify(orientation));// outputs JS: {} orientation.setOrientation("portrait"); However I get the error

Nativecript Fontawesome 5 iphone not working

老子叫甜甜 提交于 2019-12-04 05:56:54
问题 I'm trying to get Font Awesome 5 to work on android but it's not working. Using the https://github.com/NathanWalker/nativescript-ngx-fonticon package. My folder structure - src -- assets -- fonts -- app The assets folder contains the fontawesome css (font-awesome.css), I've removed everything above the "Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen readers do not read off random characters that represent icons" remark. The fonts folder contains all the fontfiles (eot /

How to build NativeScript project for IOS on Windows?

你。 提交于 2019-12-04 05:20:28
Please dont tell me about the licence issue. I just want to be able to test my code in both environements (Android/IOS) at the same time. I am not interested in the Virtualisation of IOS because its very slow. As XCode can't be run on Windows and you don't want to virtualize, you have one option left, you can let someone else do the builds for you. For NativeScript, you can get a seamless experience with the Telerik Platform: http://www.telerik.com/platform#overview There are of course many other mac cloud services (such as CloudBees, MacinCloud, MacBuildServer, Unity Cloud and many others).

How to use swift library in NativeScript?

妖精的绣舞 提交于 2019-12-04 02:18:09
I am trying to use this ios-charts library in NativeScript. This library is written in Swift and not in Objective-C. Can I use it? I have tried to use it but it is giving me an error. I have used it in following steps: For which I have added library in my nativescript project using tns library add ios 'library_path' The library gets added. Then I prepared project for ios platform using tns prepare ios To test if library is added successfully, I build the project in Xcode , it builds successfully, but then I get the following error during runtime. dyld: Library not loaded: @rpath/libswiftCore

How can I specify or get the resource id of a nativescript textfield

亡梦爱人 提交于 2019-12-04 01:53:53
We are using nativescript with angular for our mobile app. I want to use the Google Play pre-launch report feature, but our app requires a password to be entered. Google Play allows specifying a password but you need a resource name so the testing script can identify where to put the password. How can I specify or receive the resource name of a nativescript textfield, either in the view or by code behind or via any other means? The view in question: <StackLayout class="form"> <GridLayout columns="*,90" rows="50"> <TextField #inviteTx col="0" height="50" autocorrect="false" returnKeyType="next"

Nativescript bare webview doesnt seem to work

情到浓时终转凉″ 提交于 2019-12-03 20:58:55
i recently got into nativescript, and i'm facing a problem that i cant seem to work around it. What i want to accomplish is to just open a basic WebView and set an external url to load such as stackoverflow.com. I'm running this on emulator with Android api 17 app.js var application = require("application"); application.mainModule = "main-page"; application.cssFile = "./app.css"; application.start(); main-page.js var vmModule = require("./main-view-model"); var webViewModule = require("ui/web-view"); var webView = new webViewModule.WebView(); function pageLoaded(args) { var page = args.object;

How to access Google Play Services in NativeScript

心已入冬 提交于 2019-12-03 08:43:28
I am currently starting with NativeScript. I am trying to include certain Google Play Services to the android project. I put the relevant .aar files into the node_modules/ folder of my app project and built it. I can see they are successfully added to the project. :config phase: copyAarDependencies :config phase: addAarDependencies +adding dependency: C:\Users\pstueven\NativeScript\sample-Groceries\platforms\android\libs\aar\play-services-9.0.0.aar +adding dependency: C:\Users\pstueven\NativeScript\sample-Groceries\platforms\android\libs\aar\play-services-base-9.0.0.aar +adding dependency: C:

aws-amplify subscription to appsync stops after 2 mins

一世执手 提交于 2019-12-03 08:27:07
When subscribing to appsync using amplify using API.graphql(graphqlOperation(subscription)); the subscription works for a while, but the I get socket closed error. CONSOLE LOG [native code]: { "[INFO] 24:12.893 MqttOverWSProvider": { "errorCode": 8, "errorMessage": "AMQJS0008I Socket closed.", "uri": "wss://<uri> The same subscription works in the appsync console without any issue and I get events as long as the subscription is running, but stops after around 2 mins on device. code involved let cs = await this.subscriptionService.appSubscriptions(); this.sbscriptions = this.cs.subscribe({ next