diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000..946c963
Binary files /dev/null and b/.DS_Store differ
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..877596c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,10 @@
+*.js
+*.js.map
+*.log
+!scripts/*.js
+demo/app/*.js
+demo/*.d.ts
+demo/lib
+demo/platforms
+demo/node_modules
+node_modules
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..abaa5de
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/nativescript-background-gps.iml b/.idea/nativescript-background-gps.iml
new file mode 100644
index 0000000..30092a4
--- /dev/null
+++ b/.idea/nativescript-background-gps.iml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/scopes/_N_Project.xml b/.idea/scopes/_N_Project.xml
new file mode 100644
index 0000000..6185494
--- /dev/null
+++ b/.idea/scopes/_N_Project.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..58fc9a7
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,542 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ DEFINITION_ORDER
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ project
+
+
+ true
+
+
+
+ DIRECTORY
+
+ false
+
+
+
+
+
+
+
+
+
+ 1475273869532
+
+
+ 1475273869532
+
+
+
+ 1475274374553
+
+
+
+ 1475274374553
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.npmignore b/.npmignore
new file mode 100644
index 0000000..d6cd938
--- /dev/null
+++ b/.npmignore
@@ -0,0 +1,6 @@
+demo/
+*.png
+*.log
+*.map
+*.ts
+!*.d.ts
diff --git a/LICENSE b/LICENSE
index 46f35a4..ba331f8 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,21 +1,21 @@
-MIT License
+The MIT License (MIT)
-Copyright (c) 2016 Nick Coury
+nativescript-background-gps
+Copyright (c) 2016, Nick Coury
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..405c163
--- /dev/null
+++ b/README.md
@@ -0,0 +1,15 @@
+# Nativescript Background GPS Plugin
+
+This is a plugin to receive gps location updates regardless of the app state.
+
+## Getting started
+
+1. `tns plugin add nativescript-background-gps`
+
+## Usage
+
+`import { gps } from 'nativescript-background-gps';`
+
+`gps.on(function (location) {
+ console.log(location);
+}`
diff --git a/demo/app/App_Resources/Android/AndroidManifest.xml b/demo/app/App_Resources/Android/AndroidManifest.xml
new file mode 100644
index 0000000..9db8321
--- /dev/null
+++ b/demo/app/App_Resources/Android/AndroidManifest.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/demo/app/App_Resources/Android/app.gradle b/demo/app/App_Resources/Android/app.gradle
new file mode 100644
index 0000000..51f7531
--- /dev/null
+++ b/demo/app/App_Resources/Android/app.gradle
@@ -0,0 +1,16 @@
+// Add your native dependencies here:
+
+// Uncomment to add recyclerview-v7 dependency
+//dependencies {
+// compile 'com.android.support:recyclerview-v7:+'
+//}
+
+android {
+ defaultConfig {
+ generatedDensities = []
+ applicationId = "org.nativescript.starter"
+ }
+ aaptOptions {
+ additionalParameters "--no-version-vectors"
+ }
+}
diff --git a/demo/app/App_Resources/Android/drawable-hdpi/background.png b/demo/app/App_Resources/Android/drawable-hdpi/background.png
new file mode 100644
index 0000000..eb381c2
Binary files /dev/null and b/demo/app/App_Resources/Android/drawable-hdpi/background.png differ
diff --git a/demo/app/App_Resources/Android/drawable-hdpi/icon.png b/demo/app/App_Resources/Android/drawable-hdpi/icon.png
new file mode 100755
index 0000000..1034356
Binary files /dev/null and b/demo/app/App_Resources/Android/drawable-hdpi/icon.png differ
diff --git a/demo/app/App_Resources/Android/drawable-hdpi/logo.png b/demo/app/App_Resources/Android/drawable-hdpi/logo.png
new file mode 100644
index 0000000..5218f4c
Binary files /dev/null and b/demo/app/App_Resources/Android/drawable-hdpi/logo.png differ
diff --git a/demo/app/App_Resources/Android/drawable-ldpi/background.png b/demo/app/App_Resources/Android/drawable-ldpi/background.png
new file mode 100644
index 0000000..748b2ad
Binary files /dev/null and b/demo/app/App_Resources/Android/drawable-ldpi/background.png differ
diff --git a/demo/app/App_Resources/Android/drawable-ldpi/icon.png b/demo/app/App_Resources/Android/drawable-ldpi/icon.png
new file mode 100755
index 0000000..ddfc17a
Binary files /dev/null and b/demo/app/App_Resources/Android/drawable-ldpi/icon.png differ
diff --git a/demo/app/App_Resources/Android/drawable-ldpi/logo.png b/demo/app/App_Resources/Android/drawable-ldpi/logo.png
new file mode 100644
index 0000000..b9e102a
Binary files /dev/null and b/demo/app/App_Resources/Android/drawable-ldpi/logo.png differ
diff --git a/demo/app/App_Resources/Android/drawable-mdpi/background.png b/demo/app/App_Resources/Android/drawable-mdpi/background.png
new file mode 100644
index 0000000..efeaf29
Binary files /dev/null and b/demo/app/App_Resources/Android/drawable-mdpi/background.png differ
diff --git a/demo/app/App_Resources/Android/drawable-mdpi/icon.png b/demo/app/App_Resources/Android/drawable-mdpi/icon.png
new file mode 100755
index 0000000..486e410
Binary files /dev/null and b/demo/app/App_Resources/Android/drawable-mdpi/icon.png differ
diff --git a/demo/app/App_Resources/Android/drawable-mdpi/logo.png b/demo/app/App_Resources/Android/drawable-mdpi/logo.png
new file mode 100644
index 0000000..6263387
Binary files /dev/null and b/demo/app/App_Resources/Android/drawable-mdpi/logo.png differ
diff --git a/demo/app/App_Resources/Android/drawable-nodpi/splash_screen.xml b/demo/app/App_Resources/Android/drawable-nodpi/splash_screen.xml
new file mode 100644
index 0000000..ada77f9
--- /dev/null
+++ b/demo/app/App_Resources/Android/drawable-nodpi/splash_screen.xml
@@ -0,0 +1,8 @@
+
+ -
+
+
+ -
+
+
+
\ No newline at end of file
diff --git a/demo/app/App_Resources/Android/drawable-xhdpi/background.png b/demo/app/App_Resources/Android/drawable-xhdpi/background.png
new file mode 100644
index 0000000..612bbd0
Binary files /dev/null and b/demo/app/App_Resources/Android/drawable-xhdpi/background.png differ
diff --git a/demo/app/App_Resources/Android/drawable-xhdpi/icon.png b/demo/app/App_Resources/Android/drawable-xhdpi/icon.png
new file mode 100644
index 0000000..f291882
Binary files /dev/null and b/demo/app/App_Resources/Android/drawable-xhdpi/icon.png differ
diff --git a/demo/app/App_Resources/Android/drawable-xhdpi/logo.png b/demo/app/App_Resources/Android/drawable-xhdpi/logo.png
new file mode 100644
index 0000000..ad8ee2f
Binary files /dev/null and b/demo/app/App_Resources/Android/drawable-xhdpi/logo.png differ
diff --git a/demo/app/App_Resources/Android/drawable-xxhdpi/background.png b/demo/app/App_Resources/Android/drawable-xxhdpi/background.png
new file mode 100644
index 0000000..0fa88e2
Binary files /dev/null and b/demo/app/App_Resources/Android/drawable-xxhdpi/background.png differ
diff --git a/demo/app/App_Resources/Android/drawable-xxhdpi/icon.png b/demo/app/App_Resources/Android/drawable-xxhdpi/icon.png
new file mode 100644
index 0000000..4f69cb2
Binary files /dev/null and b/demo/app/App_Resources/Android/drawable-xxhdpi/icon.png differ
diff --git a/demo/app/App_Resources/Android/drawable-xxhdpi/logo.png b/demo/app/App_Resources/Android/drawable-xxhdpi/logo.png
new file mode 100644
index 0000000..6683278
Binary files /dev/null and b/demo/app/App_Resources/Android/drawable-xxhdpi/logo.png differ
diff --git a/demo/app/App_Resources/Android/drawable-xxxhdpi/background.png b/demo/app/App_Resources/Android/drawable-xxxhdpi/background.png
new file mode 100644
index 0000000..c650f64
Binary files /dev/null and b/demo/app/App_Resources/Android/drawable-xxxhdpi/background.png differ
diff --git a/demo/app/App_Resources/Android/drawable-xxxhdpi/icon.png b/demo/app/App_Resources/Android/drawable-xxxhdpi/icon.png
new file mode 100644
index 0000000..50887a8
Binary files /dev/null and b/demo/app/App_Resources/Android/drawable-xxxhdpi/icon.png differ
diff --git a/demo/app/App_Resources/Android/drawable-xxxhdpi/logo.png b/demo/app/App_Resources/Android/drawable-xxxhdpi/logo.png
new file mode 100644
index 0000000..fa6331c
Binary files /dev/null and b/demo/app/App_Resources/Android/drawable-xxxhdpi/logo.png differ
diff --git a/demo/app/App_Resources/Android/values-v21/colors.xml b/demo/app/App_Resources/Android/values-v21/colors.xml
new file mode 100644
index 0000000..a64641a
--- /dev/null
+++ b/demo/app/App_Resources/Android/values-v21/colors.xml
@@ -0,0 +1,4 @@
+
+
+ #3d5afe
+
\ No newline at end of file
diff --git a/demo/app/App_Resources/Android/values-v21/styles.xml b/demo/app/App_Resources/Android/values-v21/styles.xml
new file mode 100644
index 0000000..dac8727
--- /dev/null
+++ b/demo/app/App_Resources/Android/values-v21/styles.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/app/App_Resources/Android/values/colors.xml b/demo/app/App_Resources/Android/values/colors.xml
new file mode 100644
index 0000000..74ad882
--- /dev/null
+++ b/demo/app/App_Resources/Android/values/colors.xml
@@ -0,0 +1,7 @@
+
+
+ #F5F5F5
+ #757575
+ #33B5E5
+ #272734
+
\ No newline at end of file
diff --git a/demo/app/App_Resources/Android/values/styles.xml b/demo/app/App_Resources/Android/values/styles.xml
new file mode 100644
index 0000000..1e8c7f2
--- /dev/null
+++ b/demo/app/App_Resources/Android/values/styles.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 0000000..5f53593
--- /dev/null
+++ b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,128 @@
+{
+ "images" : [
+ {
+ "size" : "29x29",
+ "idiom" : "iphone",
+ "filename" : "icon-29.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "iphone",
+ "filename" : "icon-29@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "iphone",
+ "filename" : "icon-29@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "iphone",
+ "filename" : "icon-40@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "iphone",
+ "filename" : "icon-40@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "57x57",
+ "idiom" : "iphone",
+ "filename" : "icon-57.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "57x57",
+ "idiom" : "iphone",
+ "filename" : "icon-57@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "60x60",
+ "idiom" : "iphone",
+ "filename" : "icon-60@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "60x60",
+ "idiom" : "iphone",
+ "filename" : "icon-60@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "ipad",
+ "filename" : "icon-29.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "ipad",
+ "filename" : "icon-29@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "ipad",
+ "filename" : "icon-40.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "ipad",
+ "filename" : "icon-40@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "50x50",
+ "idiom" : "ipad",
+ "filename" : "icon-50.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "50x50",
+ "idiom" : "ipad",
+ "filename" : "icon-50@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "72x72",
+ "idiom" : "ipad",
+ "filename" : "icon-72.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "72x72",
+ "idiom" : "ipad",
+ "filename" : "icon-72@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "76x76",
+ "idiom" : "ipad",
+ "filename" : "icon-76.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "76x76",
+ "idiom" : "ipad",
+ "filename" : "icon-76@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "83.5x83.5",
+ "idiom" : "ipad",
+ "filename" : "icon-83.5@2x.png",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png
new file mode 100644
index 0000000..9e15af0
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png
new file mode 100644
index 0000000..7b9e555
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png
new file mode 100644
index 0000000..76f61ec
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png
new file mode 100644
index 0000000..15b06db
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png
new file mode 100644
index 0000000..585065f
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png
new file mode 100644
index 0000000..a450c42
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png
new file mode 100755
index 0000000..4a62478
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png
new file mode 100755
index 0000000..01ff7c1
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png
new file mode 100755
index 0000000..beea819
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png
new file mode 100755
index 0000000..c3dc7b0
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png
new file mode 100644
index 0000000..457b6d9
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png
new file mode 100644
index 0000000..fa5a6ac
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png
new file mode 100755
index 0000000..556bdd6
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png
new file mode 100755
index 0000000..4f69cb2
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png
new file mode 100644
index 0000000..94abcf7
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png
new file mode 100644
index 0000000..2e71dd3
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png
new file mode 100644
index 0000000..4abc9ec
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/Contents.json b/demo/app/App_Resources/iOS/Assets.xcassets/Contents.json
new file mode 100644
index 0000000..da4a164
--- /dev/null
+++ b/demo/app/App_Resources/iOS/Assets.xcassets/Contents.json
@@ -0,0 +1,6 @@
+{
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json
new file mode 100644
index 0000000..4414bad
--- /dev/null
+++ b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json
@@ -0,0 +1,158 @@
+{
+ "images" : [
+ {
+ "extent" : "full-screen",
+ "idiom" : "iphone",
+ "subtype" : "736h",
+ "filename" : "Default-736h@3x.png",
+ "minimum-system-version" : "8.0",
+ "orientation" : "portrait",
+ "scale" : "3x"
+ },
+ {
+ "extent" : "full-screen",
+ "idiom" : "iphone",
+ "subtype" : "736h",
+ "filename" : "Default-Landscape@3x.png",
+ "minimum-system-version" : "8.0",
+ "orientation" : "landscape",
+ "scale" : "3x"
+ },
+ {
+ "extent" : "full-screen",
+ "idiom" : "iphone",
+ "subtype" : "667h",
+ "filename" : "Default-667h@2x.png",
+ "minimum-system-version" : "8.0",
+ "orientation" : "portrait",
+ "scale" : "2x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "iphone",
+ "filename" : "Default@2x.png",
+ "extent" : "full-screen",
+ "minimum-system-version" : "7.0",
+ "scale" : "2x"
+ },
+ {
+ "extent" : "full-screen",
+ "idiom" : "iphone",
+ "subtype" : "retina4",
+ "filename" : "Default-568h@2x.png",
+ "minimum-system-version" : "7.0",
+ "orientation" : "portrait",
+ "scale" : "2x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "ipad",
+ "filename" : "Default-Portrait.png",
+ "extent" : "full-screen",
+ "minimum-system-version" : "7.0",
+ "scale" : "1x"
+ },
+ {
+ "orientation" : "landscape",
+ "idiom" : "ipad",
+ "filename" : "Default-Landscape.png",
+ "extent" : "full-screen",
+ "minimum-system-version" : "7.0",
+ "scale" : "1x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "ipad",
+ "filename" : "Default-Portrait@2x.png",
+ "extent" : "full-screen",
+ "minimum-system-version" : "7.0",
+ "scale" : "2x"
+ },
+ {
+ "orientation" : "landscape",
+ "idiom" : "ipad",
+ "filename" : "Default-Landscape@2x.png",
+ "extent" : "full-screen",
+ "minimum-system-version" : "7.0",
+ "scale" : "2x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "iphone",
+ "filename" : "Default.png",
+ "extent" : "full-screen",
+ "scale" : "1x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "iphone",
+ "filename" : "Default@2x.png",
+ "extent" : "full-screen",
+ "scale" : "2x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "iphone",
+ "filename" : "Default-568h@2x.png",
+ "extent" : "full-screen",
+ "subtype" : "retina4",
+ "scale" : "2x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "ipad",
+ "extent" : "to-status-bar",
+ "scale" : "1x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "ipad",
+ "filename" : "Default-Portrait.png",
+ "extent" : "full-screen",
+ "scale" : "1x"
+ },
+ {
+ "orientation" : "landscape",
+ "idiom" : "ipad",
+ "extent" : "to-status-bar",
+ "scale" : "1x"
+ },
+ {
+ "orientation" : "landscape",
+ "idiom" : "ipad",
+ "filename" : "Default-Landscape.png",
+ "extent" : "full-screen",
+ "scale" : "1x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "ipad",
+ "extent" : "to-status-bar",
+ "scale" : "2x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "ipad",
+ "filename" : "Default-Portrait@2x.png",
+ "extent" : "full-screen",
+ "scale" : "2x"
+ },
+ {
+ "orientation" : "landscape",
+ "idiom" : "ipad",
+ "extent" : "to-status-bar",
+ "scale" : "2x"
+ },
+ {
+ "orientation" : "landscape",
+ "idiom" : "ipad",
+ "filename" : "Default-Landscape@2x.png",
+ "extent" : "full-screen",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png
new file mode 100644
index 0000000..d7f17fc
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png
new file mode 100644
index 0000000..b884154
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png
new file mode 100644
index 0000000..faab4b6
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png
new file mode 100644
index 0000000..3365ba3
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png
new file mode 100644
index 0000000..a44945c
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png
new file mode 100644
index 0000000..e6dca62
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png
new file mode 100644
index 0000000..1a50079
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png
new file mode 100644
index 0000000..73d8b92
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png
new file mode 100644
index 0000000..9f1f6ce
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png
new file mode 100644
index 0000000..514fc5c
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json
new file mode 100644
index 0000000..4f4e9c5
--- /dev/null
+++ b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json
@@ -0,0 +1,22 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "filename" : "LaunchScreen-AspectFill.png",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "filename" : "LaunchScreen-AspectFill@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png
new file mode 100644
index 0000000..c293f9c
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png
new file mode 100644
index 0000000..233693a
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json
new file mode 100644
index 0000000..23c0ffd
--- /dev/null
+++ b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json
@@ -0,0 +1,22 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "filename" : "LaunchScreen-Center.png",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "filename" : "LaunchScreen-Center@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png
new file mode 100644
index 0000000..a5a775a
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png differ
diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png
new file mode 100644
index 0000000..154c193
Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png differ
diff --git a/demo/app/App_Resources/iOS/Info.plist b/demo/app/App_Resources/iOS/Info.plist
new file mode 100644
index 0000000..ea3e3ea
--- /dev/null
+++ b/demo/app/App_Resources/iOS/Info.plist
@@ -0,0 +1,47 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ en
+ CFBundleDisplayName
+ ${PRODUCT_NAME}
+ CFBundleExecutable
+ ${EXECUTABLE_NAME}
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ ${PRODUCT_NAME}
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ 1.0
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ 1.0
+ LSRequiresIPhoneOS
+
+ UILaunchStoryboardName
+ LaunchScreen
+ UIRequiresFullScreen
+
+ UIRequiredDeviceCapabilities
+
+ armv7
+
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ UISupportedInterfaceOrientations~ipad
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationPortraitUpsideDown
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+
+
diff --git a/demo/app/App_Resources/iOS/LaunchScreen.storyboard b/demo/app/App_Resources/iOS/LaunchScreen.storyboard
new file mode 100644
index 0000000..2ad9471
--- /dev/null
+++ b/demo/app/App_Resources/iOS/LaunchScreen.storyboard
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/demo/app/App_Resources/iOS/build.xcconfig b/demo/app/App_Resources/iOS/build.xcconfig
new file mode 100644
index 0000000..0562055
--- /dev/null
+++ b/demo/app/App_Resources/iOS/build.xcconfig
@@ -0,0 +1,5 @@
+// You can add custom settings here
+// for example you can uncomment the following line to force distribution code signing
+// CODE_SIGN_IDENTITY = iPhone Distribution
+ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
diff --git a/demo/app/app.css b/demo/app/app.css
new file mode 100644
index 0000000..61bfb40
--- /dev/null
+++ b/demo/app/app.css
@@ -0,0 +1,6 @@
+.message {
+ color: #000;
+ font-size: 20;
+ horizontal-align: center;
+ padding:20;
+}
diff --git a/demo/app/app.ts b/demo/app/app.ts
new file mode 100644
index 0000000..d25410f
--- /dev/null
+++ b/demo/app/app.ts
@@ -0,0 +1,2 @@
+import * as application from "application";
+application.start({ moduleName: "main-page" });
diff --git a/demo/app/main-page.ts b/demo/app/main-page.ts
new file mode 100644
index 0000000..70112d6
--- /dev/null
+++ b/demo/app/main-page.ts
@@ -0,0 +1,10 @@
+import * as observable from "data/observable";
+import * as pages from "ui/page";
+import {HelloWorldModel} from "./main-view-model";
+
+// Event handler for Page "loaded" event attached in main-page.xml
+export function pageLoaded(args: observable.EventData) {
+ // Get the event sender
+ let page = args.object;
+ page.bindingContext = new HelloWorldModel();
+}
\ No newline at end of file
diff --git a/demo/app/main-page.xml b/demo/app/main-page.xml
new file mode 100644
index 0000000..868f9d0
--- /dev/null
+++ b/demo/app/main-page.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/app/main-view-model.ts b/demo/app/main-view-model.ts
new file mode 100644
index 0000000..de28468
--- /dev/null
+++ b/demo/app/main-view-model.ts
@@ -0,0 +1,14 @@
+import {Observable} from "data/observable";
+import {NativescriptBackgroundGps} from "nativescript-background-gps";
+
+export class HelloWorldModel extends Observable {
+ public message: string;
+ private nativescriptBackgroundGps: NativescriptBackgroundGps;
+
+ constructor() {
+ super();
+
+ this.nativescriptBackgroundGps = new NativescriptBackgroundGps();
+ this.message = this.nativescriptBackgroundGps.message;
+ }
+}
\ No newline at end of file
diff --git a/demo/app/package.json b/demo/app/package.json
new file mode 100644
index 0000000..31c9e0d
--- /dev/null
+++ b/demo/app/package.json
@@ -0,0 +1,105 @@
+{
+ "name": "tns-template-hello-world-ts",
+ "main": "app.js",
+ "version": "1.6.0",
+ "author": {
+ "name": "Telerik",
+ "email": "support@telerik.com"
+ },
+ "description": "Nativescript hello-world-ts project template",
+ "license": "Apache-2.0",
+ "keywords": [
+ "telerik",
+ "mobile",
+ "nativescript",
+ "{N}",
+ "tns",
+ "appbuilder",
+ "template"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+ssh://git@github.com/NativeScript/template-hello-world-ts.git"
+ },
+ "bugs": {
+ "url": "https://github.com/NativeScript/template-hello-world-ts/issues"
+ },
+ "homepage": "https://github.com/NativeScript/template-hello-world-ts",
+ "android": {
+ "v8Flags": "--expose_gc"
+ },
+ "devDependencies": {
+ "nativescript-dev-typescript": "^0.3.0"
+ },
+ "_id": "tns-template-hello-world-ts@1.6.0",
+ "_shasum": "a567c2b9a56024818c06596dab9629d155c5b8a8",
+ "_resolved": "https://registry.npmjs.org/tns-template-hello-world-ts/-/tns-template-hello-world-ts-1.6.0.tgz",
+ "_from": "tns-template-hello-world-ts@latest",
+ "scripts": {},
+ "_npmVersion": "2.14.7",
+ "_nodeVersion": "4.2.2",
+ "_npmUser": {
+ "name": "enchev",
+ "email": "vladimir.enchev@gmail.com"
+ },
+ "dist": {
+ "shasum": "a567c2b9a56024818c06596dab9629d155c5b8a8",
+ "tarball": "http://registry.npmjs.org/tns-template-hello-world-ts/-/tns-template-hello-world-ts-1.6.0.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "enchev",
+ "email": "vladimir.enchev@gmail.com"
+ },
+ {
+ "name": "erjangavalji",
+ "email": "erjan.gavalji@gmail.com"
+ },
+ {
+ "name": "fatme",
+ "email": "hfatme@gmail.com"
+ },
+ {
+ "name": "hdeshev",
+ "email": "hristo@deshev.com"
+ },
+ {
+ "name": "kerezov",
+ "email": "d.kerezov@gmail.com"
+ },
+ {
+ "name": "ligaz",
+ "email": "stefan.dobrev@gmail.com"
+ },
+ {
+ "name": "nsndeck",
+ "email": "nedyalko.nikolov@telerik.com"
+ },
+ {
+ "name": "rosen-vladimirov",
+ "email": "rosen.vladimirov.91@gmail.com"
+ },
+ {
+ "name": "sdobrev",
+ "email": "stefan.dobrev@gmail.com"
+ },
+ {
+ "name": "tailsu",
+ "email": "tailsu@gmail.com"
+ },
+ {
+ "name": "teobugslayer",
+ "email": "teobugslayer@gmail.com"
+ },
+ {
+ "name": "valio.stoychev",
+ "email": "valio.stoychev@gmail.com"
+ }
+ ],
+ "_npmOperationalInternal": {
+ "host": "packages-5-east.internal.npmjs.com",
+ "tmp": "tmp/tns-template-hello-world-ts-1.6.0.tgz_1455717516189_0.6427943941671401"
+ },
+ "directories": {},
+ "readme": "ERROR: No README data found!"
+}
diff --git a/demo/package.json b/demo/package.json
new file mode 100644
index 0000000..1c4fc22
--- /dev/null
+++ b/demo/package.json
@@ -0,0 +1,24 @@
+{
+ "nativescript": {
+ "id": "org.nativescript.demo",
+ "tns-ios": {
+ "version": "2.3.0"
+ },
+ "tns-android": {
+ "version": "2.3.0"
+ }
+ },
+ "dependencies": {
+ "nativescript-background-gps": "file:..",
+ "tns-core-modules": "^2.3.0"
+ },
+ "devDependencies": {
+ "babel-traverse": "6.12.0",
+ "babel-types": "6.11.1",
+ "babylon": "6.8.4",
+ "filewalker": "0.1.2",
+ "lazy": "1.0.11",
+ "nativescript-dev-typescript": "^0.3.2",
+ "typescript": "^1.8.10"
+ }
+}
diff --git a/demo/tsconfig.json b/demo/tsconfig.json
new file mode 100644
index 0000000..963c616
--- /dev/null
+++ b/demo/tsconfig.json
@@ -0,0 +1,13 @@
+{
+ "compilerOptions": {
+ "module": "commonjs",
+ "target": "es5",
+ "sourceMap": true,
+ "experimentalDecorators": true,
+ "noEmitHelpers": true
+ },
+ "exclude": [
+ "node_modules",
+ "platforms"
+ ]
+}
\ No newline at end of file
diff --git a/index.d.ts b/index.d.ts
new file mode 100644
index 0000000..d9b791a
--- /dev/null
+++ b/index.d.ts
@@ -0,0 +1,8 @@
+/**
+ * iOS and Android apis should match.
+ * It doesn't matter if you export `.ios` or `.android`, either one but only one.
+ */
+export * from "./nativescript-background-gps.ios";
+
+// Export any shared classes, constants, etc.
+export * from "./nativescript-background-gps.common";
\ No newline at end of file
diff --git a/manual_typings/base.d.ts b/manual_typings/base.d.ts
new file mode 100644
index 0000000..d1a39c2
--- /dev/null
+++ b/manual_typings/base.d.ts
@@ -0,0 +1,5 @@
+/* Polyfill these types */
+declare type FormData = any;
+declare var FormData;
+declare type Blob = any;
+declare var Blob;
\ No newline at end of file
diff --git a/nativescript-background-gps.android.d.ts b/nativescript-background-gps.android.d.ts
new file mode 100644
index 0000000..7078562
--- /dev/null
+++ b/nativescript-background-gps.android.d.ts
@@ -0,0 +1,3 @@
+import { Common } from "./nativescript-background-gps.common";
+export declare class NativescriptBackgroundGps extends Common {
+}
diff --git a/nativescript-background-gps.android.ts b/nativescript-background-gps.android.ts
new file mode 100644
index 0000000..a120e67
--- /dev/null
+++ b/nativescript-background-gps.android.ts
@@ -0,0 +1,5 @@
+import {Common} from "./nativescript-background-gps.common";
+
+export class NativescriptBackgroundGps extends Common {
+
+}
\ No newline at end of file
diff --git a/nativescript-background-gps.common.d.ts b/nativescript-background-gps.common.d.ts
new file mode 100644
index 0000000..fa9ddcd
--- /dev/null
+++ b/nativescript-background-gps.common.d.ts
@@ -0,0 +1,7 @@
+export declare class Common {
+ message: string;
+ constructor();
+}
+export declare class Utils {
+ static SUCCESS_MSG(): string;
+}
diff --git a/nativescript-background-gps.common.ts b/nativescript-background-gps.common.ts
new file mode 100644
index 0000000..ca56eba
--- /dev/null
+++ b/nativescript-background-gps.common.ts
@@ -0,0 +1,23 @@
+import * as app from "application";
+import * as dialogs from "ui/dialogs";
+
+export class Common {
+ public message: string;
+
+ constructor() {
+ this.message = Utils.SUCCESS_MSG();
+ }
+}
+
+export class Utils {
+ public static SUCCESS_MSG(): string {
+ let msg = `Your plugin is working on ${app.android ? "Android" : "iOS"}.`;
+
+ setTimeout(() => {
+ dialogs.alert(`${msg} For real. It's really working :)`).then(() => console.log(`Dialog closed.`));
+ }, 2000);
+
+ return msg;
+ }
+}
+
diff --git a/nativescript-background-gps.ios.d.ts b/nativescript-background-gps.ios.d.ts
new file mode 100644
index 0000000..7078562
--- /dev/null
+++ b/nativescript-background-gps.ios.d.ts
@@ -0,0 +1,3 @@
+import { Common } from "./nativescript-background-gps.common";
+export declare class NativescriptBackgroundGps extends Common {
+}
diff --git a/nativescript-background-gps.ios.ts b/nativescript-background-gps.ios.ts
new file mode 100644
index 0000000..a120e67
--- /dev/null
+++ b/nativescript-background-gps.ios.ts
@@ -0,0 +1,5 @@
+import {Common} from "./nativescript-background-gps.common";
+
+export class NativescriptBackgroundGps extends Common {
+
+}
\ No newline at end of file
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..6acaa39
--- /dev/null
+++ b/package.json
@@ -0,0 +1,49 @@
+{
+ "name": "nativescript-background-gps",
+ "version": "0.0.1",
+ "description": "Track GPS location updates in the background.",
+ "main": "nativescript-background-gps.js",
+ "typings": "index.d.ts",
+ "nativescript": {
+ "platforms": {
+ "android": "2.3.0",
+ "ios": "2.3.0"
+ }
+ },
+ "scripts": {
+ "build": "tsc",
+ "demo.ios": "npm run preparedemo && cd demo && tns emulate ios",
+ "demo.ios.device": "npm run preparedemo && cd demo && tns run ios",
+ "demo.android": "npm run preparedemo && cd demo && tns run android",
+ "preparedemo": "npm run build && cd demo && tns plugin remove nativescript-background-gps && tns plugin add .. && tns install",
+ "setup": "npm i && cd demo && npm i && cd .. && npm run build && cd demo && tns plugin add .. && cd ..",
+ "postclone": "npm i && node scripts/postclone.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/nickcoury/nativescript-background-gps.git"
+ },
+ "keywords": [
+ "NativeScript",
+ "JavaScript",
+ "Android",
+ "iOS"
+ ],
+ "author": {
+ "name": "Your Name",
+ "email": "youremail@yourdomain.com"
+ },
+ "bugs": {
+ "url": "https://github.com/nickcoury/nativescript-background-gps/issues"
+ },
+ "license": "MIT",
+ "homepage": "https://github.com/nickcoury/nativescript-background-gps",
+ "readmeFilename": "README.md",
+ "devDependencies": {
+ "tns-core-modules": "^2.3.0",
+ "tns-platform-declarations": "^2.3.0",
+ "typescript": "^1.8.10",
+ "prompt": "^1.0.0",
+ "rimraf": "^2.5.0"
+ }
+}
diff --git a/references.d.ts b/references.d.ts
new file mode 100644
index 0000000..c733915
--- /dev/null
+++ b/references.d.ts
@@ -0,0 +1,13 @@
+/// Needed for autocompletion and compilation.
+
+///
+///
+///
+
+///
+
+declare type FormData = any;
+declare var FormData;
+declare type Blob = any;
+declare var Blob;
+
diff --git a/tsconfig.json b/tsconfig.json
new file mode 100644
index 0000000..1f2220e
--- /dev/null
+++ b/tsconfig.json
@@ -0,0 +1,23 @@
+{
+ "compilerOptions": {
+ "target": "es5",
+ "module": "commonjs",
+ "removeComments": true,
+ "experimentalDecorators": true,
+ "noEmitHelpers": true,
+ "declaration": true,
+ "noLib": true
+ },
+ "files": [
+ "node_modules/typescript/lib/lib.core.d.ts",
+ "manual_typings/base.d.ts",
+ "node_modules/tns-core-modules/tns-core-modules.d.ts",
+ "node_modules/tns-platform-declarations/tns-core-modules/android17.d.ts",
+ "node_modules/tns-platform-declarations/tns-core-modules/ios/ios.d.ts",
+ "node_modules/tns-platform-declarations/tns-core-modules/org.nativescript.widgets.d.ts",
+ "nativescript-background-gps.common.ts",
+ "nativescript-background-gps.android.ts",
+ "nativescript-background-gps.ios.ts"
+ ],
+ "compileOnSave": false
+}
\ No newline at end of file