Cordova Slack Digest

Wed, 20 Jan 2021 09:09:46 GMT

User count: 4335

Join the conversation at slack.cordova.io

Channel #general (19 messages)


Tue, 19 Jan 2021 15:09:03 GMT

@helpdesk.666 says

how do you check if inappbrowser is in hidden or shown status with only the object reference?

inAppBrowserRef.hide();

Then ideally you could check the status by

if ( inAppBrowserRef.status == 'hidden' )

I know you could set a global var whenever you call hide or show on the object, but I want to know how to check it based on the object alone.

Thanks

Tue, 19 Jan 2021 15:26:10 GMT

@norman137 says

Based on https://github.com/apache/cordova-plugin-inappbrowser/blob/master/www/inappbrowser.js

You can‘t. The plugin doesn’t store a variable to keep track of the status, nor offers an API to get the status from the native.

You‘re best workaround is probably to create an abstraction so that your application doesn’t use the in app browser APIs directly and instead call on your own class, which you can easily implement a variable to hold that information.

Tue, 19 Jan 2021 15:30:29 GMT

@helpdesk.666 says

Norman! You helped me out on linking the hardware back button to the .hide function,

https://github.com/apache/cordova-plugin-inappbrowser/issues/835|https://github.com/apache/cordova-plugin-inappbrowser/issues/835

thanks again. It works great. However, now I need to figure out how to check if the user has used that new feature and the browser is hidden

Tue, 19 Jan 2021 15:51:59 GMT

@noah.cooper says

anytime anyone asks about inappbrowser, i always say — cordova-plugin-safariviewcontroller is a whole lot better

Tue, 19 Jan 2021 15:54:08 GMT

@dpogue says

Definitely, but it lacks the (incredibly insecure) feature of allowing you to inject your own JS/CSS into the page you load, which a lot of people want

Tue, 19 Jan 2021 15:58:33 GMT

@noah.cooper says

fair point!

Tue, 19 Jan 2021 16:48:51 GMT

@jcesarmobile says

And knowing the urls where it navigates to, which a lot of other people uses for oauth and similar

Tue, 19 Jan 2021 16:52:16 GMT

@dpogue says

yeah, but also IAB should absolutely not be used for OAuth (see again the security issues with allowing injecting code into 3rd party login pages)

Tue, 19 Jan 2021 16:56:50 GMT

@helpdesk.666 says

Is it possible to use loadurl(“javascript:myCordovaFunction("test")”); Inside the inappbrowserDialog.java class to send a message back so I don‘t need to maintain a new plugin to send a message back? I’m just trying to navigate all the compilation errors I'm getting

Tue, 19 Jan 2021 17:06:01 GMT

@mikic.alek says

Hi guys, did anyone else experience viewport displacement after updating XCode and Android studio? I am a complete amateur in this, so I have no idea where to start, so I´d appreciate any hint. I posted it here: https://github.com/apache/cordova-android/issues/1152

Tue, 19 Jan 2021 17:09:07 GMT

@norman137 says

Well it‘s css that’s responsible for positioning your content. What css do you have that makes you think it should be positioned centered in the screen?

Tue, 19 Jan 2021 17:12:22 GMT

@timbru says

I’d say this is a CSS problem, too, since it affects all “when building from both Windows and macOS, on all Android and iOS versions I could test on.”

Tue, 19 Jan 2021 17:14:54 GMT

@mikic.alek says

Thanks!

Tue, 19 Jan 2021 17:17:53 GMT

@norman137 says

That‘s a whole lot of css, most of which I don’t think is related to your problem....

Glancing through it though, I don‘t see anything that looks like you’re trying to center anything, except for h1 text.

Tue, 19 Jan 2021 17:20:01 GMT

@norman137 says

You probably want to give an element a specific width, and set margin: auto or something similar, like so: https://jsfiddle.net/x5cfvk78/

Tue, 19 Jan 2021 17:20:55 GMT

@mikic.alek says

It was centered before, and suddenly it´s moved. Ok, I´ll try figuring out, thanks a lot!! 🙂

Tue, 19 Jan 2021 17:21:53 GMT

@norman137 says

Alternatively, you can use the position absolute trick for centering: https://jsfiddle.net/x5cfvk78/1/

Tue, 19 Jan 2021 17:23:34 GMT

@norman137 says

Or maybe favourite, using flexbox: https://jsfiddle.net/x5cfvk78/2/ but flexbox can be tricky to get right sometimes.

Tue, 19 Jan 2021 19:03:38 GMT

@mikic.alek says

I solved it, thanks a lot! <3

Channel #cordova-ios (1 messages)


Tue, 19 Jan 2021 15:14:31 GMT

@mario.kurzweil says

Can someone help me with my internal link problem?

Channel #plugins (3 messages)


Tue, 19 Jan 2021 20:14:26 GMT

@sshipsey says

hi all -

is there a correct way to conditionally include/exclude cordova plugins on a platform install/prepare? i would like to be able to generate a cordova platform e.g. ios but include different plugins based on some configuration. appreciate any ideas

Tue, 19 Jan 2021 20:18:22 GMT

@dpogue says

I don‘t think there’s currently a way to do that

Tue, 19 Jan 2021 21:09:03 GMT

@sshipsey says

darn. will probably just have to leverage the before_platform_add hook then. was hoping there was a more “cordova-ish” way. thanks.