Skip to content

Instantly share code, notes, and snippets.

View jbristowe's full-sized avatar
👨‍💻
"It's complicated."

John Bristowe jbristowe

👨‍💻
"It's complicated."
View GitHub Profile
var listener = new Listener("NativeScript Rocks!!11!");
trace.addEventListener(listener);
var context = new LAContext();
try {
if (context.canEvaluatePolicyError(LAPolicy.LAPolicyDeviceOwnerAuthenticationWithBiometrics)) {
context.evaluatePolicyLocalizedReasonReply(LAPolicy.LAPolicyDeviceOwnerAuthenticationWithBiometrics,
"Are you the device owner?",
function (success, error) {
if (error) {
// error; problem verifying identity
return;
}

A Very Rough Guide to Firebase and NativeScript

Create Plugin

  • mkdir nativescript-firebase
  • cd nativescript-firebase
  • npm init
  • tns init
  • mkdir -p platforms/ios
  • touch platforms/ios/Podfile

NativeScript LiveSync with Console Output with iOS Simulator

NativeScript LiveSync does not currently emit console output (via console.log()) via the CLI:

$ tns livesync ios --emulator —watch

There's a couple of ways to make this work. In both cases, you'll need the hash for the iOS simulator/device you're targeting:

$ instruments -s devices

How To: Wrap Text in a Button with NativeScript

It's pretty simple. Let's assume the following element in your markup:

<Button text="Hello! Is it me you're looking for?" id="wrapButton" />

By default, Android and iOS truncate the text. You can override this behaviour with the following code:

Keybase proof

I hereby claim:

  • I am jbristowe on github.
  • I am jbristowe (https://keybase.io/jbristowe) on keybase.
  • I have a public key whose fingerprint is A984 A74D 2CF8 06C9 6D30 1FB4 BEA2 A05C 081D F043

To claim this, I am signing this object:

{
"version": "npm run release",
"preversion": "npm test",
"postversion": "git push && git push --tags",
"clean": "npm-run-all -p clean:*",
"clean:build": "rimraf build",
"clean:dist": "rimraf dist",
"clean:release": "rimraf release",
"build": "webpack --display-error-details",
"build:release": "cross-env NODE_ENV=production npm run build",