Splash screen with background task

Hi all,

I have gone through couple of examples for splash screens but didn’t find anything which is related to my requirement…

My requirement is :

  1. when i start the app it should show splash screen for 10 seconds.

  2. Meanwhile my background task needs to work… e.g verifying internet is working on the device or not, which connection user is using like 3g, 4g, wifi etc…, and so on…

  3. If above condition is not satisfied then i need to show ionic popup with message and need to close the app forcefully…

I hope i’ll get the solution with ionic splash screen…

Please guide me the solution or suggest me the best way to get the above solution.

Thank you…

Hi,

On your requirements, the below is my response:

  1. when i start the app it should show splash screen for 10 seconds.
    Response: Possible. Set the splash screen timeout to 10 seconds in config.xml
    Solution:

  2. Meanwhile my background task needs to work… e.g verifying internet is working on the device or not, which connection user is using
    like 3g, 4g, wifi etc…, and so on…
    Response: Possible
    Solution:
    In your config, set $urlRouterProvider.otherwise(“splash”);

Create a splash screen in a new page which looks like ur current splash screen.
Set all your tasks mentioned above in sequence, these tasks dont take much time, so yoou should be able to do all these tasks befre the completion of 10 sseconds. Once all is successful, do a redirection to a new page.

3)If above condition is not satisfied then i need to show ionic popup with message and need to close the app forcefully…
Response: NOT possible. In Android, you can push the app to background, but not possible in iOS. In both platforms, you cannot close the apps.

1 Like