Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(inappbrowser): implement instance based wrapper #305

Merged
merged 7 commits into from
Aug 11, 2016
Merged

Conversation

ihadeed
Copy link
Collaborator

@ihadeed ihadeed commented Jul 17, 2016

This wrapper makes the inappbrowser instance based instead of being static.

The .open() method that we currently have returns InAppBrowserRef which had some functions that take callbacks as parameters. And since one of the major goals of ionic-native is to convert all callbacks to promises and observables, this wrapper seem to make more sense.

I also added a fallback that will use window.open() in a scenario where cordova or cordova.InAppBrowser is not available.

Closes #247

@ihadeed ihadeed modified the milestones: 1.3.5, 1.3.7 Jul 17, 2016
@ihadeed ihadeed removed this from the 1.3.7 milestone Jul 18, 2016
@ihadeed ihadeed changed the title New wrapper for InAppBrowser feat(inappbrowser): implement instance based wrapper Jul 18, 2016
@ihadeed ihadeed added this to the v1.3.10 milestone Jul 21, 2016
})
static open(url: string, target?: string, options?: string): InAppBrowserRef { return; }

on(event: string): Observable<InAppBrowserEvent> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of this function? Is this generic and something we could abstract for other plugins?

@mlynch
Copy link
Collaborator

mlynch commented Jul 26, 2016

Looks like a nice improvement. Added a few comments on a few lines. Basically, it needs a simple usage comment and then I was confused by on() feeling like a generic thing that we might want to export as an abstraction for other plugins

@ihadeed
Copy link
Collaborator Author

ihadeed commented Jul 28, 2016

The on function wraps this function here: https://github.com/apache/cordova-plugin-inappbrowser#inappbrowseraddeventlistener

@ihadeed ihadeed modified the milestones: v1.3.10, v1.3.11 Jul 31, 2016
@ihadeed ihadeed merged commit 4b8ab4a into master Aug 11, 2016
@ihadeed ihadeed deleted the new-browser branch August 11, 2016 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants