Is it possible to build the windows desktop app at fullscreen? 'Cause initially when I run my app, the size is at 1200x900.
In my config.xml I have this <preference name="Fullscreen" value="true" />
I also have this code based on my research from cordova-plugin-statusbar :
this.platform.ready().then(() => {
StatusBar.hide();
});
But I have no luck in running the app at fullscreen for Windows. I have found a solution but only for android:
if (this.platform.is("android")) {
this.androidFullScreen.isImmersiveModeSupported().then(
() => this.androidFullScreen.immersiveMode()
).catch((error: any) => console.log(error));
}
you can try below code , add in page.ts file
ionViewWillEnter() {
this.statusBar.overlaysWebView(true);
}// where you want full screen
ionViewWillEnter() {
this.statusBar.overlaysWebView(true);
}// where you want normal screen
Related
Note:
Cypress is a great tool for automating. I am new in Cypress world. I really like the way how we can take actions and make assertions on the same line of code.
However, I met a hard problem, that I am not able to process. I am sure that this is handled in some way, but after 2 days of researching (about 6 hours), I'm running out of energy.
Description:
I am trying (learning to use Cypress) to automate this example. I am not able to automate (button) "New Tab" functionality. I don't want to think about how can I solve this 'quest' and how can I automate the other two (buttons) "New WIndow" and "New WIndow Message" functionalities. Here is a screenshot of the HTML document:
My code:
I try to solve this by using the first answer from this topic.
/// <reference types="cypress" />
describe('Example shows how to work with browser windows.', () => {
it('Example shows how to work witn button that opens new tab without "target: _blank" and "href" attributes.', () => {
cy.visit('https://demoqa.com/browser-windows')
cy.window().then(win => {
cy.stub(win, 'open').as('open')
})
cy.xpath('//*[#id="tabButton"]').click()
cy.get('#open').should('have.been.calledOnceWithExactly', '/sample')
})
})
I am not sure what I miss.
Your example is not following the link's code you have provided. I have refactored your code, tested & it's working:
/// <reference types="cypress" />
describe('Example shows how to work with browser windows.', () => {
it('Example shows how to work witn button that opens new tab without "target: _blank" and "href" attributes.', () => {
cy.visit('https://demoqa.com/browser-windows', {
onBeforeLoad(win) {
cy.stub(win, 'open')
}
});
cy.get('#tabButton').click();
cy.window().its('open').should('be.called');
cy.get('#windowButton').click();
cy.window().its('open').should('be.called');
cy.get('#msgWindowButtonWrapper').click();
cy.window().its('open').should('be.called');
});
});
Results:
I have a ionic 3 app and want to execute code to get my user data just when app is launched, when the splash screen is showing and the app pages have not yet been rendered.
I currently do this when app has fired the appReady event but am interested if I can win another 2 seconds witch usually takes during the splash screen.
export class AppModule {
constructor(private platform: Platform,
private storage: Storage) {
this.platform.ready().then(() => {
this.storage.get('id_token').then((token) => {
this.initUserData(token);
});
});
}
}
I'm trying to open the browser window without leaving the app when I click a URL (for both iOS and Android).
The behavior should be as follows (with airbnb app example):
Clicks in "Terms and conditions" link: links example
Open the browser in-app:
For iOS: in-app browser iOS
Same for Android.
How can I do this? Do I need to use any specified existing library?
I'm using react-native 0.37.
You can use the new InAppBrowser plugin for React Native, check the next example:
import { Linking } from 'react-native'
import InAppBrowser from 'react-native-inappbrowser-reborn';
...
async openLink() {
try {
const isAvailable = await InAppBrowser.isAvailable()
const url = 'https://www.google.com'
if (isAvailable) {
InAppBrowser.open(url, {
// iOS Properties
dismissButtonStyle: 'cancel',
preferredBarTintColor: 'gray',
preferredControlTintColor: 'white',
// Android Properties
showTitle: true,
toolbarColor: '#6200EE',
secondaryToolbarColor: 'black',
enableUrlBarHiding: true,
enableDefaultShare: true,
forceCloseOnRedirection: true,
}).then((result) => {
Alert.alert(JSON.stringify(result))
})
} else Linking.openURL(url)
} catch (error) {
Alert.alert(error.message)
}
}
...
On the other hand, you can use this plugin with deep linking, check the README of the project.
Opens Safa Module Method
On iOS SafariView 3rd party native module - https://github.com/naoufal/react-native-safari-view
On Android CustomTabs 3rd party native module - https://github.com/droibit/react-native-custom-tabs - however if the user does not have Chrome installed, it will pop open the link outside of your app in their default browser.
Alternative WebView Method
You can use a <WebView> but this is not using the real browser - http://facebook.github.io/react-native/releases/0.47/docs/webview.html#webview
import React, { Component } from 'react';
import { WebView } from 'react-native';
class MyWeb extends Component {
render() {
return (
<WebView
source={{uri: 'https://github.com/facebook/react-native'}}
style={{marginTop: 20}}
/>
);
}
}
Use React Native Custom Tabs to open in-app browser window in React native. It support both platform Android and iOS
You can use React Native In-App Browser Reborn. It works perfectly on both Android and iOS.
This library use react-native-safari-view (SafariView) on iOS and react-native-custom-tabs (ChromeView) on Android.
Use native react native linking to open a url
https://reactnative.dev/docs/linking
Below is stock code from the Electron website (https://electron.atom.io/docs/tutorial/quick-start/):
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
On Mac OS 10.12.4, when the above is called, it will not close the app. Only the window. Adding app.quit() above the conditional does close the app. Did they leave something out specific to Mac OS X that prevents the app from closing?
You will want to learn how to read comments in code. Here's the full excerpt from the page you linked:
// Quit when all windows are closed.
app.on('window-all-closed', () => {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
The two lines above the if-statement correlate to the if-statement. This basically says that we are not quitting the app on macOS because this is a common functionality found in other apps.
I used following function for the windows mobile app(phonegap) to handle the backbutton navigation function.
function onBackKeyDown() {
var currentPageId = $.mobile.activePage.attr('id');
if(currentPageId == 'contact-us' || currentPageId == 'about-us' || currentPageId == 'location-map' || currentPageId == 'services'){
$.mobile.changePage("index.html", {
transition : "slide",
reverse : true,
changeHash : false
});
}else{
navigator.app.exitApp();
}
}
I wanted to come to the index if the current page is not index. Otherwise exit the app.
It seems like navigator.app.exitApp() doesn't work in windows phone 7. Is there any solution for overcome this issue.
This plugin came in handy for me.
http://shinymetilda.github.io/Cordova_Exit_Plugin/
Add the .cs file to your plugin directory.
Add the following code to config.xml
<feature name="AppTerminate">
<param name="wp-package" value="AppTerminate" />
</feature>
write this code instead of navigator.app.exitApp()
cordova.exec(null, null, "AppTerminate", "execute", []);