nativescript-inappbrowser
Advanced tools
Comparing version
@@ -12,2 +12,3 @@ import Context = android.content.Context; | ||
private mOpened; | ||
private resultType; | ||
constructor(); | ||
@@ -18,2 +19,4 @@ onCreate(savedInstanceState?: Bundle): void; | ||
onNewIntent(intent: Intent): void; | ||
onRestoreInstanceState(savedInstanceState: Bundle): void; | ||
onSaveInstanceState(savedInstanceState: Bundle): void; | ||
} | ||
@@ -20,0 +23,0 @@ export declare const createStartIntent: (context: Context, authIntent: Intent) => Intent; |
@@ -15,2 +15,4 @@ "use strict"; | ||
var KEY_BROWSER_INTENT = 'browserIntent'; | ||
var BROWSER_RESULT_TYPE = 'browserResultType'; | ||
var DEFAULT_RESULT_TYPE = 'dismiss'; | ||
var ChromeTabsManagerActivity = (function (_super) { | ||
@@ -21,2 +23,3 @@ __extends(ChromeTabsManagerActivity, _super); | ||
_this.mOpened = false; | ||
_this.resultType = null; | ||
return global.__native(_this); | ||
@@ -26,6 +29,8 @@ } | ||
_super.prototype.onCreate.call(this, savedInstanceState); | ||
if (this.getIntent().hasExtra(KEY_BROWSER_INTENT)) { | ||
if (this.getIntent().hasExtra(KEY_BROWSER_INTENT) | ||
&& (!savedInstanceState || !savedInstanceState.getString(BROWSER_RESULT_TYPE))) { | ||
var browserIntent = this.getIntent().getParcelableExtra(KEY_BROWSER_INTENT); | ||
browserIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); | ||
this.startActivity(browserIntent); | ||
this.resultType = DEFAULT_RESULT_TYPE; | ||
} | ||
@@ -42,4 +47,18 @@ else { | ||
else { | ||
exports.BROWSER_ACTIVITY_EVENTS.set('message', 'chrome tabs activity closed'); | ||
exports.BROWSER_ACTIVITY_EVENTS.set('resultType', 'cancel'); | ||
this.resultType = 'cancel'; | ||
this.finish(); | ||
} | ||
}; | ||
ChromeTabsManagerActivity.prototype.onDestroy = function () { | ||
if (this.resultType) { | ||
switch (this.resultType) { | ||
case 'cancel': | ||
exports.BROWSER_ACTIVITY_EVENTS.set('message', 'chrome tabs activity closed'); | ||
exports.BROWSER_ACTIVITY_EVENTS.set('resultType', 'cancel'); | ||
break; | ||
default: | ||
exports.BROWSER_ACTIVITY_EVENTS.set('message', 'chrome tabs activity destroyed'); | ||
exports.BROWSER_ACTIVITY_EVENTS.set('resultType', DEFAULT_RESULT_TYPE); | ||
break; | ||
} | ||
exports.BROWSER_ACTIVITY_EVENTS.notify({ | ||
@@ -49,12 +68,4 @@ eventName: 'DismissedEvent', | ||
}); | ||
this.finish(); | ||
this.resultType = null; | ||
} | ||
}; | ||
ChromeTabsManagerActivity.prototype.onDestroy = function () { | ||
exports.BROWSER_ACTIVITY_EVENTS.set('message', 'chrome tabs activity destroyed'); | ||
exports.BROWSER_ACTIVITY_EVENTS.set('resultType', 'dismiss'); | ||
exports.BROWSER_ACTIVITY_EVENTS.notify({ | ||
eventName: 'DismissedEvent', | ||
object: exports.BROWSER_ACTIVITY_EVENTS | ||
}); | ||
_super.prototype.onDestroy.call(this); | ||
@@ -66,2 +77,10 @@ }; | ||
}; | ||
ChromeTabsManagerActivity.prototype.onRestoreInstanceState = function (savedInstanceState) { | ||
_super.prototype.onRestoreInstanceState.call(this, savedInstanceState); | ||
this.resultType = savedInstanceState.getString(BROWSER_RESULT_TYPE); | ||
}; | ||
ChromeTabsManagerActivity.prototype.onSaveInstanceState = function (savedInstanceState) { | ||
savedInstanceState.putString(BROWSER_RESULT_TYPE, DEFAULT_RESULT_TYPE); | ||
_super.prototype.onSaveInstanceState.call(this, savedInstanceState); | ||
}; | ||
ChromeTabsManagerActivity = __decorate([ | ||
@@ -68,0 +87,0 @@ JavaProxy('com.proyecto26.inappbrowser.ChromeTabsManagerActivity'), |
@@ -5,3 +5,3 @@ "use strict"; | ||
function getDefaultOptions(url, options) { | ||
return __assign({}, options, { url: url, dismissButtonStyle: options.dismissButtonStyle || 'close', readerMode: options.readerMode !== undefined ? options.readerMode : false, animated: options.animated !== undefined ? options.animated : true, modalEnabled: options.modalEnabled !== undefined ? options.modalEnabled : true }); | ||
return __assign(__assign({}, options), { url: url, dismissButtonStyle: options.dismissButtonStyle || 'close', readerMode: options.readerMode !== undefined ? options.readerMode : false, animated: options.animated !== undefined ? options.animated : true, modalEnabled: options.modalEnabled !== undefined ? options.modalEnabled : true }); | ||
} | ||
@@ -26,5 +26,28 @@ exports.getDefaultOptions = getDefaultOptions; | ||
function openAuthSessionPolyfillAsync(startUrl, returnUrl, options, open) { | ||
return Promise.race([_waitForRedirectAsync(returnUrl), open(startUrl, options)]); | ||
return Promise.race([ | ||
open(startUrl, options).then(function (result) { | ||
return _checkResultAndReturnUrl(returnUrl, result); | ||
}), | ||
_waitForRedirectAsync(returnUrl) | ||
]); | ||
} | ||
exports.openAuthSessionPolyfillAsync = openAuthSessionPolyfillAsync; | ||
function _checkResultAndReturnUrl(returnUrl, result) { | ||
return new Promise(function (resolve) { | ||
if (application_1.android) { | ||
application_1.android.once(application_1.AndroidApplication.activityResumedEvent, function (args) { | ||
var url = '' + args.activity.getIntent().getData(); | ||
if (url.startsWith(returnUrl)) { | ||
resolve({ url: url, type: 'success' }); | ||
} | ||
else { | ||
resolve(result); | ||
} | ||
}); | ||
} | ||
else { | ||
resolve(result); | ||
} | ||
}); | ||
} | ||
function closeAuthSessionPolyfillAsync() { | ||
@@ -31,0 +54,0 @@ if (_redirectHandler) { |
@@ -1,2 +0,36 @@ | ||
declare const _default: any; | ||
import { BrowserResult, AuthSessionResult } from './InAppBrowser.common'; | ||
declare type InAppBrowserOptions = { | ||
dismissButtonStyle?: 'done' | 'close' | 'cancel'; | ||
preferredBarTintColor?: string; | ||
preferredControlTintColor?: string; | ||
readerMode?: boolean; | ||
animated?: boolean; | ||
modalPresentationStyle?: 'automatic' | 'fullScreen' | 'pageSheet' | 'formSheet' | 'currentContext' | 'custom' | 'overFullScreen' | 'overCurrentContext' | 'popover' | 'none'; | ||
modalTransitionStyle?: 'coverVertical' | 'flipHorizontal' | 'crossDissolve' | 'partialCurl'; | ||
modalEnabled?: boolean; | ||
enableBarCollapsing?: boolean; | ||
}; | ||
declare class InAppBrowserModule extends NSObject { | ||
static ObjCProtocols: ({ | ||
prototype: SFSafariViewControllerDelegate; | ||
} | { | ||
prototype: UIAdaptivePresentationControllerDelegate; | ||
})[]; | ||
private safariVC; | ||
private redirectResolve; | ||
private redirectReject; | ||
private authSession; | ||
private animated; | ||
isAvailable(): Promise<boolean>; | ||
open(authURL: string, inAppBrowserOptions?: InAppBrowserOptions): Promise<BrowserResult>; | ||
close(): void; | ||
openAuth(authUrl: string, redirectUrl: string): Promise<AuthSessionResult>; | ||
closeAuth(): void; | ||
presentationAnchorForWebAuthenticationSession(session: ASWebAuthenticationSession): UIWindow; | ||
private dismissWithoutAnimation; | ||
safariViewControllerDidFinish(controller: SFSafariViewController): void; | ||
private flowDidFinish; | ||
private initializeWebBrowser; | ||
} | ||
declare const _default: InAppBrowserModule; | ||
export default _default; |
@@ -8,2 +8,3 @@ "use strict"; | ||
var styles = { | ||
none: -1, | ||
fullScreen: 0, | ||
@@ -16,6 +17,7 @@ pageSheet: 1, | ||
overCurrentContext: 6, | ||
popover: 7, | ||
none: -1 | ||
popover: 7 | ||
}; | ||
return styles[styleKey] || 5; | ||
var defaultModalPresentationStyle = utils_1.ios.MajorVersion >= 13 ? | ||
-2 : 0; | ||
return styles[styleKey] !== undefined ? styles[styleKey] : defaultModalPresentationStyle; | ||
}; | ||
@@ -29,31 +31,53 @@ var getTransitionStyle = function (styleKey) { | ||
}; | ||
return styles[styleKey] || 0; | ||
return styles[styleKey] !== undefined ? styles[styleKey] : 0; | ||
}; | ||
var InAppBrowser = NSObject.extend({ | ||
redirectResolve: null, | ||
redirectReject: null, | ||
authSession: null, | ||
animated: false, | ||
isAvailable: function () { | ||
var protocols = [ | ||
SFSafariViewControllerDelegate, | ||
UIAdaptivePresentationControllerDelegate | ||
]; | ||
if (utils_1.ios.MajorVersion >= 13) { | ||
protocols.push(ASWebAuthenticationPresentationContextProviding); | ||
} | ||
var InAppBrowserModule = (function (_super) { | ||
__extends(InAppBrowserModule, _super); | ||
function InAppBrowserModule() { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.safariVC = null; | ||
_this.redirectResolve = null; | ||
_this.redirectReject = null; | ||
_this.authSession = null; | ||
_this.animated = false; | ||
return _this; | ||
} | ||
InAppBrowserModule.prototype.isAvailable = function () { | ||
return Promise.resolve(utils_1.ios.MajorVersion >= 9); | ||
}, | ||
open: function (url, inAppBrowserOptions) { | ||
}; | ||
InAppBrowserModule.prototype.open = function (authURL, inAppBrowserOptions) { | ||
var _this = this; | ||
if (inAppBrowserOptions === void 0) { inAppBrowserOptions = {}; } | ||
var self = this; | ||
return new Promise(function (resolve, reject) { | ||
if (!self.initializeWebBrowser(resolve, reject)) | ||
if (!_this.initializeWebBrowser(resolve, reject)) | ||
return; | ||
var options = InAppBrowser_common_1.getDefaultOptions(url, inAppBrowserOptions); | ||
self.animated = options.animated; | ||
var safariVC = SFSafariViewController.alloc().initWithURLEntersReaderIfAvailable(NSURL.URLWithString(options['url']), options.readerMode); | ||
safariVC.delegate = self; | ||
var options = InAppBrowser_common_1.getDefaultOptions(authURL, inAppBrowserOptions); | ||
_this.animated = options.animated; | ||
var url = NSURL.URLWithString(options['url']); | ||
if (utils_1.ios.MajorVersion >= 11) { | ||
var config = SFSafariViewControllerConfiguration.alloc().init(); | ||
config.barCollapsingEnabled = options.enableBarCollapsing; | ||
config.entersReaderIfAvailable = options.readerMode; | ||
_this.safariVC = SFSafariViewController.alloc().initWithURLConfiguration(url, config); | ||
} | ||
else { | ||
_this.safariVC = SFSafariViewController.alloc().initWithURLEntersReaderIfAvailable(url, options.readerMode); | ||
} | ||
_this.safariVC.delegate = _this; | ||
if (utils_1.ios.MajorVersion >= 11) { | ||
if (options.dismissButtonStyle === 'done') { | ||
safariVC.dismissButtonStyle = 0; | ||
_this.safariVC.dismissButtonStyle = 0; | ||
} | ||
else if (options.dismissButtonStyle === 'close') { | ||
safariVC.dismissButtonStyle = 1; | ||
_this.safariVC.dismissButtonStyle = 1; | ||
} | ||
else if (options.dismissButtonStyle === 'cancel') { | ||
safariVC.dismissButtonStyle = 2; | ||
_this.safariVC.dismissButtonStyle = 2; | ||
} | ||
@@ -63,6 +87,6 @@ } | ||
if (options.preferredBarTintColor) { | ||
safariVC.preferredBarTintColor = new color_1.Color(options.preferredBarTintColor).ios; | ||
_this.safariVC.preferredBarTintColor = new color_1.Color(options.preferredBarTintColor).ios; | ||
} | ||
if (options.preferredControlTintColor) { | ||
safariVC.preferredControlTintColor = new color_1.Color(options.preferredControlTintColor).ios; | ||
_this.safariVC.preferredControlTintColor = new color_1.Color(options.preferredControlTintColor).ios; | ||
} | ||
@@ -72,40 +96,44 @@ } | ||
if (options.modalEnabled) { | ||
safariVC.modalPresentationStyle = getPresentationStyle(options.modalPresentationStyle); | ||
if (options.animated) { | ||
safariVC.modalTransitionStyle = getTransitionStyle(options.modalTransitionStyle); | ||
var safariHackVC = UINavigationController.alloc().initWithRootViewController(_this.safariVC); | ||
safariHackVC.setNavigationBarHiddenAnimated(true, false); | ||
safariHackVC.modalPresentationStyle = getPresentationStyle(options.modalPresentationStyle); | ||
if (_this.animated) { | ||
safariHackVC.modalTransitionStyle = getTransitionStyle(options.modalTransitionStyle); | ||
} | ||
var safariHackVC = UINavigationController.alloc().initWithRootViewController(safariVC); | ||
safariHackVC.setNavigationBarHiddenAnimated(true, false); | ||
if (utils_1.ios.MajorVersion >= 13) { | ||
safariHackVC.modalInPresentation = true; | ||
} | ||
safariHackVC.presentationController.delegate = _this; | ||
ctrl.presentViewControllerAnimatedCompletion(safariHackVC, options.animated, null); | ||
} | ||
else { | ||
ctrl.presentViewControllerAnimatedCompletion(safariVC, options.animated, null); | ||
ctrl.presentViewControllerAnimatedCompletion(_this.safariVC, options.animated, null); | ||
} | ||
}); | ||
}, | ||
close: function () { | ||
var self = this; | ||
}; | ||
InAppBrowserModule.prototype.close = function () { | ||
var _this = this; | ||
var ctrl = UIApplication.sharedApplication.keyWindow.rootViewController; | ||
ctrl.dismissViewControllerAnimatedCompletion(self.animated, function () { | ||
if (self.redirectResolve) { | ||
self.redirectResolve({ | ||
ctrl.dismissViewControllerAnimatedCompletion(this.animated, function () { | ||
if (_this.redirectResolve) { | ||
_this.redirectResolve({ | ||
type: 'dismiss' | ||
}); | ||
self.flowDidFinish(); | ||
_this.flowDidFinish(); | ||
} | ||
}); | ||
}, | ||
openAuth: function (authUrl, redirectUrl) { | ||
}; | ||
InAppBrowserModule.prototype.openAuth = function (authUrl, redirectUrl) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var self, response; | ||
var response; | ||
var _this = this; | ||
return __generator(this, function (_a) { | ||
self = this; | ||
if (utils_1.ios.MajorVersion >= 11) { | ||
return [2, new Promise(function (resolve, reject) { | ||
if (!self.initializeWebBrowser(resolve, reject)) | ||
if (!_this.initializeWebBrowser(resolve, reject)) | ||
return; | ||
var url = NSURL.URLWithString(authUrl); | ||
self.authSession = (utils_1.ios.MajorVersion >= 12 ? ASWebAuthenticationSession : SFAuthenticationSession).alloc().initWithURLCallbackURLSchemeCompletionHandler(url, redirectUrl, function (callbackURL, error) { | ||
_this.authSession = (utils_1.ios.MajorVersion >= 12 ? ASWebAuthenticationSession : SFAuthenticationSession).alloc().initWithURLCallbackURLSchemeCompletionHandler(url, redirectUrl, function (callbackURL, error) { | ||
if (!error) { | ||
self.redirectResolve({ | ||
_this.redirectResolve({ | ||
type: 'success', | ||
@@ -116,13 +144,16 @@ url: callbackURL.absoluteString | ||
else { | ||
self.redirectResolve({ | ||
_this.redirectResolve({ | ||
type: 'cancel' | ||
}); | ||
} | ||
self.flowDidFinish(); | ||
_this.flowDidFinish(); | ||
}); | ||
self.authSession.start(); | ||
if (utils_1.ios.MajorVersion >= 13) { | ||
_this.authSession['presentationContextProvider'] = _this; | ||
} | ||
_this.authSession.start(); | ||
})]; | ||
} | ||
else { | ||
self.flowDidFinish(); | ||
this.flowDidFinish(); | ||
response = { | ||
@@ -137,4 +168,4 @@ type: 'cancel', | ||
}); | ||
}, | ||
closeAuth: function () { | ||
}; | ||
InAppBrowserModule.prototype.closeAuth = function () { | ||
if (utils_1.ios.MajorVersion >= 11) { | ||
@@ -153,7 +184,10 @@ var authSession = this.authSession; | ||
} | ||
}, | ||
dismissWithoutAnimation: function (controller) { | ||
}; | ||
InAppBrowserModule.prototype.presentationAnchorForWebAuthenticationSession = function (session) { | ||
return UIApplication.sharedApplication.keyWindow; | ||
}; | ||
InAppBrowserModule.prototype.dismissWithoutAnimation = function (controller) { | ||
var transition = CATransition.animation(); | ||
transition.duration = 0.0; | ||
transition.timingFunction = CAMediaTimingFunction.functionWithName(kCAMediaTimingFunctionEaseInEaseOut); | ||
transition.duration = 0; | ||
transition.timingFunction = CAMediaTimingFunction.functionWithName(kCAMediaTimingFunctionLinear); | ||
transition.type = kCATransitionFade; | ||
@@ -169,4 +203,4 @@ transition.subtype = kCATransitionFromBottom; | ||
}); | ||
}, | ||
safariViewControllerDidFinish: function (controller) { | ||
}; | ||
InAppBrowserModule.prototype.safariViewControllerDidFinish = function (controller) { | ||
if (!this.animated) { | ||
@@ -181,8 +215,9 @@ this.dismissWithoutAnimation(controller); | ||
} | ||
}, | ||
flowDidFinish: function () { | ||
}; | ||
InAppBrowserModule.prototype.flowDidFinish = function () { | ||
this.safariVC = null; | ||
this.redirectResolve = null; | ||
this.redirectReject = null; | ||
}, | ||
initializeWebBrowser: function (resolve, reject) { | ||
}; | ||
InAppBrowserModule.prototype.initializeWebBrowser = function (resolve, reject) { | ||
if (this.redirectResolve) { | ||
@@ -195,7 +230,7 @@ reject('Another InAppBrowser is already being presented.'); | ||
return true; | ||
} | ||
}, { | ||
protocols: [SFSafariViewControllerDelegate] | ||
}); | ||
exports.default = InAppBrowser.new(); | ||
}; | ||
InAppBrowserModule.ObjCProtocols = protocols; | ||
return InAppBrowserModule; | ||
}(NSObject)); | ||
exports.default = InAppBrowserModule.new(); | ||
//# sourceMappingURL=InAppBrowser.ios.js.map |
@@ -22,2 +22,3 @@ declare module 'nativescript-inappbrowser' { | ||
modalPresentationStyle?: | ||
| 'automatic' | ||
| 'fullScreen' | ||
@@ -37,3 +38,4 @@ | 'pageSheet' | ||
| 'partialCurl', | ||
modalEnabled?: boolean | ||
modalEnabled?: boolean, | ||
enableBarCollapsing?: boolean | ||
}; | ||
@@ -40,0 +42,0 @@ |
130
package.json
{ | ||
"name": "nativescript-inappbrowser", | ||
"version": "2.0.0", | ||
"description": "InAppBrowser for NativeScript", | ||
"main": "InAppBrowser", | ||
"typings": "index.d.ts", | ||
"nativescript": { | ||
"platforms": { | ||
"android": "6.0.0", | ||
"ios": "6.0.1" | ||
} | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/proyecto26/nativescript-inappbrowser.git" | ||
}, | ||
"scripts": { | ||
"tsc": "npm install && tsc", | ||
"build": "npm run tsc && npm run build.native", | ||
"build.native": "node scripts/build-native.js", | ||
"postclone": "npm i && node scripts/postclone.js && cd ../demo && npm i && npx rimraf -- package-lock.json && cd ../src", | ||
"test.android": "npm run tsc && npm run tslint && cd ../demo && tns build android && tns test android --justlaunch", | ||
"test.ios": "npm run tsc && npm run tslint && cd ../demo && tns build ios && tns test ios --justlaunch", | ||
"tslint": "cd .. && tslint \"**/*.ts\" --config tslint.json --exclude \"**/node_modules/**\"", | ||
"demo.ios": "npm run tsc && cd ../demo && tns run ios --emulator", | ||
"demo.android": "npm run tsc && cd ../demo && tns run android --emulator", | ||
"demo.reset": "cd ../demo && npx rimraf -- hooks node_modules platforms package-lock.json", | ||
"plugin.prepare": "npm run build && cd ../demo && tns plugin remove nativescript-inappbrowser && tns plugin add ../src", | ||
"clean": "npm run demo.reset && npx rimraf -- node_modules package-lock.json && npm i", | ||
"ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**' --exclude '**/platforms/**'", | ||
"prepack": "npm run build.native" | ||
}, | ||
"keywords": [ | ||
"NativeScript", | ||
"JavaScript", | ||
"Android", | ||
"iOS", | ||
"browser", | ||
"inappbrowser", | ||
"in-app-browser", | ||
"InAppBrowser" | ||
], | ||
"author": { | ||
"name": "Juan David Nicholls Cardona", | ||
"email": "jdnichollsc@hotmail.com" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/proyecto26/nativescript-inappbrowser/issues" | ||
}, | ||
"license": "MIT", | ||
"homepage": "https://github.com/proyecto26/nativescript-inappbrowser", | ||
"readmeFilename": "README.md", | ||
"devDependencies": { | ||
"prompt": "^1.0.0", | ||
"rimraf": "^2.6.3", | ||
"semver": "^6.3.0", | ||
"tns-core-modules": "^6.0.2", | ||
"tns-platform-declarations": "^6.0.2", | ||
"tslint": "^5.18.0", | ||
"typescript": "~3.5.3" | ||
}, | ||
"dependencies": {}, | ||
"bootstrapper": "nativescript-plugin-seed" | ||
"name": "nativescript-inappbrowser", | ||
"version": "2.1.0", | ||
"description": "InAppBrowser for NativeScript", | ||
"main": "InAppBrowser", | ||
"typings": "index.d.ts", | ||
"nativescript": { | ||
"platforms": { | ||
"android": "6.0.0", | ||
"ios": "6.0.1" | ||
} | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/proyecto26/nativescript-inappbrowser.git" | ||
}, | ||
"scripts": { | ||
"tsc": "npm i && tsc", | ||
"build": "npm run tsc && npm run build.native", | ||
"build.native": "node scripts/build-native.js", | ||
"test.android": "npm i && npm run tsc && npm run tslint && cd ../demo && tns build android && tns test android --justlaunch", | ||
"test.ios": "npm i && npm run tsc && npm run tslint && cd ../demo && tns build ios && tns test ios --justlaunch", | ||
"tslint": "cd .. && tslint \"**/*.ts\" --config tslint.json --exclude \"**/node_modules/**\"", | ||
"ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**' --exclude '**/platforms/**'", | ||
"prepack": "npm run build.native", | ||
"demo.ios": "npm i && cd ../demo && tns run ios --inspector", | ||
"demo.android": "npm i && cd ../demo && tns run android", | ||
"demo.reset": "cd ../demo && npx rimraf -- hooks node_modules platforms package-lock.json", | ||
"plugin.prepare": "npm run build && cd ../demo && tns plugin remove nativescript-inappbrowser && tns plugin add ../src", | ||
"clean": "npm run demo.reset && npx rimraf -- node_modules package-lock.json && npm i" | ||
}, | ||
"keywords": [ | ||
"NativeScript", | ||
"JavaScript", | ||
"Android", | ||
"iOS", | ||
"browser", | ||
"inappbrowser", | ||
"in-app-browser", | ||
"InAppBrowser", | ||
"Chrome", | ||
"Safari", | ||
"Chrome Custom Tabs", | ||
"SafariServices", | ||
"AuthenticationServices", | ||
"SFSafariViewController", | ||
"CustomTabsIntent", | ||
"ChromeTabsManagerActivity" | ||
], | ||
"author": { | ||
"name": "Juan David Nicholls Cardona", | ||
"email": "jdnichollsc@hotmail.com" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/proyecto26/nativescript-inappbrowser/issues" | ||
}, | ||
"license": "MIT", | ||
"homepage": "https://github.com/proyecto26/nativescript-inappbrowser", | ||
"devDependencies": { | ||
"tns-core-modules": "^6.2.1", | ||
"tns-platform-declarations": "^6.2.1", | ||
"typescript": "~3.7.2", | ||
"prompt": "^1.0.0", | ||
"rimraf": "^3.0.0", | ||
"tslint": "^5.20.1", | ||
"semver": "^6.3.0" | ||
}, | ||
"dependencies": {}, | ||
"bootstrapper": "nativescript-plugin-seed" | ||
} |
@@ -8,11 +8,14 @@ <p align="center"> | ||
</a> | ||
<a href="https://travis-ci.org/proyecto26/nativescript-inappbrowser"> | ||
<img src="https://travis-ci.org/proyecto26/nativescript-inappbrowser.svg?branch=master" alt="Build Status" /> | ||
</a> | ||
<a href="https://github.com/proyecto26/nativescript-inappbrowser/graphs/commit-activity"> | ||
<img src="https://img.shields.io/badge/Maintained%3F-yes-brightgreen.svg" alt="Maintenance" /> | ||
</a> | ||
<a href="https://tidelift.com/subscription/pkg/npm-nativescript-inappbrowser?utm_source=npm-nativescript-inappbrowser&utm_medium=referral&utm_campaign=readme"> | ||
<img src="https://tidelift.com/badges/package/npm/nativescript-inappbrowser" alt="Tidelift Subscription" /> | ||
</a> | ||
<a href="https://opencollective.com/proyecto26" alt="Financial Contributors on Open Collective"> | ||
<img src="https://opencollective.com/proyecto26/all/badge.svg?label=financial+contributors" /> | ||
</a> | ||
<a href="https://travis-ci.org/proyecto26/nativescript-inappbrowser"> | ||
<img src="https://travis-ci.org/proyecto26/nativescript-inappbrowser.svg?branch=master" alt="Build Status" /> | ||
</a> | ||
<a href="https://npmjs.org/package/nativescript-inappbrowser"> | ||
@@ -42,2 +45,4 @@ <img src="http://img.shields.io/npm/dm/nativescript-inappbrowser.svg" alt="Downloads" /> | ||
## Usage | ||
@@ -62,5 +67,6 @@ | ||
`animated` (Boolean) | Animate the presentation. [`true`/`false`] | ||
`modalPresentationStyle` (String) | The presentation style for modally presented view controllers. [`none`/`fullScreen`/`pageSheet`/`formSheet`/`currentContext`/`custom`/`overFullScreen`/`overCurrentContext`/`popover`] | ||
`modalPresentationStyle` (String) | The presentation style for modally presented view controllers. [`automatic`/`none`/`fullScreen`/`pageSheet`/`formSheet`/`currentContext`/`custom`/`overFullScreen`/`overCurrentContext`/`popover`] | ||
`modalTransitionStyle` (String) | The transition style to use when presenting the view controller. [`coverVertical`/`flipHorizontal`/`crossDissolve`/`partialCurl`] | ||
`modalEnabled` (Boolean) | Present the **SafariViewController** modally or as push instead. [`true`/`false`] | ||
`enableBarCollapsing` (Boolean) | Determines whether the browser's tool bars will collapse or not. [`true`/`false`] | ||
@@ -98,5 +104,6 @@ ### Android Options | ||
animated: true, | ||
modalPresentationStyle: 'overFullScreen', | ||
modalPresentationStyle: 'fullScreen', | ||
modalTransitionStyle: 'partialCurl', | ||
modalEnabled: true, | ||
enableBarCollapsing: false, | ||
// Android Properties | ||
@@ -178,3 +185,7 @@ showTitle: true, | ||
Support [me](http://www.paypal.me/jdnichollsc/2), if you do too. | ||
[Professionally supported nativescript-inappbrowser is coming soon](https://tidelift.com/subscription/pkg/npm-nativescript-inappbrowser?utm_source=npm-nativescript-inappbrowser&utm_medium=referral&utm_campaign=readme) | ||
## Security contact information 🚨 | ||
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. | ||
## Happy coding 💯 | ||
@@ -181,0 +192,0 @@ Made with ❤️ |
/// <reference path="./node_modules/tns-platform-declarations/ios.d.ts" /> | ||
/// <reference path="./node_modules/tns-platform-declarations/android.d.ts" /> | ||
/// <reference path="./types/android.d.ts" /> | ||
/// <reference path="./types/android.d.ts" /> | ||
/// <reference path="./types/ios.d.ts" /> | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
55717
13.48%21
5%842
16.3%190
6.15%