HTML5 website running while phone screen is off? - html

Basically, my question is the same than this topic but it's now 2018. So, how can I still have ECMAScript executed on my phone (to send geolocation position) even if it is asleep? We now have Open Web Apps and Progressive Web Apps (PWA) with service workers, even Apple is jumping in, I'm sure there are ways to do that.

While we can hope that things should've changed on this, unfortunately, it has not.
This article from Google on PWA GeoLocatoin API dated Jan-2018 says clearly that this API works "only while the page is open".
Why not available yet (in my opinion)? Thinking of users privacy, it makes sense. Think of tons of wep pages we visit and for how many we tend to five permission accidentally or we intend to give for a while(until we finish some transaction/booking). Currently there is no way for us to go and check on all location permissions that we've given to web sites in a browser, like we do for Native/Hybrid apps and having option to change it.
We can expect to have tracking option for PWA when it is installed to home screen, where native app like permission handling will be possible to user.
End of the story, we are not there yet!!
Alternate option: While you can use navigator.geolocation.watchPosition to track the user when he is actively using the app, You can complement your app with a separately installed (Native) Android service to update the users location to your back end server, till PWA supports naively.

Related

How to remove Warning "This application was created by another user, not by Google" in Google Apps for Education

We set up a Google Apps Script-based Intranet in our organization, which benefits from Google Apps for Education. We've been using for months:
doGet()
HtmlService.createTemplate(...)
Publish > Deploy as Web App and setting:
"Execute the app as:" admin#ourdomain.com
"Who has access to the app:" Any member of ourdomain.com
Everything worked ok up to now.
However today (July 7th. 2017) the HTML pages to be shown to the intranet users include an inconvenient Warning added by Google at the top claiming that This application was created by another user, not by Google., which is really annoying. I understand that this warning must be shown when the Script is created by an unkown users. But in my case, I (the admin) is offering the Script to the users of my organization.
The conclusion in other past threads is that going Google Business or Education everything gets fixed. Unfortunately, it's not true anymore.
Does anybody know how to avoid such warning in Google Apps Script for the users of our domain that run our own coded scripts?
if you have a website just embed the google script into an iframe in your website just ensure in your doGet function set return to html.setXframeOptionsMode(HtmlService, XFrameOptionsMode.ALLOWALL)
function doGet() {
var html = HtmlService.createHtmlOutputFromFile("index");
return html.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);
}
Then in you website
<iframe scr="PASTE YOU GOO0GLE WEB APP LINK HERE"></iframe>
you can use css to resize the iframe as you like, i actually learnt this when watching a youtube video , in the ending of the video the instructor embed the google web app which he had created in the video in his website
enter link description here
He also left a link in the description of the video to His github page where he pasted the source code
Bad news. Evidently this is the intended behavior from here on out.
https://issuetracker.google.com/issues/63521070#comment4
mc...#google.com #4 Jul 11, 2017 04:42PM
Status: Won't Fix (Intended Behavior)
To combat abuse, we recently expanded display of the "created by another user" banner to include all cases where either (1) a web app is published under a Gmail account and accessed by a user other than the publisher or (2) a web app is published under a G Suite account and accessed by a user outside the publisher's G Suite domain/customer.
We understand that legitimate applications are also affected by this change, and we hope that broader display of the banner informs users while still allowing developers to deliver useful, usable applications.
I'm affected too. I guess I'll just live with it - only impacts one small web app for me. As a Nonpofits user I'll take what they can give. (A heads up would have been nice though.)
I realize others have more at stake than I do - I hope you can find a workaround.
Same thing has been happening to us. We have a G Suite for Nonprofit account (formerly Business) and have published webapps for several years via this account without the warning showing up. Users began telling me yesterday July 6 2017 that the warning now appears across all our webapps.
I just created a test webapp where "Execute the app as" is set to an admin of our account and "Who has access to the app" is set to "Anyone, even anonymous". As you can see https://script.google.com/macros/s/AKfycbxrKgPol_-eEskKzqRzN4WAMj-NiPm7iFavjZu-_vWtTJPyAEkK/exec does display the warning.
Something I just noticed, the generated webapp script's url now starts with script.google.com/macros/s/ whereas before it would have included our organization name (e.g. script.google.com/a/macros/rchsks.org/s/). So, the url will change if I go back to redeploy one of our existing webapps -- that will screw up several things, the least of which are bit.ly links pointing to the old url.
Not having these warnings appear was one of the benefits I read about when we considered signing up for what was then called a Google Apps account. I'm an admin of our account and received several G Suite alert emails on July 6 2017 about problems occuring with Google Drive, Calendar, Hangouts, etc. Maybe those are connected?

How to use localStorage in Cordova mobile app?

Please I developed my mobile app and is primarily using localStorage for storing account info and some other info. The app has mobile and browser version.
For the browser version, I expect a user that is logged in to not be redirected to an auth page on browser restart. This works fine as my info are stored in localStorage. On the other hand, my mobile doesn't. User have to log in whenever he restart the app.
Please what option do I have? What option do developers use for the mobile storage? Do I have to use database? If so which one should use and where can I find a better documentation on this topic?
Note: I am using Cordova for my mobile app development framework.
For some reason, localStorage is tied to browser history. Some mobile browsers have an option to erase browser history on exit. If that box has a checkmark in it, then localStorage gets purged along with browser history everytime the browser is closed! So, you can ask the user to go into Settings and uncheck that box. Note: localStorage is not supported by older IE browsers, Opera Mini, and some Blackberry devices.
If cookies are enabled, you could use a one-time cookie code to log the user in automatically, but that cookie must expire after first use. Once the user is logged in, the server must issue a new cookie code to the client. And the client can use that new cookie to log in once again or keep alive the session. Using the same cookie twice should not work for security reasons. And the server must make sure never to issue the same code to two different users!
I remember, about 10 yrs ago, I went online to check my emails, and immediately the site had me logged into another user's account! I could have read that person's private emails and stuff, but I decided not to. I reported the incident to the admin. The problem was probably their server issued a random quick-login access code to me, and another user somehow got the same access code that I got. And when I opened the website, it thought that I was that other person. If your site deals with money and credit cards, you should avoid this technique! Any kind of auto login is a bad idea for a bank!
There is a plug-in to store data in an SQLite database using Cordova in this link
. You can find more details about storage with Cordova in the doc.
Save your data by using the following:
localStorage.setItem("variable", value);
Retrieve it from localstorage by using the following:
localStorage.getItem("variable");
It is as simple as it is.
Reference here.

Private beta testing a Chrome extension

Is there a way of beta testing a Chrome extension in the Web Store among a small group of users?
I'd like to do this before scaling to everyone on my waiting list, but I don't want to have to send round the file with installation instructions, especially given that Google is tightening up on extensions that aren't downloaded from the Web Store.
It'd also be useful to be able to slowly roll it out (à la Mailbox) if that's at all possible.
Publishing on Chrome Web Store has 3 (well, 4) options:
Public. The extension will be listed in search and gallery, everyone can install and use.
Unlisted. The extension will not be listed in search and gallery, but everyone with a direct link can install.
(Google Apps domains only) People with accounts on [example.com] only. This allows to publish items privately, as long as you administer a Google Apps domain.
Private. The item will only be available to a selected list of Google accounts, or a Google Group. Note that this is aptly aliased as "Trusted Testers".
That said, you most probably have 2 options:
Have a restricted set of accounts that can use your app. CWS allows to either specify an explicit but short list, or to link with a Google Group you administer.
Use "unlisted" and send everyone the link. Use only if you don't care if the link leaks: you won't be able to remotely kill any install.
Note that if you have enough (10000+) users you can do partial rollouts of regular updates, to have less impact from problematic updates if they happen.

Chrome extension or chrome app?

I would like to create an extension or app for the Chrome browser which would require access to a user's Google Calender (for creating new appointments).
I am unsure of which technology to better research and use, Chrome extensions or apps. My "app" wouldn't need much of a GUI, so I'm leaning towards extension — but I don't know if this would pose any difficulties for accessing a user's Google Calender to add an event.
Anyone one have any idea which technology is best for this situation, and why? Thanks!
Either, or... Go with an extension if you'd like.
I assume you've looked at the API reference?
https://developers.google.com/google-apps/calendar/
From there, I'd imagine you'd just need OAuth to authenticate the user. Here's the JS library:
https://code.google.com/p/google-api-javascript-client/
There are pros/cons of each types, apps or extensions.
Apps
If you would like to create a client application of Google Calendar which has many rich GUI components, this type will become a better solution.
In addition, Chrome apps can communicate with many hardware devices and other servers. Of course, your Chrome app can become as a server (that is, your app can open a server socket and accept a request from other client apps).
Chrome apps can be executed not depending on your Chrome Web browser. That is, Chrome apps cannot access to a context of your Chrome Web browser.
Probably, you don't want to get the pros above, I guess...
Extensions
If you would like to create a small UI for posting your schedule to Google Calendar, this type will become a better solution.
In addition, Chrome extensions can access to a context of your Chrome Web browser. That is, your extension can get page contents of each tab and inject your CSS and/or JS code. For example, your extension will get a URL of some opened tab and include it in a body of the posted schedule.
Chrome extensions completely depend on your Chrome Web browser. That is, your extension cannot execute independently.
Also, generally, high cost will be needed to develop Chrome apps than Chrome extensions. As the result, you should choose Chrome extensions, I believe.

Meebo Me replacement

With the recent Meebo acquiring by Google Meebo Me widget is also gone.
I would like to have similar functionality. Something which I can put on my web site and allow guest users to chat to me on my MSN (Live) or Gtalk messenger I have on my computer. It may also be Skype if it has something like that.
Up until now I was using Google TalkBack badge which stopped functioning (it just loads http://support.google.com page). Then I used MeeboMe widget which had similar functionality athough I had to run MeeboMe notifier. Now that is gone too. I tried Plugoo which also works, but sometime buddy_plugoo which I added as contact is offline and then the web widget also shows me as "offline" even though I am not so it is not really reliable.
I also have 2 gmail accounts and tried to connect to one via XMPP.php and send a message to other one - but it won't even connect. Tried various examples. I could use one "dump" gmail account to chat with my main account if this would be able to connect and create a web-interface.
So do you know of some alternative widget for websites? Something that I could connect to my desktop messengers and chat to website visitors so that when visitor writes a message it pops up in my messenger. I could also write my own app given that it is not something too time consuming - I need only basic notification when visitor writes a message and chat with him/her. Preferably free one.