Skip to content

Commit 13b571c

Browse files
committed
Fix Android Activity issue closing the browser and restoring the state, fixed issue with the auth redirection
1 parent 57d7eb1 commit 13b571c

File tree

85 files changed

+964
-805
lines changed

Some content is hidden

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

85 files changed

+964
-805
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ src/*.d.ts
1010
!src/references.d.ts
1111
!src/scripts/*.js
1212
!seed-tests/*.js
13-
seed-tests/seed-copy/**/*.*
13+
seed-tests/seed-copy
1414
seed-tests/seed-copy-new-git-repo/**/*.*
1515
!demo/karma.conf.js
1616
!demo/app/tests/*.js

.travis.yml

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ matrix:
99
os: osx
1010
env:
1111
- WebPack="iOS"
12-
osx_image: xcode10.0
12+
osx_image: xcode10.2
1313
language: node_js
1414
node_js: "10"
1515
jdk: oraclejdk8
@@ -33,57 +33,45 @@ matrix:
3333
env:
3434
- BuildiOS="12"
3535
- Xcode="10.0"
36-
osx_image: xcode10.0
36+
osx_image: xcode10.2
3737
language: node_js
3838
node_js: "10"
3939
jdk: oraclejdk8
4040
script:
4141
- cd src && npm i && npm run tsc && cd ../demo && tns build ios
42-
# - os: linux
43-
# language: android
44-
# dist: precise
45-
# sudo: required
46-
# jdk: oraclejdk8
47-
# before_script:
48-
# - android list targets
49-
# - echo no | android create avd --force -n test -t android-19 -b armeabi-v7a
50-
# - emulator -avd test -no-skin -no-audio -no-window &
51-
# - android-wait-for-emulator
52-
# before_install:
53-
# - nvm install 8
54-
# script: cd src && npm run test.android
55-
# - os: osx
56-
# language: node_js
57-
# node_js: "10"
58-
# jdk: oraclejdk8
59-
# osx_image: xcode10.0
60-
# script: cd src && npm run test.ios
42+
- os: linux
43+
language: android
44+
dist: precise
45+
sudo: required
46+
jdk: oraclejdk8
47+
before_script:
48+
- echo no | android create avd --force -n test -t android-21 -b armeabi-v7a
49+
- emulator -avd test -no-audio -no-window &
50+
- android-wait-for-emulator
51+
before_install:
52+
- nvm install 10
53+
script: cd src && npm run test.android
54+
- os: osx
55+
language: node_js
56+
node_js: "10"
57+
jdk: oraclejdk8
58+
osx_image: xcode10.2
59+
script: cd src && npm run test.ios
6160

6261
android:
6362
components:
64-
# Uncomment the lines below if you want to
65-
# use the latest revision of Android SDK Tools
6663
- tools
6764
- platform-tools
68-
# The BuildTools version used by your project
6965
- build-tools-28.0.3
70-
# The SDK version used to compile your project
7166
- android-28
72-
# Additional components
7367
- extra-android-m2repository
74-
# Specify at least one system image,
75-
# if you need to run emulator(s) during your tests
76-
# - sys-img-x86-android-28
77-
- sys-img-armeabi-v7a-android-28
78-
79-
- ADB_INSTALL_TIMEOUT=20 # minutes (2 minutes by default)
68+
- sys-img-armeabi-v7a-android-21
8069

8170
before_install:
8271
- sudo pip install --upgrade pip
8372
- sudo pip install six
8473

8574
install:
86-
- echo no | npm install -g typescript
8775
- echo no | npm install -g nativescript
8876
- tns usage-reporting disable
8977
- tns error-reporting disable

CHANGELOG.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,15 @@ in case of vulnerabilities.
2222

2323
## [Unreleased]
2424

25-
## [2.0.1] - 2019-10-15
25+
## [2.1.0] - 2019-11-13
26+
### Added
27+
- Added support for `automatic` modal presentation style from **iOS**.
28+
- Added `enableBarCollapsing` option to determines whether the browser's tool bars will collapse or not from **iOS**.
29+
2630
### Fixed
27-
- **iOS:** Conform to the new iOS 13 API for ASWebAuthenticationSession. ASWebAuthenticationSession now requires a delegate that provides a display context for the authentication session. [#14](https://github.com/proyecto26/nativescript-inappbrowser/issues/14)
31+
- Fixed issue with `ASWebAuthenticationSession` to support **iOS 13** by [@cgoboncan-ebsi](https://github.com/cgoboncan-ebsi) [#14](https://github.com/proyecto26/nativescript-inappbrowser/issues/14).
32+
- Fixed **Android** Activity issue closing the browser and restoring the state by using `onSaveInstanceState`
33+
- Fixed Android auth redirection by using `AndroidApplication.activityResumedEvent`.
2834

2935
## [2.0.0] - 2019-07-27
3036
### Added
@@ -46,6 +52,7 @@ in case of vulnerabilities.
4652
- Methods to open and close external urls to authenticate the user **(openAuth, closeAuth)** using deep linking.
4753
- `isAvailable` method to detect if the device supports the plugin.
4854

49-
[Unreleased]: https://github.com/proyecto26/nativescript-inappbrowser/compare/v2.0.0...HEAD
55+
[Unreleased]: https://github.com/proyecto26/nativescript-inappbrowser/compare/v2.1.0...HEAD
56+
[2.1.0]: https://github.com/proyecto26/nativescript-inappbrowser/compare/v2.0.0...v2.1.0
5057
[2.0.0]: https://github.com/proyecto26/nativescript-inappbrowser/compare/v1.0.0...v2.0.0
5158
[1.0.0]: https://github.com/proyecto26/nativescript-inappbrowser/releases/tag/v1.0.0

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
tns plugin add nativescript-inappbrowser
4242
```
4343

44+
45+
4446
## Usage
4547

4648
Methods | Action
@@ -60,9 +62,10 @@ Property | Description
6062
`preferredControlTintColor` (String) | The color to tint the control buttons on the navigation bar and the toolbar. [`gray`/`#808080`]
6163
`readerMode` (Boolean) | A value that specifies whether Safari should enter Reader mode, if it is available. [`true`/`false`]
6264
`animated` (Boolean) | Animate the presentation. [`true`/`false`]
63-
`modalPresentationStyle` (String) | The presentation style for modally presented view controllers. [`none`/`fullScreen`/`pageSheet`/`formSheet`/`currentContext`/`custom`/`overFullScreen`/`overCurrentContext`/`popover`]
65+
`modalPresentationStyle` (String) | The presentation style for modally presented view controllers. [`automatic`/`none`/`fullScreen`/`pageSheet`/`formSheet`/`currentContext`/`custom`/`overFullScreen`/`overCurrentContext`/`popover`]
6466
`modalTransitionStyle` (String) | The transition style to use when presenting the view controller. [`coverVertical`/`flipHorizontal`/`crossDissolve`/`partialCurl`]
6567
`modalEnabled` (Boolean) | Present the **SafariViewController** modally or as push instead. [`true`/`false`]
68+
`enableBarCollapsing` (Boolean) | Determines whether the browser's tool bars will collapse or not. [`true`/`false`]
6669

6770
### Android Options
6871
Property | Description
@@ -95,9 +98,10 @@ import InAppBrowser from 'nativescript-inappbrowser'
9598
preferredControlTintColor: 'white',
9699
readerMode: false,
97100
animated: true,
98-
modalPresentationStyle: 'overFullScreen',
101+
modalPresentationStyle: 'fullScreen',
99102
modalTransitionStyle: 'partialCurl',
100103
modalEnabled: true,
104+
enableBarCollapsing: false,
101105
// Android Properties
102106
showTitle: true,
103107
toolbarColor: '#6200EE',

demo/.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true
7+
charset = utf-8
8+
9+
[*.json]
10+
indent_style = space
11+
indent_size = 2
12+
13+
[*.ts]
14+
indent_style = space
15+
indent_size = 4

demo/.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# NativeScript
2+
hooks/
3+
node_modules/
4+
platforms/
5+
6+
# NativeScript Template
7+
*.js.map
8+
*.js
9+
!webpack.config.js
10+
11+
# Logs
12+
logs
13+
*.log
14+
npm-debug.log*
15+
yarn-debug.log*
16+
yarn-error.log*
17+
18+
# General
19+
.DS_Store
20+
.AppleDouble
21+
.LSOverride
22+
.idea
23+
.cloud
24+
.project
25+
tmp/
26+
typings/
27+
28+
# Visual Studio Code
29+
.vscode/*
30+
!.vscode/settings.json
31+
!.vscode/tasks.json
32+
!.vscode/launch.json
33+
!.vscode/extensions.json
Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
// Add your native dependencies here:
22

3-
android {
4-
defaultConfig {
3+
// Uncomment to add recyclerview-v7 dependency
4+
//dependencies {
5+
// implementation 'com.android.support:recyclerview-v7:+'
6+
//}
7+
8+
// If you want to add something to be applied before applying plugins' include.gradle files
9+
// e.g. project.ext.googlePlayServicesVersion = "15.0.1"
10+
// create a file named before-plugins.gradle in the current directory and place it there
11+
12+
android {
13+
defaultConfig {
14+
minSdkVersion 17
515
generatedDensities = []
6-
}
7-
aaptOptions {
8-
additionalParameters "--no-version-vectors"
9-
}
10-
}
16+
}
17+
aaptOptions {
18+
additionalParameters "--no-version-vectors"
19+
}
20+
}

demo/app/App_Resources/Android/src/main/AndroidManifest.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
android:xlargeScreens="true"/>
1212

1313
<uses-sdk
14-
android:minSdkVersion="17"
14+
android:minSdkVersion="19"
1515
android:targetSdkVersion="__APILEVEL__"/>
1616

1717
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
@@ -23,12 +23,13 @@
2323
android:allowBackup="true"
2424
android:icon="@drawable/icon"
2525
android:label="@string/app_name"
26-
android:theme="@style/AppTheme">
26+
android:theme="@style/AppTheme"
27+
android:launchMode="singleTask">
2728

2829
<activity
2930
android:name="com.tns.NativeScriptActivity"
3031
android:label="@string/title_activity_kimera"
31-
android:configChanges="keyboardHidden|orientation|screenSize"
32+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|locale|uiMode"
3233
android:theme="@style/LaunchScreenTheme">
3334

3435
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />

demo/app/App_Resources/Android/src/main/res/anim/slide_in_left.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

demo/app/App_Resources/Android/src/main/res/anim/slide_in_right.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)