I wonder if it's possible delete the transition that leads to my WP8.1 universal app when it's launched. So, when my app is launched, I want it to just show the SplashScreen without any animation. I've already read this and this questions, but since I'm not navigating between pages within my app, I can't just set "ContentTransitions" of my frame to null.
Does anybody have any information on this? Or is it just not possible, since these "launching" transitions are managed by the OS?
Disable the animations on the Frame, hook up the Frame`s navigated event and enable them back after first navigation. I have a post about this here.
The initial splash screen is displayed by the OS until you call Window.Current.Activate(). You cannot disable/modify this transition, and you should also not try to do so as your app will lose parity with the rest of OS ecosystem.
Related
Im interested in firing a function when a user quits the app, meaning they bring up multi-tasking and close-out the app.
I'm not talking about navigating back to your home screen and keeping the app in the background.
I'm aware of AppState, but as I said, im looking for the suit scenario, not a change from active, to the background
Is this possible, my componentWillUnmount() is not firing in this case?
Here is an example using an OS background task and additional library. That might be your best bet without using AppState/ComponentDidUnmount() which would only detect active/background status:
https://github.com/billmalarky/react-native-queue#os-background-task-full-example
componentWillUnmount() won't fire because that's only when a component is being removed from the DOM.
The JavaScript engine closes when the app does so there's no other way to communicate with it once the app is closed.
I'm working on a React Native app that uses a WebView as the app's main screen.
When the app comes from the background to the foreground the WebView reloads. How can I stop this reloading?
This answer suggests loading the WebView in ViewDidLoad() rather than in ViewDidAppear() or ViewWillAppear(). Is this a real solution and how can I confirm, or change, how the WebView is loaded by React Native?
As a hacky solution I'm using onNavigationStateChange to save the current URL in AsyncStorage and then load this URL when the app comes to the foreground. This solution isn't great because it:
Breaks the browser history, affecting javascript back buttons
Doesn't remember form state
Might send the user to a page they can't directly access, resulting in them being sent to a 404
So I'd much prefer a solution that stops the reloading, at least for situations when the app is only momentarily in the background.
This was not and issue with the WebView. The reloading was caused by my misuse of the React Navigation SwitchNavigator. As mentioned in the docs a SwitchNavigator
resets routes to their default state when you switch away
This reset caused the WebView to reload.
I have my problem still unsolved Splash screen is landscape although the whole game is in the portrait mode. SpriteBuilder + cocos2d , so I see only one way.
How to remove splash screen at all, so that game loads at once ?
This is not possible. An image named Default.png (or under a similar name, depending on the device and what the app supplied) is always loaded when an app launches.
This is done by iOS specifically because no app can technically launch instantly (as in: within a tenth of a second or two).
I know the question is old, but I had the same problem and I solved it specifying none in "Launch screen file" (under General settings).
When switching between a Home Screen HTML web app to another app and back (iOS 7), the web app screenshot is just of a blank page. Is there a way of ensuring the screenshot reflects the actual state of the app before it went into background mode?
I think its because your app gets reloaded everytime. You might want to look at this thread here or here.
It looks like it is default behaviour and the only way you can work around this is to use localStorage.
EDIT: Of course you would have to save the state of your app everytime the user makes an interaction since you do not have AppDelegate methods which get triggered when your app goes to background.
I want to hide the screen splah of my app and i'm trying to do this with Cordova function navigator.splashscreen.hide() according to this
function wlEnvInit(){
wlCommonInit();
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
alert("device is ready!");
navigator.splashscreen.hide();
}
}
I placed this code on android/js/myAppName.js and iphone/js/myAppName.js folders. It does not work. There is something wrong?
I assume what you're trying to do is to hide the splash image at a point in time based on your own preference? This is currently not possible.
Worklight bypasses Cordova's splash image mechanism as well as does not provide an API to manipulate its duration programmatically (= choose when to hide it). This is an area that is destined to change in a future release.
If what you're trying to do is to simply not show a splash image at all, then:
In iOS: this is not possible. The splash image is mandatory by Apple
In Android: simply delete the splash.9.png image file from the yourProject\apps\yourApp\android\native\res\drawable folder
BTW, I do not see the use for the deviceready listener, because if you've reached wlCommonInit, then the device (Cordova...) has already been initialized. The app would not have functioned otherwise.
For the time being, a workaround for it would be by replacing the Splash screen image with a complete white background screen/image.