nativescript

How to access webpack environmental variables in nativescript?

戏子无情 提交于 2019-12-05 22:24:36
I want to store an environmental variable in webpack.config.js, that I will set when I bundle the app with webpack in Nativescript. The goal is to keep the environmental variable secret even after the bundle. How do I do that? I believe this should be possible, as described (but not detailed) here: https://docs.nativescript.org/performance-optimizations/bundling-with-webpack . But I am not able to get it to work in testing. I am new to webpack, so I may be missing something obvious. To keep it simple, I am going to call the variable 'simple_env_variable', and give it a value 'here_is_the_value

Nativescript scroll to bottom of ScrollView programmatically

冷暖自知 提交于 2019-12-05 22:14:46
In my Nativescript Angular application, I have a TextView within a ScrollView, defined as such: <ScrollView orientation="vertical" height="70%" width="100%" style="margin-bottom: 1%; background-color:white" (loaded)="onScrollerLoaded($event)"> <TextView id="terminal" [text]="terminalText" editable="false" style="color: whitesmoke; background-color: black; font-size: 8%; font-family: monospace" height="100%" (tap)="onTap($event)" (loaded)="onTerminalLoaded($event)"> </TextView> </ScrollView> The purpose of this element is to act as a terminal, and is rapidly printing incoming messages from a

Expected 2 arguments, but got 1.ts(2554) core.d.ts(8064, 47): An argument for 'opts' was not provided

南楼画角 提交于 2019-12-05 20:20:44
Error Expected 2 arguments, but got 1.ts(2554) core.d.ts(8064, 47): An argument for 'opts' was not provided. Code is from NativeScript Marketplace https://play.nativescript.org/?template=play-ng&id=Hqp5UQ&v=3073 I've brought the code over verbatim and I"m getting the errors in my export class on @ViewChild("password") password: ElementRef; @ViewChild("confirmPassword") confirmPassword: ElementRef; Does anyone know how to resolve this? import { Component, ElementRef, ViewChild } from "@angular/core"; import { alert, prompt } from "tns-core-modules/ui/dialogs"; import { Page } from "tns-core

How to use swift library in NativeScript?

丶灬走出姿态 提交于 2019-12-05 17:51:34
问题 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

Nativescript: How to use navigation in modals

拜拜、爱过 提交于 2019-12-05 16:22:18
I am creating a settings modal in my app, and I would like to be able to "navigate" to categories of settings within the modal. There are examples of this in apps, like Flipboard for example. If you open the settings, a modal opens, and you can tap a category. It navigates you to a new page (still within the modal), and you get a back button that will bring you back to the modal page. When you close the modal, your navigation stack is still valid, they seem to be two separate stacks. You can even navigate deeper, like open settings > Edit Profile > Change Email. You then can go back twice to

Nativescript + iOS webview + local files

痴心易碎 提交于 2019-12-05 14:11:50
I'm currently working in a simple app, which has a HTML section which uses a webview. The contents are in an app/www folder, and I access them from a "home.ts" component with something like this in the HTML <GridLayout class="main-layout" columns="*" rows="*" > <WebView src="~/www/index.html" class="web-view" col="0" id="wv" row="0" ></WebView> </GridLayout> This file uses a few images, some JS and some CSS. It works fine on Android, but I can't make it work on iOS. Oh, and it works fine on the iOS emulator, but not in an actual device (I currently have a iOS 9 iPod touch for testing these

Integrating nativescript-paytm plugin in nativescript-vue application

北城以北 提交于 2019-12-05 13:22:58
I'm having a nativescript-vue application where I want to integrate nativescript-paytm plugin, I created a method on click event: payNow() which contains all the necessary details of Paytm as described in Readme.md/documentation/demo app. import { Paytm, Order, TransactionCallback, IOSCallback } from "@nstudio/nativescript-paytm"; const paytm = new Paytm() methods: { payNow() { paytm.setIOSCallbacks({ didFinishedResponse: function(response) { console.log(response); }, didCancelTransaction: function() { console.log("User cancelled transaction"); }, errorMissingParameterError: function(error) {

Nativescript bare webview doesnt seem to work

一曲冷凌霜 提交于 2019-12-05 04:41:44
问题 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

Make a NativeScript ListView Transparent on iOS

允我心安 提交于 2019-12-05 04:27:47
I’m trying to get a NativeScript <ListView> to be transparent on iOS and I’m failing. I found an old thread on the topic at https://groups.google.com/forum/#!topic/nativescript/-MIWcQo-l6k , but when I try the solution it doesn’t work for me. Here’s my complete code: /* app.css */ Page { background-color: black; } <!-- main-page.xml --> <Page xmlns="http://schemas.nativescript.org/tns.xsd" loaded="loaded"> <ListView id="list-view" items="{{ items }}" itemLoading="itemLoading"> <ListView.itemTemplate> <Label text="{{ name }}" /> </ListView.itemTemplate> </ListView> </Page> // main-page.js var

repositories.cfg could not be loaded in Windows 10 [closed]

时间秒杀一切 提交于 2019-12-04 22:27:47
while installing native-script i got repositories.cfg could not be loaded error , please help me debugging it. It would help me if you can give the way to download the file externally. The code i used was..... @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString(' https://www.nativescript.org/setup/win '))" during installation it gets stuck saying c:\user\user-name.android\repositories.cfg cannot load file Try this: Error resolved by creating an empty repositories.cfg file. Reference 来源: https://stackoverflow.com/questions/47028626