iPhone无法识别PhoneGap的navigator.app [英] iPhone does not recognize PhoneGap's navigator.app

查看:224
本文介绍了iPhone无法识别PhoneGap的navigator.app的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个按钮退出应用程序。该函数如下所示:

I have a button to exit from the application. The function looks like this:

//Close application
function close_window() {
  navigator.app.exitApp();
}

它没有工作,所以我试了下面这行:

It did not work, so I tried the following line:

navigator.device.exitApp();

它也没有工作。然后我通过警报发现iPhone不能识别PhoneGap的navigator.app和navigator.device。我使用PhoneGap版本2.2.0。

It did not work either. Then I discovered by alert that the iPhone does not recognize PhoneGap's navigator.app and navigator.device. I use PhoneGap version 2.2.0.

为什么会发生这种情况?

Why is this happening?

PS: Android。

P.S.: It works for me on Android.

推荐答案

navigator.app.exitApp()在iOS在iOS上,Apple不允许应用程序以编程方式退出。

navigator.app.exitApp() does not work on IOS, only Android. On iOS, Apple does not allow apps to programmatically exit.

它可以通过iOS目标c端完成,但这个应用程序很有可能在Apple应用商店被拒绝。

It can be done through iOS objective c side but there's a good chance this app will be rejected in Apple app store.

您可以在这里找到一个很好的解释: https://groups.google.com / forum /?fromgroups =#!topic / phonegap / XjTm0ua4uOY

Here you will find a good explanation: https://groups.google.com/forum/?fromgroups=#!topic/phonegap/XjTm0ua4uOY.

这篇关于iPhone无法识别PhoneGap的navigator.app的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆