mkdir nativescript-firebase
cd nativescript-firebase
npm init
tns init
mkdir -p platforms/ios
touch platforms/ios/Podfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Open your app's main js file and add this handler (delimited by 'START 3DTouch wiring' and 'END 3DTouch wiring'). | |
// Then tweak the handling of 'shortcutItem.type' to your liking (here I'm deeplinking 'compose' to the 'compose' page and ignore other shortcut types). | |
var application = require("application"); | |
application.cssFile = "./app.css"; | |
application.mainModule = "main-page"; | |
// START 3DTouch wiring | |
var MyDelegate = (function (_super) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.title { | |
font-size: 30; | |
horizontal-align: center; | |
margin:20; | |
} | |
button { | |
font-size: 42; | |
horizontal-align: center; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('sfViewCtrlDirective', []) | |
.directive('open', OpenDirective); | |
function OpenDirective() { | |
return { | |
restrict: 'A', | |
link: function($scope, $element, $attr) { | |
console.log('device is ready'); | |
$element.on('click', function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
When building with XCode 7 (iOS9 SDK), Apple restricts communication to SSL servers only. | |
See https://developer.apple.com/library/prerelease/ios/technotes/App-Transport-Security-Technote/ | |
You can override this if you need to. | |
If you know which servers your app talks to, look for 'NSExceptionDomains' on the page above. | |
But if you need to whitelist everything (not recommended) add this to your app's .plist: | |
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
navigator.camera.getPicture( | |
function(base64EncodedImg) { | |
// wrap in a timeout so the native view of SocialSharing doesn't collide with the one from the camera plugin | |
setTimeout(function() { | |
window.plugins.socialsharing.shareViaTwitter('Check my latest selfie. I\'m awesome!', 'data:image/jpg;base64,'+base64EncodedImg, null, null, null); | |
}, 500); | |
}, | |
function(msg) { | |
alert("Error: " + msg); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Run this in your Mac Terminal (assuming you have the Ionic CLI): | |
---------------------------------------------------------------- | |
ionic start wkwebviewpolyfilltest | |
cd wkwebviewpolyfilltest | |
ionic setup sass | |
ionic platform add ios | |
ionic plugin add https://github.com/EddyVerbruggen/cordova-plugin-wkwebview | |
ionic build | |
---------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// temp fix for iOS8 beta 1 (fixed in beta 2), add it after the reference to cordova.js | |
if (navigator.userAgent === undefined) { | |
navigator.__defineGetter__('userAgent', function() { | |
return("Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit"); | |
}); | |
} |
NewerOlder