Cordova Android Build Показывает диалоговое окно ввода, как работает в браузере - PullRequest
0 голосов
/ 02 января 2019

Привет, у меня проблемы с отображением вида камеры в моем проекте Cordova с использованием wikitude SDK, который представляет собой плагин дополненной реальности для cordova. Это похоже на открытие камеры, но как только она начинает открываться, появляется диалоговое окно ввода, которое похоже на то, которое появляется в вашем браузере, когда вы запускаете приложение в браузере с помощью команды

cordova serve

Дело в том, что я запускаю его на реальном устройстве Android после сборки apk с помощью команды

cordova run android

Я все еще получаю диалог ввода

enter image description here

даже работает в устройстве Android. Я сделал так много проекта Cordova, и я знаю, что он не будет отображаться на устройстве Android, а только в браузере. После нажатия ОК все диалоговые окна ввода, которые показывают, что он выполняет

alert("Ar Experience Loaded Successfully");

Вопрос теперь в том, как отключить диалоговое окно ввода, чтобы показать спасибо

вот мой код: index.js

var app = {

// Url/Path to the augmented reality experience you would like to load
arExperienceUrl: "www/index.html",
// The features your augmented reality experience requires, only define the ones you really need
requiredFeatures: [ "image_tracking"],
// Represents the device capability of launching augmented reality experiences with specific features
isDeviceSupported: false,
// Additional startup settings, for now the only setting available is camera_position (back|front)
startupConfiguration:
{
    "camera_position": "back"
},
// Application Constructor
initialize: function() {
    this.bindEvents();
},
// Bind Event Listeners
//
// Bind any events that are required on startup. Common events are:
// 'load', 'deviceready', 'offline', and 'online'.
bindEvents: function() {
    document.addEventListener('deviceready', this.onDeviceReady, false);
},
// deviceready Event Handler
onDeviceReady: function() {
    app.wikitudePlugin = cordova.require("com.wikitude.phonegap.WikitudePlugin.WikitudePlugin");
    app.wikitudePlugin.isDeviceSupported(app.onDeviceSupported, app.onDeviceNotSupported, app.requiredFeatures);
},
// Callback if the device supports all required features
onDeviceSupported: function() {


    app.wikitudePlugin.loadARchitectWorld(
        app.onARExperienceLoadedSuccessful,
        app.onARExperienceLoadError,
        app.arExperienceUrl,
        app.requiredFeatures,
        app.startupConfiguration
    );
},
// Callback if the device does not support all required features
onDeviceNotSupported: function(errorMessage) {

},
// Callback if your AR experience loaded successful
onARExperienceLoadedSuccessful: function(loadedURL) {
    /* Respond to successful augmented reality experience loading if you need to */
     alert("Ar Experience Loaded Successfully");
},
// Callback if your AR experience did not load successful
onARExperienceLoadError: function(errorMessage) {
    alert(errorMessage);
}
};

app.initialize();

index.html

<!DOCTYPE html>

<html>
<head>

    <meta name="format-detection" content="telephone=no">
    <meta name="msapplication-tap-highlight" content="no">
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
    <link rel="stylesheet" type="text/css" href="css/index.css">
    <title>Hello World</title>
</head>
<body>


    <script type="text/javascript" src="cordova.js"></script>
    <script type="text/javascript" src="js/index.js"></script>
</body>

...