phonegap app extremely slow to load website on ios - ios

I have a phonegap app that opens a website using window.open(). While it works fine in testing, when I compile the app and install it on an iPhone using TestFlight it can take anywhere from 1 minute to 15 minutes to open the website. When it does everything works fine. The app store review is rejecting it because of the delay. What can I check to identify the cause of this delay?

Use remote debugging with an iOS device (or a simulator). This will allow you to see error's log like debugging a web site.
See "Safari in iOS" in : https://developer.apple.com/library/content/documentation/AppleApplications/Conceptual/Safari_Developer_Guide/GettingStarted/GettingStarted.html
Open the Settings app.
Tap Safari.
Scroll down and select Advanced.
Switch Web Inspector to ON.
After Web Inspector is enabled, connect your device to your desktop machine with a USB cable. The name of your device appears in the Develop menu of Safari.
Also, depending of what you want to do, I suggest you, instead of using window.open, to use the cordova-plugin-inappbrowser plugin to open link in the browser (outside the webview of Cordova/Phonegap)

Related

Why is metamask deep link breaking ui in iphone mobile browser?

I have developed my dapp in react js. I used a metamask generated deep link to connect metamask mobile app from mobile browser.
window.location.replace(metamask_generated_link);
It is working fine in desktop browser and android but not in ios. So whenever I try to connect from iphone, sometime the deep link popup doesn't appear (1/10th time) and when it appears and if I don't choose metamask from the popup option and cancel the pop, ui of connect button breaks. I am struggling to understand the reason.
It has nothing to do with connecting metamask, only issue is launching the app.
How would I solve it?

Safari web inspector not working with cordova in iOS12 and mac OS Mojave

Recently I updated my device to the iOS12 (it's actually 12.0.1 now) and also my mac to the latest OS. Now, whenever I am trying to debug my Cordova app it will simply not show up in the Safari developer menu. The mobile browser works, its just Cordova not showing. This is happening only with the real device, in the simulator, it shows up. I followed a bunch of articles on how to reset the trust settings and even tried remotedebug_ios_webkit_adapter and nothing. How can I get to the bottom of this? I am completely stuck and unable to continue with development.
I would like to mention that the app is using the wkwebview engine, not uiwebview and we never had this problem ever since we moved to the new engine for a least a year now.
download & try same in Safari Technology Preview https://developer.apple.com/safari/technology-preview/
Go to you'r Phone settings -> Safari -> Advanced -> enable Web Inspector
then go to safari developer, you'r device will be appear there.
For me the solution was to restart Safari.
Lately it's been often that Cordova iOS debugger won't show in Safari, but I am able to fix it every time by completely quitting Safari and restarting it. ;)
Also, make sure that you sign your app with a development provisioning profile.

Debugging PhoneGap on Device

Normally I'm a JEE guy but these days I'm working on a mobile app. I chose PhoneGap because there are not so many needs to UI and I thought this would be the easiest way to serve the app on many platforms.
I'm wondering if my setup is good and if it's possible to get console output when running on the device. I'm working on MacOS and iPhone6.
I installed PhoneGap and Cordova via npm and serving the files with phonegap serve.
For local debugging I'm using the chrome plugin "Ripple".
For debugging on the device I'm using the PhoneGap Developer App from the AppStore, together with weinre on my Laptop to get some debugging data. In weinre I can see everything except console outputs. Is this normal? Or any idea how I could get the console to weinre, too?
I also found some tutorials on the web using XCode and some native iPhone emulator but didn't get this working yet. Which way is the more preferable way of debugging on device?
You don't need any tool for debugging cordova app. For iOS just start the app in stimulator and start safari. In safari go to Develop > 'your pc name' > ios simulator.
http://webdesign.tutsplus.com/articles/quick-tip-using-web-inspector-to-debug-mobile-safari--webdesign-8787
For Android run the app in your device and in the chrome go to http://chrome://inspect/#devices
Weinre is quite old and should not be be used anymore, instead, you want to use the remote debugging tools in your browser. For iOS, you can use Safari to debug your Cordova app. I've got a full article here, https://dzone.com/articles/overview-mobile-debugging, but the process involves doing one setting on your mobile device, and then simply opening up Safari and going to the debug menu. You can also do this with Chrome and Android apps.
Another option is GapDebug (https://www.genuitec.com/products/gapdebug/) which lets you do iOS and Android together in one Chrome tab.

Get access to console in Sencha Touch app running on iPhone

I want to use console.time('a') and console.timeEnd('a') in my Sencha Touch iOS app. This functions prinnt measured time in microseconds on console.
How to get access to console while I'm running my app on iPhone?
I tried with Safari Remote Web Inspector (like Phonegap iOS Safari debug workflow), but it doesn't work. It give me access to index.html, and Web Inspector opens correctly, but all his tabs are empty including console tab.
(I tried used Safari Remote Web Inspector with PhoneGap and it works correctly)
EDIT:
I don't use Xcode, becouse I am building my app with Sencha Cmd. And I do not want to change that, because I am testing Sencha Touch performance without PhoneGap.
There is a cordova plugin which you can use to see the output of console in XCode.

Phonegap iOS Safari debug workflow

I've been testing out Phonegap Build, using a similar workflow as outlined here:
Tutorial: Developing a PhoneGap Application
I can build, and deploy to my devices, but cannot get remote debugging to work through Safari, as described in the answer here:
Could you tell be debug process in Phonegap iOS application?
I have no problems debugging the app through the mobile browser, but the installed app itself does not show up in Safari's develop menu.
I am transferring my app to my phone through xCode, and have enabled debugging in the Phonegap build interface, but the Weinre debug service seems to be down. Ideally I'd like to get this working through Safari, could anyone share their debug workflow?
thanks
When you say "native app", you actually mean the Phonegap app deployed to your device?
Here is how I do it. It works on both iOS Simulator and actual device:
Open Settings > Safari > Advanced and make sure "Web Inspector" is enabled
Connect the device and deploy the Phonegap app using Xcode
Wait for the app to launch and navigate to Safari on my desktop, then find my device name in the develop menu
Make sure Web Inspector is enabled in Settings > Safari > Advanced > WebInspector.

Resources