question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Platform cordova return false

See original GitHub issue

Hello, How I can return webview platform with capacitor? I’m using ionic platform but everytime the verification returns false.

Import: import {Platform} from '@ionic-angular'

Inject in constructor…

checking:

if(this.platform.is('cordova'){
console.log('is webview');
} else {
console.log('isn't webview');
}

Everytime i’m receiving isn’t webview in device

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jcesarmobilecommented, May 17, 2018

You can use device plugin https://capacitor.ionicframework.com/docs/apis/device. Check that the platform value is ios or android, when using the web implementation it has “pwa” value even when tested on mobile devices.

For this.platform.is(‘cordova’) not being true, that’s an Ionic bug. In Ionic 3 I’ve tested and returns 3, on Ionic 4 I think it has been fixed recently, but maybe it’s not released yet.

0reactions
ttibaucommented, May 17, 2018

That’s works! Thank You! Um abraço do Brasil! 💚 💛

Read more comments on GitHub >

github_iconTop Results From Across the Web

Platform.is("cordova") return false on some iOS 11 devices
Inside platform.ready() callback I check whether this is a mobile device with cordova or if it is a local ionic serve runtime.
Read more >
this.platform.is('ios') return false for iPad after update ... - GitHub
It is working fine on iPhone but when I run the app on Ipad it always returns false. This issue happened when i...
Read more >
ionic Cordova appAvailability always return false
I saw it in another answer somewhere, but it was something about making sure the plist was updated. Here was the original answer, ......
Read more >
cordova-plugin-device
model returns the name of the device's model or product. The value is set by the device manufacturer and may be different across...
Read more >
The 9 Most Common Mistakes That Ionic Developers Make
Common Mistake #6: Trying to Run Cordova Plugins Inside the Browser. The majority of developers using Ionic will want their app to run...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found