invoking ios installed app from safari - javascript

I want to invoke a ios application from browser. If the app is installed, it should redirect to the app. Otherwise, it should continue in the browser it self, with out showing an error pop up message.
I tried setTimeOut() in javascript, it not working.
Help me please...

check here How to register a custom app opening URL scheme with Xcode 4?
register a URI to your app, then you can open it via javascript in mobile safari

Related

Chrome opens PWA automatically when opening the site

I have a web application that can be installed as PWA. Once installed the problem appears on Android devices with Chrome.
If a user is logged out the application will redirect to an authentication service that is hosted on a separate server. Once a user has logged in the application redirect him to main page of app. PWA is opened automatically at this point. I don't want this.
Does anybody know a way to prevent automatically opening PWA when a user open a site in browser?
It was noticed on Android 8.0 with Google Chrome 74.0.3729.157.
Also if an authentication page is rendered inside iframe PWA is not opened automatically.
Finally I get it.
PWA is installed as WebAPK so Android open my application automatically when an auth server returns redirect to my application https://developers.google.com/web/fundamentals/integration/webapks.
A way exists to prevent that by defining a scope parameter in manifest.json. But it is not my case because all my application is in the root.
Finally I use iframe to render an auth page instead of redirection to auth service directly.

React Native: Prevent remote debugger from opening in Chrome

I've written a Bash script to open React Native Debugger (desktop app) before running my iOS emulator itself. By default my iOS emulator has "Remote JS Debugging" on, and when the emulator starts up, it opens the remote JS debugger in Chrome. So I end up with React Native Debugger and the Chrome remote JS debugger both open, and these conflict with each other and sometimes cause the app to crash.
My question is: is there a way to prevent the iOS emulator from automatically opening the remote JS debugger in Chrome?
Thanks!
You could try setting the REACT_DEBUGGER env variable to some failing path, so it will fail behind the scenes when trying to open it.

Debugging JavaScript code in iOS simulator using Safari

I am building an iOS app in which I have a webView i.e. UIWebView not WkWebView and I have some JavaScript code that uses AngularJS for UI manipulation.
I run my app in the iOS simulator from Xcode and then open Safari and go to Develop -> iOS Simulator -> AppName -> index.html, which attaches the safari web inspector to the web view. In the inspector under the resources tab I select the relevant JavaScript file and put a breakpoint for the JavaScript code that I want to start from.
What happens now is when I navigate to the part of my app when the JavaScript code is executed, it pauses in the web inspector just fine. The problem is, I cannot navigate through the code: it just freezes. I cannot unpause it.
What I do notice in my Xcode console is this error
Multiple locks on web thread not allowed! Please file a bug. Crashing now...
This doesn't happen all the time, just 60-70% of the time when I am working on my app. So this is my first iOS app and I am building it using Swift.
This seems like I have a missing link somewhere. But any tips or anything would be great.

Jquery backbutton handler working in browser but not on device

I am writing a phonegap app for android and iOS and I'm handling the backbutton as follows with various functions in my app:
$(document).unbind("backbutton");
$(document).bind("backbutton", myFunc);
Some of the functions use window.location.replace("XXXX.html"); in order to redirect to a new page.
This all works perfectly in a browser using Ripple Emulator but when I use genymotion or an android device I get some strange results where the app will move to the wrong pages or exit the app when it should go back a page.
Any ideas? :(

Redirect app to the ios store using javascript

I have a phonegap application on ios store.
i want to redirect the user to the ios store but its not working.
i used this in javascript:
window.location.href = "https://www.google.com";
and it was working fine , i got redirected to google.
but if I use this in javascript:
window.location.href = "https://itunes.apple.com/us/app/twitter/id333903271?mt=8&uo=4";
it works on chrome , but on iphone it skips it ! and nothing happens.
is it restriction from apple on phonegap? .. because i've seen native apps redirects you to the ios store. but i dont know if that is allowed in phonegap or cordova applications.
also it skips it if i did an ajax call on the itunes link and goes directly to the error.
Use Phonegap In app browser
window.open('https://itunes.apple.com/us/app/twitter/id333903271?mt=8&uo=4', '_system');
before that you must add plugin
cordova plugin add org.apache.cordova.inappbrowser

Categories

Resources