minimize iOS-Phonegap/Cordova App

岁酱吖の 提交于 2020-01-15 16:40:30

问题


In a Phonegap Javascript app I close the Android Version of this app with navigator.app.exitApp();

As we know, closing apps is not allowed in iOS. But the iPad User can minimize the app into the background e.g. by swiping.

Two questions:

  1. Is it possible that I could minimize the app programmatically?

  2. Is there an event when the user minimizes the app?


回答1:


This concerns your point Nr 2: When the App is minimized, i.e. put to the background, the "pause" Event is fired and can be handled. See details in the documentation: http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#pause

[UPDATE]: This concerns Nr.1: you could write a phonegap plugin that let's you call another intent, i.e. the Home Screen, which would automatically put your app into background, without terminating it. See also Pause an Android App with Phonegap



来源:https://stackoverflow.com/questions/13739506/minimize-ios-phonegap-cordova-app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!