Community
cancel
Showing results for 
Search instead for 
Did you mean: 
429 Views

iOS issue

Jump to solution

Hello

I got issue on iOS itunes ... .same code on Android with sucess !

Error message and app code attached

Thanks in advance for support and help me 

Marcos

Tags (2)
0 Kudos
1 Solution
PaulF_IntelCorp
Employee
432 Views
/*jslint browser:true, devel:true, white:true, vars:true */


function onAppReady() {
    if( navigator.splashscreen && navigator.splashscreen.hide ) {   // Cordova API detected
        navigator.splashscreen.hide() ;
    }

    var el ;
    el = document.getElementById("idColaboradores") ;
    el.addEventListener("click", eventColaboradores, false) ;

    el = document.getElementById("idCaes") ;
    el.addEventListener("click", eventCaes, false) ;

    el = document.getElementById("idGatos") ;
    el.addEventListener("click", eventGatos, false) ;

...etc...

}
document.addEventListener("deviceready", onAppReady, false) ;


// see https://github.com/apache/cordova-plugin-inappbrowser#cordovainappbrowseropen
var eventColaboradores = function() {

    // add code here to check to see if the network is available and usable
    // before doing the following...

    var url = "http://www.carolzerbini.com.br/colaboradores/colaboradores.asp" ;
    var target = "_self" ;              // or "_blank" or "_system", see docs for more
    var options = "location=off" ;      // see docs for more 
    var ref = cordova.InAppBrowser.open(url, target, options) ;

    // add code here to clean up, do other appropriate things, etc.
}


var eventCaes = function() {

    // add code here to check to see if the network is available and usable
    // before doing the following...

    var url = "http://url/to/caes" ;
    var target = "_self" ;              // or "_blank" or "_system", see docs for more
    var options = "location=off" ;      // see docs for more 
    var ref = cordova.InAppBrowser.open(url, target, options) ;

    // add code here to clean up, do other appropriate things, etc.
}


var eventGatos = function() {

    // add code here to check to see if the network is available and usable
    // before doing the following...

    var url = "http://url/to/gatos" ;
    var target = "_self" ;              // or "_blank" or "_system", see docs for more
    var options = "location=off" ;      // see docs for more 
    var ref = cordova.InAppBrowser.open(url, target, options) ;

    // add code here to clean up, do other appropriate things, etc.
}


...etc...

 

View solution in original post

27 Replies
PaulF_IntelCorp
Employee
327 Views

Marcos -- your app appears to be a page that contains a bunch of links to your web site. I suspect the problem is you need to include a CSP rule for your remote network resources. Please see the note regarding CSP rules and blank screens here > https://software.intel.com/en-us/forums/intel-xdk/topic/685395 <

327 Views

Hey Paul,

Yes exactly my app is a list view with list to my website ... because Apple sucks to approve new app and the data on app is update more than weekly ... so easier to update my site than a new app approval burocratic process on apple site :((((

So ...

Where I need to add on <meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline' data: gap: file: https://ssl.gstatic.com *  ">

On my project index.html or my website pages ?

On my case would be : 

<
meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline' data: gap: file: http://www.conteudoanimal.com.br *  ">

thanks in advance !

 

PaulF_IntelCorp
Employee
327 Views

Marcos -- in your index.html file. See this doc page and the links it provides for more details > https://software.intel.com/en-us/xdk/docs/using-cordova-whitelist-rules-with-intel-xdk < whitelists and CSP rules are complicated, so there is no simple answer I can provide. You may have to experiment to confirm what you need. The rules are not determined by the XDK, these are webview and Cordova features that we do not control. If in doubt, search the web for something like "cordova whitelist CSP rules".

327 Views

trying and cross fingers kkkkk

I update as Hell Apple reply kkk

327 Views

Still issue 

What to do ?
 

  • 2. 1 PERFORMANCE: APP COMPLETENESS

Hello,

Thank you for your resubmission. After further review, we still encountered the following issue:
 

Specifically, when we launch the app, it resolves to a screen that no further action is possible. Please see the attached screenshot for details.


Please run your app on a device to identify the issue(s), then revise and resubmit your app for review.

Apps are reviewed on an I

Pv6 network

. Please ensure that your app

supports IPv6 networks

, as IPv6 compatibility is required.

Once this issue has been resolved, we can continue with the review. Best regards, App Store Review

Hamilton_Tenório_da_
Valued Contributor I
327 Views

Marcos,

Maybe an error in the code is doing this. I had a problem like this: OK on Android and no action on iOS.

Then, I put this script:

//ativar em caso de necessidade de entender algum erro
window.onerror = function (errorMsg, url, lineNumber, column, errorObj) {
    //alert('Error: ' + errorMsg + ' Script: ' + url + ' Line: ' + lineNumber
    //+ ' Column: ' + column + ' StackTrace: ' +  errorObj);
    $('#entendendo').append("<span style='color: red'>" + 'Error: ' + errorMsg + ' Script: ' + url + ' Line: ' + lineNumber + ' Column: ' + column + ' StackTrace: ' + errorObj + "</span><br>");
};

After that, I realized that there was one error in the code and only in iOS it breaks my app. 

327 Views

Hamilton,

Android é tudo de bom ... não reclama nada e tudo funciona e ainda é barato só $25 uma vez só e nada mais 

Meu pesadelo é o iOS ... super caro $99 anual e só inventa moda ... com esse iOS10 que começou o problema de não abrir o link 

O código funciona normal para anteriores ao iOS 10 ... preciso descobrir como atualizar o código para funcionar no iOS10 ... e não quebrar nos anteriores ... foi um cliente que reclamou que não funcionava mais #triste

Nem vou falar na dificuldade de mandar o app pra quem não tem Windows mas a VM da Oracle para MacOS me salvou 

Vou ver o seu código e ver o que consigo !

Obrigado sempre

Marcos 
www.conteudoanimal.com.br

 

 

Hamilton_Tenório_da_
Valued Contributor I
327 Views

Marcos,

Android é mesmo muito mais rápido, fácil e barato para se trabalhar. O que acontece é que tem muita gente que usa Apple, então não há como ficar de fora. O mesmo não acontece com o Windows. Não tenho nenhuma aplicação para Windows. 

Achou o problema?

Hamilton

PaulF_IntelCorp
Employee
327 Views

Marcos -- did you try to include CSP rules in your index.html file? Do you have more than in HTML file in your app? If so, the CSP rules must be re-applied to each HTML file, we recommend that you have only a single HTML file in your app. Did you try debugging a build app using Safari and web inspector? This is the only way you will get full details on any errors. See this doc page for assistance, which will require access to a Mac > https://software.intel.com/en-us/xdk/articles/debugging-xdk-cordova-apps-built-for-ios-using-mac-and...;

PaulF_IntelCorp
Employee
327 Views

Marcos -- it appears to be inadequate white lists. I did a test with the following white list rules (which will not satisfy all of your links, but should get you going in the right direction):

Screen Shot 2016-10-03 at 6.59.50 PM.png

Also, I added this CSP rule to the index.html, which you may need as well:

<meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline' data: gap: file: https://ssl.gstatic.com *  ">

 

327 Views

Hello,

I did as you said Paul and at least now I could post app to itunes !!!!!!!!!!!!!!!!!!!!!!

Waiting for approval 

As it get approved or I will post the issue reported by Apple

Additional : I used before as http://* to all 3 forms .... why it can not be used ?

Thanks for now 

Marcos
www.conteudoanimal.com.br

PaulF_IntelCorp
Employee
327 Views

Marcos -- you should not use 'http://*' for your whitelist because it represents a significant security risk for your app. You should try to make the list as explicit as possible, for security reasons.

327 Views

Issues from Apple

What to do ? I used HTML link ... what to do ???

 

2. 1 PERFORMANCE: APP COMPLETENESS

Hello Marcos,

Thanks for your time on the phone today.

As we discussed, your app has been rejected for the App Store Review Guideline detailed below.
 

Performance - 2.1



We discovered one or more bugs in your app when reviewed on iPad and iPhone running iOS 10.0.2 on Wi-Fi connected to an IPv6 network.

Activity indicator spins indefinitely upon tapping on the links

We've attached screenshot(s) for your reference.

Next Steps

Please run your app on a device while connected to an IPv6 network (all apps must support IPv6) to identify the issue(s), then revise and resubmit your app for review.

If we misunderstood the intended behavior of your app, please reply to this message in Resolution Center to provide information on how these features were intended to work.

For new apps, uninstall all previous versions of your app from a device, then install and follow the steps to reproduce the issue(s). Forupdates, install the new version as an update to the previous version, then follow the steps to reproduce the issue(s).

Resources

For information about supporting IPv6 Networks, please refer to Supporting IPv6 DNS64/NAT64 Networks and About Networking

If you have difficulty reproducing a reported issue, please try testing the workflow described in Technical Q&A QA1764: How to reproduce bugs reported against App Store submissions.

If you have code-level questions after utilizing the above resources, you may wish to consult with Apple Developer Technical Support. When the DTS engineer follows up with you, please be ready to provide:
- complete details of your rejection issue(s)
- screenshots
- steps to reproduce the issue(s)
symbolicated crash logs - if your issue results in a crash log



We hope you will consider making the necessary changes to be in compliance with the App Store Review Guidelines and will resubmit your revised binary.

Please feel free to contact me at +1-669-227-1522 between 6AM-4PM Pacific Daylight Time if you need further clarification.

Best regards,
Jessica
App Store Review
327 Views

Hello,

The problem is after 1st link .... so it is on my website issue

Do I need to add into my website pages the rule 

<meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline' data: gap: file: https://ssl.gstatic.com *  "> ???


 

PaulF_IntelCorp
Employee
327 Views

Marcos -- the technique you are using in your app to open web pages is generally not a good idea, for a mobile app, and is likely to continue to cause problems for you. I recommend you redesign your app to use a technique like that shown below, which is derived from the "Blank Cordova Starter App" in the "samples and demos" section page when you choose "start a new project":

...from the index.html page, a touch placeholder (equivalent to your list):

       <input type="button" id="id_btnHello" value="Touch Me">

...from the init-app.js file, which associates a touch event to a specific touch placeholder (you would need to do this for each list item):

    var el, evt ;

    if( navigator.msPointerEnabled || !('ontouchend' in window))    // if on Win 8 machine or no touch
        evt = "click" ;                                             // let touch become a click event
    else                                                            // else, assume touch events available
        evt = "touchend" ;                                          // not optimum, but works

    el = document.getElementById("id_btnHello") ;
    el.addEventListener(evt, myEventHandler, false) ;

...from the app.js file, which contains the event handler that was linked to the touch placeholder in the step above:

function myEventHandler() {
    ...your code here...
}

Then, within each event handler (one per link in your list), you should use the inAppBrowser to open the specific link associated with that list item. The inAppBrowser API can be found here > https://github.com/apache/cordova-plugin-inappbrowser < and it will give you more control over how a link is opened.

You will still need to use the whitelist rules, but you should not need the "navigation" rules (might have to test that to be sure). You can also do things like first check to see if you have a network connection, before trying to open the link, and then inform the user (via an alert or notification, for example) that they need to connect to the internet. Likewise, the inAppBrowser API gives you the ability to force the link to open in the mobile browser or in a window, etc. Do not use the window.open alias, use the inAppBrowser APIs directly.

NOTE: you will need to add the inAppBrowser plugin to your project to make this work. It is one of the core Cordova plugins.

Notice also that the initialization code in the sample I reference requires that you wait for the standard Cordova "deviceready" event or, if you've got the special "init-dev.js" file in your project you can wait for the "app.Ready" event, as that sample is written. If you do not have the init-dev.js file, change the wait for the Cordova "deviceready" event. And make sure you are including the "cordova.js" script in your index.html file.

327 Views

Hi Paul,

Thats a lot for new information to me ...  I will read and try out 

I want to know how about another project .... zipped files attached

Is it the same idea as your last post ?

Thanks in advance 

And sorry to creat this problem :D

PaulF_IntelCorp
Employee
327 Views

Marcos -- yes, same idea. Any index.html which needs to open a link should do so using an indirect route like what is used in that simple template I pointed you to.

327 Views

Hello,

Just missing a doubt on app.js

How to do with 
function myEventHandler() {
...your code here... ????????
Please let me know an example here
How to get which button got clicked and how to handle to open the link ???

}

Please give me an example based on 

link is www.conteudoanimal.com.br/mobile/caes/

thanks in advance !

Marcos

PaulF_IntelCorp
Employee
327 Views

Marcos -- an extremely simple example, converting one item in your list to work as described in the previous examples. First part changes the index.html file to add a JS file that contains relevant code and changes the first list item so it is simply a "touch point" that generates an event. Obviously, you would do the same for all the others, I've change only one, for brevity.

<!DOCTYPE html>
<!--HTML5 doctype-->
<html>
<head>
    <title>List View Template</title>
    <meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline' data: gap: file: https://ssl.gstatic.com *  ">
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, minimal-ui">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <link rel="stylesheet" type="text/css" href="lib/appframework/icons.css" />
    <link rel="stylesheet" type="text/css" href="lib/appframework/af.ui.css" />

    <script type="text/javascript" charset="utf-8" src="lib/jquery.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="lib/fastclick.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="lib/appframework/appframework.ui.min.js"></script>
        
    <script src='cordova.js'></script>
    <script src='app.js'></script>
</head>
<body>
    <div class="view">
        <div class="pages">
            <h1>BT</h1>
             <!--Initial List of items-->
            <div class="panel" data-title="BT Eldorado" id="list" data-selected="true">
              <ul class="list">
                <!-- <li><a href="http://www.carolzerbini.com.br/colaboradores/colaboradores.asp">Colaboradores</a></li> -->
                <li id="idColaboradores">Colaboradores</li>
                <li><a href="http://www.carolzerbini.com.br/colaboradores/normaltecnicas.asp">Normas Técnicas</a></li>
                <li><a href="http://www.carolzerbini.com.br/colaboradores/informacoesuteis.asp">Informações Úteis</a></li>
                <li><a href="http://www.carolzerbini.com.br/colaboradores/fimdesemana.asp">Escala FDS</a></li>
                <li><a href="http://www.carolzerbini.com.br/colaboradores/eventos.asp">Eventos</a></li>
                <li><a href="http://www.carolzerbini.com.br/colaboradores/focodomes.asp">Foco do Mês</a></li>
              </ul>
            </div>
    </div>
</body>
</html>

And the supporting JavaScript code in the app.js file that I reference in the index.html file, above:

/*jslint browser:true, devel:true, white:true, vars:true */


function onAppReady() {
    if( navigator.splashscreen && navigator.splashscreen.hide ) {   // Cordova API detected
        navigator.splashscreen.hide() ;
    }

    var el ;
    el = document.getElementById("idColaboradores") ;
    el.addEventListener("click", eventColaboradores, false) ;

}
document.addEventListener("deviceready", onAppReady, false) ;


// see https://github.com/apache/cordova-plugin-inappbrowser#cordovainappbrowseropen
var eventColaboradores = function() {

    // add code here to check to see if the network is available and usable
    // before doing the following...

    var url = "http://www.carolzerbini.com.br/colaboradores/colaboradores.asp" ;
    var target = "_self" ;              // or "_blank" or "_system", see docs for more
    var options = "location=off" ;      // see docs for more 
    var ref = cordova.InAppBrowser.open(url, target, options) ;

    // add code here to clean up, do other appropriate things, etc.

}

This is not the only way or even the best way you could do this, just an example of what I mean. I'm providing the bare minimum so you can see what I mean.

207 Views

Hello

I need to create a new 
function onAppReady()
..

function onAppReady2()
..
etc

To each new item on menu , correct ?

Or how to proceed ?


 

Reply