Cody Blue
Posts: 0
Joined: Sun Aug 25, 2013 2:11 am

Opening iOS app on start page evertime

I am running an app developed via Appery on iOS device. When I open it for the first time things are as expected and the app opens at the "start page" as set in Appery settings.

When the app is closed and opened again, it opens on the page where it was closed. I would however want it to open at the start page (again as set in Appery settings).

How may I accomplish this?

Regards.

obullei
Posts: 0
Joined: Thu Jun 05, 2014 12:17 am

Opening iOS app on start page evertime

Hello!
You can change start screen in Project -- App Settings--General--Start Page

Cody Blue
Posts: 0
Joined: Sun Aug 25, 2013 2:11 am

Opening iOS app on start page evertime

Hi!

Request you to review my description carefully. I know how to change start screen in Appery. I am mentioning the scenario when app is installed on device (iOS) and opened there. It does not open on start screen everytime by default, but open at the page it was last closed. My question is how can I achieve the opening always on start page.

Regards

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Opening iOS app on start page evertime

Dear Cody,

Unfortunately, we don't have ready solutions.
It depends on your app logic, which fall outside the scope of our support. Please search online for solutions.

Cody Blue
Posts: 0
Joined: Sun Aug 25, 2013 2:11 am

Opening iOS app on start page evertime

Alena,

Apologies, but isn't Appery's mission to help users in being able to deploy application on devices? I am not requesting support on any fancy/custom feature, but something very basic. The issue is that when the app is opened on iOS device, it opens on the page it was last closed at. This is fine until the point that the session token expires (user open the app after a while) causing all sorts of problems and services to fail. Is there a way for me to detect this within the project code and custom tailor my implementation with Appery code. Since the problem is so specific to your platform, I am unfortunately not able to find solutions by just searching online.

Regards.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Opening iOS app on start page evertime

Hello!

Could you clarify if you want to open app on start screen from background mode?

Cody Blue
Posts: 0
Joined: Sun Aug 25, 2013 2:11 am

Opening iOS app on start page evertime

Here is the current behavior and what we are expecting to achieve for an app developed with Appery.io and installed on an iOS device.

1) User opens the app (on actual device)
2) User closes the app (lets say display page at time of close was "samplePage")
3) User opens the app again

In step 3, the app opens at "samplePage". Instead, at the very minimum, we want it to open at startPage as set within Appery.

Regads.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Opening iOS app on start page evertime

Hi Cody,

Phonegap supports "pause"(when app collapsed) and "resume"(when app expanded).

You can read about it here: http://docs.phonegap.com/en/3.5.0/cor...

So please follow this solution:

1 Add new JS asset.

2 Use following code for this asset:

add "resume" event handler and use there code:

pre

var onResume = function(){

Code: Select all

 alert("resume app"); 

 //Note: you should replace "startPage" with your start page name. 
 Apperyio.navigateto("startPage"); 

};

document.addEventListener("resume", onResume , false);

/pre

Regards.

Cody Blue
Posts: 0
Joined: Sun Aug 25, 2013 2:11 am

Opening iOS app on start page evertime

Hi Yurii,

Excellent! Many thanks, as always. Things work as expected. One minor typo for folks in community who may use your suggested code: Appery.navigateTo needs a capital T.

I have couple of follow up questions:
1) the app now navigates to "startPage" as set in App settings in Appery but the launch image (as set in iOS binary within Appery app settings) is bypassed. Is there a way to direct the app to launch image instead?
2) with your recommended change when the app is closed and opened again, the originally displayed page (before close) shows up before the app navigates to "startPage". This is bit of disruption with user experience. I wonder if you have suggestions to make the "startPage" (or ideally launch image) show up directly when the app is opened (after being closed) without the originally displayed page (before close) showing up.

I am bringing this up as most current apps tend to follow the above format/protocol and it might be beneficial for developer community on this forum (besides my selfish interests of course)

Regards.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Opening iOS app on start page evertime

Hi Cody,

  1. Unfortunatly you can not display splash screen when you need. But, you can create "splashScreen" page with splash image on full size and show it when you need.

  2. Unfortunatly i don't have same examples. But i guess you can try following(if you ready to go ahead).

    2.1. Add "resume" event handler to new CSS asset:

    pre

    var onResume = function(){

    jQuery(".hideElement").remove();

    //You should use here your splash screen image.
    var hideElement = jQuery('');

    //Hide current page with imitation of splash screen.
    jQuery("body").append(hideElement);

    //Note: you should replace "startPage" with your start page name.
    Apperyio.navigateto("startPage");
    };
    document.addEventListener("resume", onResume , false);

    /pre

    2.2. On start "startPage" screen "page show" event handler add following js code:

    pre

    //Remove "splashScreen" after new page has been loaded.
    jQuery(".hideElement").remove();

    /pre

    Regards.

Return to “Issues”