Hi all sorry if this is repost. I really searched but can't find anything on it.
I always see this special ad when I use google services on my iphone or ipad. This little window animates out looking like a chat box. I can detect iOS device using user agent but how do I make the advert appear like google does? Specifically, try to open google maps.
I would like to use a window like this when users use iOS device to access my website. It is the most elegant way to tell iOS user about your app while not annoying them with some roadblock each time you try to access with iOS device.
Here is an image of what I'm talking about:
You can use this Javascript: http://cubiq.org/add-to-home-screen
I don't know whether this is your expectation, When your page has access from any iOS device, you wanted to bring up that dialog in webpage Right?..If That is the case then just retrieve the os info and make check there and do your presentation as you want.
Related
i want to be able to click a button on a website which will trigger an Eventlistener from some javascript in the background.
I found out that when i use this command in the webconsole in firefox while i am on the website i achieve my goal:
document.getElementsByClassName('button is-primary')[0].click()
I want to click this button every 30min and i want to click it from an android device.
I found that selenium will be capable of doing this task but i need a webdriver for chrome or geckoo and i think such things are not possible with lets say qpython on android.
Is there any other way to automate this?
My understanding is, that i need somekind of webdriver so the javascript in the background is loaded correctly.
I know automation software like "tasker" exists but i dont know if i can achieve my goal with that and if there maybe is an easier way.
Further info about the problem:
I have an environmental measurement device which only has a graphical webinterface via wifi.
The device should take measurements for 24h in th field.
I want to use an android device which i can place nearby. A laptop would be to big and complicated to setup.
I am making a website in React JS.The website will work like a webview as it will be attached to android/IOS application.
In the website i have a cross button.
On that button press i want to trigger native bridge event which will close whole webview all together.
Let me know how can i achieve same.
Thanks in advance.
Mhmm, android and iOS are creating a special object on window when loading a website in a webview.. in Android it is called window.android, in iOS it's window.webkit and a special userAgent agent which matches like
navigator.userAgent.match("CriOS") === null // detects chrome on iOS
In Android, it is possible to create "callbacks" on this android object which can be called from the websites ReactJS code like:
window.android?.share(content)
In iOS, you can go with messageHandlers and it will look something like this:
window.webkit?.messageHandlers?.showSharing?.postMessage(url)
I cannot show you the native App code for these two examples as i'm the Frontend-Developer in our company and not the App-Developer ^^
But, i would assume that's the way to achieve this. You need a way to call a method directly in your native app code to have the ability to actually close the webview - the website itself cannot achieve this.
I've already researched and found a lot on this topic, but there's an idea that I still couldn't find and wanted to see if it's possible.
A bit of a background, I'm not a back-end developer and I'm not as well versed in it. But I have written a small website using HTML, CSS & Javascript (jQuery).
In-app browser is a problem for me since I am using localStorage to store some information for the user, and being its in-app then the user will lose all those details once they leave instagram, for example.
I've come upon a few results, and some here on stackoverflow, but some answers did not work (link 1, link 2) and most answers said that this is not possible anyway.
So I was wondering (and I'd take this as a learning experience) about the following use case:
Let's take Instagram as the example here. If we set in our bio the link to youtube let's say, the youtube website will display at the top "Open in App" button, which in that way can then open the native youtube app and the user can continue normally. In that sense, isn't it possible to let's say, to create a button like "Open in Safari", and once the user opens my website they will be able to tap it and it would open the safari app with its appropriate link? Or is this not possible also since it should be coded from Safari's end?
A URL Scheme is what you need. for example:
Google Chrome:
googlechrome://domain
Safari:
safari-https://domain
Firefox:
firefox://open-url?url=domain
Opera:
opera-https://domain
X Web:
x-web-search://search+term
i would like to program a website using javascript.
The website has to be able to be contantly checking the gps-chip of an android device.
When specific coordinates match (coordinates given by the remote-server and coordinates given by the gps-chip), the user should get a notification like a sound or a vibration and a pop-up-window with further information.
Like, when the device passes a coffeeshop, the user is alerted, that there is coffee in the area.
It has to be a website, not an app.
Is such a thing possible?
Are there well known examples for services using such websites?
I hope, my question accurate enough, to be answered.
Thank you in advance.
I recently bought an iPod so that I could test my own HTML5 games on iOS, and while looking around I found this HTML5 app:
http://www.apple.com/webapps/games/goldnuggets.html
If you load that page from an iPod or iPhone, you'll be able to play the game.
What I found memorable about this app is that when you try to load it, it forces you to 'install' (save) it to your homepage before you can play. The benefit of this is that the HTML5 app gets the full screen area to work with when launched from the homepage, just like a normal iOS app (as opposed to being covered up with the address bar and that command bar at the bottom).
I was wondering how I can check if the app has been added to the homepage (not the actual "add to homepage" function - which according to this thread is not possible Javascript for "Add to Home Screen" on iPhone?).
I could certainly use an extra 100px, and it would allow me to easily create an iOS version and HTML5 version with matching interfaces, and a better user experience.
Any ideas? Google search turned up nothing for me.
TL;DR window.navigator.standalone
And everything you need at http://www.bennadel.com/blog/1950-Detecting-iPhone-s-App-Mode-Full-Screen-Mode-For-Web-Applications.htm
Good luck!
One thought is to add a bookmark/favorite via JavaScript (called from an onclick event):
window.external.AddFavorite( url + "?somevariablethatsaysitisok=true", "MyGameName");
which I assume would work for iOS Safari as well.
On the URL part of it you can pass an argument that, when set, would allow the game to be played. If not set then only show the book mark link
You can either browser detect serverside or, if I remember correctly use javascript's navigator.userAgent or navigator.appVersion to see if it contains iPhone / iOS. Of course I would do some testing to to make sure you get the exact string, but that's the general idea.