Skip to content

Commit e5d3a88

Browse files
author
Dimitar Tachev
authored
Merge pull request #141 from NativeScript/tachev/verify-plugin
Verify plugin
2 parents a3641fe + 6d43c88 commit e5d3a88

File tree

154 files changed

+2397
-1976
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+2397
-1976
lines changed

.gitignore

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,34 @@
55
*.js
66
*.js.map
77
*.log
8+
src/*.d.ts
9+
!src/index.d.ts
10+
!src/references.d.ts
811
!src/scripts/*.js
9-
!src/hooks/*.js
10-
node_modules
11-
12-
demo/app/*.js
12+
!demo/karma.conf.js
13+
!demo/app/tests/*.js
1314
demo/*.d.ts
14-
demo/hooks
15+
!demo/references.d.ts
16+
demo/lib
1517
demo/platforms
18+
demo/hooks
19+
node_modules
20+
publish/src
21+
publish/package
22+
demo/report/report.html
23+
demo/report/stats.json
1624
demo/node_modules
17-
demo/report
25+
demo-angular/node_modules
1826

19-
demo-angular/app/*.js
2027
demo-angular/*.d.ts
28+
!demo-angular/references.d.ts
2129
demo-angular/platforms/
30+
demo-angular/hooks
2231

2332
!demo-server/*.js
33+
!demo/webpack.config.js
34+
!demo-angular/webpack.config.js
2435
/src/platforms/android/nativescript_background_http.aar
25-
/src/*.tgz
36+
/src/*.tgz
37+
/src/package
38+
/src/package-lock.json

.travis.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
matrix:
2+
include:
3+
- stage: "Lint"
4+
language: node_js
5+
os: linux
6+
node_js: "6"
7+
script: cd src && npm run ci.tslint && cd ../demo && npm run ci.tslint && cd ../demo-angular && npm run ci.tslint
8+
- stage: "WebPack, Build and Test"
9+
os: osx
10+
env:
11+
- WebPack="iOS"
12+
osx_image: xcode9.2
13+
language: node_js
14+
node_js: "6"
15+
jdk: oraclejdk8
16+
script: cd demo && npm run build.plugin && npm i && tns build ios --bundle --env.uglify && cd ../demo-angular && npm i && tns build ios --bundle --env.uglify
17+
- language: android
18+
os: linux
19+
env:
20+
- WebPack="Android"
21+
jdk: oraclejdk8
22+
before_install: nvm install 6.10.3
23+
script: cd demo && npm run build.plugin && npm i && tns build android --bundle --env.uglify --env.snapshot && cd ../demo-angular && tns build android --bundle --env.uglify --env.snapshot
24+
- language: android
25+
env:
26+
- BuildAndroid="26"
27+
os: linux
28+
jdk: oraclejdk8
29+
before_install: nvm install stable
30+
script:
31+
- cd src && npm i && npm run tsc && cd ../demo && tns build android && cd ../demo-angular && tns build android
32+
- os: osx
33+
env:
34+
- BuildiOS="11"
35+
- Xcode="9.2"
36+
osx_image: xcode9.2
37+
language: node_js
38+
node_js: "6"
39+
jdk: oraclejdk8
40+
script:
41+
- cd src && npm i && npm run tsc && cd ../demo && tns build ios && cd ../demo-angular && tns build ios
42+
43+
android:
44+
components:
45+
- tools
46+
- platform-tools
47+
- build-tools-26.0.2
48+
- android-26
49+
- android-23
50+
- extra-android-m2repository
51+
- sys-img-armeabi-v7a-android-21
52+
53+
install:
54+
- echo no | npm install -g nativescript
55+
- tns usage-reporting disable
56+
- tns error-reporting disable

README.md

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,20 @@
1-
# Background Upload plugin for the NativeScript framework
2-
## iOS
3-
The iOS API is implemented in JavaScript.
1+
# Background Upload NativeScript plugin
42

5-
## Android
6-
The minimum supported API level is 18 and the background file upload is handled by the [android-upload-service](https://github.com/alexbbb/android-upload-service) Open-Source library.
3+
A cross platform plugin for [the NativeScript framework](http://www.nativescript.org), that provides background upload for iOS and Android.
74

8-
## Examples
5+
[There is a stock NativeScript `http` module that can handle GET/POST requests that work with strings and JSONs](http://docs.nativescript.org/ApiReference/http/HOW-TO). It however comes short in features when it comes to really large files.
96

10-
To run the demo open a terminal at the root of the repo and start the server included in `demo-server` with the command:
11-
```
12-
npm run start-server
13-
```
7+
The plugin uses [NSURLSession with background session configuration for iOS](https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSURLSessionConfiguration_class/index.html#//apple_ref/occ/clm/NSURLSessionConfiguration/backgroundSessionConfigurationWithIdentifier:); and for android - the [alexbbb/android-upload-service](https://github.com/alexbbb/android-upload-service) that implements an IntentService.
148

15-
Then, open a second terminal, again at the root of the repo and execute (for Android):
16-
```
17-
npm run start-demo-android
18-
```
19-
OR (for iOS)
20-
```
21-
npm run start-demo-ios
9+
## Installation
10+
11+
```javascript
12+
tns plugin add nativescript-background-http
2213
```
2314

2415
## Usage
2516

26-
The below attached code snippets demostrate how to use `nativescript-background-http`, while uploading single or multiple files.
27-
28-
For further help review the (SimpleBackgroundHttp)[https://github.com/NativeScript/nativescript-background-http/tree/master/examples] application.
17+
The below attached code snippets demonstrate how to use `nativescript-background-http`, while uploading single or multiple files.
2918

3019
### uploadFile
3120

@@ -91,5 +80,7 @@ We love PRs! Check out the [contributing guidelines](CONTRIBUTING.md). If you wa
9180
## Get Help
9281
Please, use [github issues](https://github.com/NativeScript/nativescript-background-http/issues) strictly for [reporting bugs](CONTRIBUTING.md#reporting-bugs) or [requesting features](CONTRIBUTING.md#requesting-new-features). For general questions and support, check out the [NativeScript community forum](https://discourse.nativescript.org/) or ask our experts in [NativeScript community Slack channel](http://developer.telerik.com/wp-login.php?action=slack-invitation).
9382

94-
![](https://ga-beacon.appspot.com/UA-111455-24/nativescript/nativescript-background-http?pixel)
83+
## License
9584

85+
Apache License Version 2.0, January 2004
86+
![](https://ga-beacon.appspot.com/UA-111455-24/nativescript/nativescript-background-http?pixel)

demo-angular/app/App_Resources/Android/app.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
android {
99
defaultConfig {
1010
generatedDensities = []
11-
applicationId = "org.nativescript.backgroundhttpdemoangular"
11+
applicationId = "org.nativescript.demoangular"
1212
}
1313
aaptOptions {
1414
additionalParameters "--no-version-vectors"
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="__PACKAGE__"
4-
android:versionCode="10000"
5-
android:versionName="1.0">
6-
7-
<supports-screens
8-
android:smallScreens="true"
9-
android:normalScreens="true"
10-
android:largeScreens="true"
11-
android:xlargeScreens="true"/>
12-
13-
<uses-sdk
14-
android:minSdkVersion="17"
15-
android:targetSdkVersion="__APILEVEL__"/>
16-
17-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
18-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
19-
<uses-permission android:name="android.permission.INTERNET"/>
20-
21-
<application
22-
android:name="com.tns.NativeScriptApplication"
23-
android:allowBackup="true"
24-
android:icon="@drawable/icon"
25-
android:label="@string/app_name"
26-
android:theme="@style/AppTheme">
27-
28-
<activity
29-
android:name="com.tns.NativeScriptActivity"
30-
android:label="@string/title_activity_kimera"
31-
android:configChanges="keyboardHidden|orientation|screenSize"
32-
android:theme="@style/LaunchScreenTheme">
33-
34-
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />
35-
36-
<intent-filter>
37-
<action android:name="android.intent.action.MAIN" />
38-
<category android:name="android.intent.category.LAUNCHER" />
39-
</intent-filter>
40-
</activity>
41-
<activity android:name="com.tns.ErrorReportActivity"/>
42-
</application>
43-
</manifest>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="__PACKAGE__"
4+
android:versionCode="10000"
5+
android:versionName="1.0">
6+
7+
<supports-screens
8+
android:smallScreens="true"
9+
android:normalScreens="true"
10+
android:largeScreens="true"
11+
android:xlargeScreens="true"/>
12+
13+
<uses-sdk
14+
android:minSdkVersion="17"
15+
android:targetSdkVersion="__APILEVEL__"/>
16+
17+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
18+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
19+
<uses-permission android:name="android.permission.INTERNET"/>
20+
21+
<application
22+
android:name="com.tns.NativeScriptApplication"
23+
android:allowBackup="true"
24+
android:icon="@drawable/icon"
25+
android:label="@string/app_name"
26+
android:theme="@style/AppTheme">
27+
28+
<activity
29+
android:name="com.tns.NativeScriptActivity"
30+
android:label="@string/title_activity_kimera"
31+
android:configChanges="keyboardHidden|orientation|screenSize"
32+
android:theme="@style/LaunchScreenTheme">
33+
34+
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />
35+
36+
<intent-filter>
37+
<action android:name="android.intent.action.MAIN" />
38+
<category android:name="android.intent.category.LAUNCHER" />
39+
</intent-filter>
40+
</activity>
41+
<activity android:name="com.tns.ErrorReportActivity"/>
42+
</application>
43+
</manifest>
6.04 KB
Loading
2.2 KB
Loading

0 commit comments

Comments
 (0)