When using Workbox, how to revalidate the offline page cache? - progressive-web-apps

Using Workbox offlineFallback() recipe or the pattern the Offline page works well, as expected, but how can I revalidate the cache? I couldn't find a way to change the revision of the offline page if the content changes other than using workbox-precaching.
What's the intended way to handle this problem, or these recipes/patterns don't account for changes to the offline page, once it's cached?

Related

Is there a way to keep up with Facebook platform changes?

I notice Facebook makes changes every so often. For example, it's html page structure changes every so often (if you write a like count scraper, then all of a sudden your scraper is broken one day).
Also I noticed URLs of the form https://www.facebook.com/video.php?v=100000000000000 started redirecting to https://www.facebook.com/{pagename}/videos/100000000000000 .... Probably the redirection will stay the same but I wonder - does Facebook publish these changes in behavior or how do you keep up with them?
I wasn't even sure this was the right place to post but I couldn't find a facebook stackoverflow community....Thanks!
If you build functionality off the Graph API there is a changelog, and versioning support e.g. you can build against a specific version and keep using functionality even though it is removed in later versions.
https://developers.facebook.com/docs/apps/changelog

How can I deeplink through install from a twitter post to content in my mobile app? Any way to track those installs that come from tweets?

I'd like to drive more downloads and engagement using Twitter. Right now I can have people post install links but it just takes them to the app store and I lost all the contextual data about them. Anyone know how to send the tweet information and deeplink data from twitter through the app store into the app?
Austin from Branch here. The technology you're referring to is Contextual Deeplinking, and Branch is a leader in the space.
You can use Branch to create deeplinks that work through install by dropping in the SDK inside your app and then signing up and putting in some credentials on the dashboard.
The iOS and Android SDKs allow users to share deeplinks over Twitter that will retain context through install, so people clicking on those links who don’t already have your app installed will be prompted to download, and then continue to the original link content in your app after the download finishes. The tech works by embedding params in a simple data dictionary behind a short URL, dropping this as a cookie on the BNC servers, then using some clever matching, they fingerprint and find the right user to pull down this data from within the app (hence the need for their SDK inside the app).
This should help improve engagement with new users. And Branch provides tracking for the clicks/installs coming from those tweeted links (and from all other links created with our SDK), so you’ll know exactly where your new users are coming from.
More details: https://dev.branch.io

Get Realtime Updates from a Facebook page

I am working on a web app that use Facebook login. The purpose of the app is to get information about fan pages that the user has in his account (for which he got admin privileges). I work mostly with the insights informations but this is not the issue. Now I would like to receive realtime update from the page like new messages, page posts reply etc. I've read the documentation https://developers.facebook.com/docs/reference/api/page/#realtime
and I don't understand the part about adding the app to the page. It is required that the app to be installed for example in one of the tabs? If so, is there a way not to do that and still receive the informations that I want? Also when I try to create a Realtime Update Subscriptions for the page object no "posts" field was available, then how to get realtime updates about it? I am a little confuse and any guidance and advise is more than welcomed.
P.S. I am using PHP SDK, if this helps with something.
I've read the documentation
How about reading it again?
I don't understand the part about adding the app to the page. It is required that the app to be installed for example in one of the tabs? If so, is there a way not to do that and still receive the informations that I want?
Quote from the docs part you linked to yourself:
Note: You might think that because you're adding this via the tabs API that this is a tab app. It's not. This app isn't visible to users as a page app and isn't managed via any UI.
Also when I try to create a Realtime Update Subscriptions for the page object no "posts" field was available, then how to get realtime updates about it?
You can subscribe to the page’s feed.

Updating Page Content Without Refreshing Page

I want to update recent notifications on the user's dashboard without refreshing it whenever there is a change in database notification table...as in Facebook where posts and comments are updated in real time...doesn't require page refresh. How can I do it. Any idea?
Thanks in advance.
I work for a company called Realtime (http://www.realtime.co) and we developed a very cool framework to work with real-time data.
It works on the cloud, we offer a lot of different APIs, you don't need to install anything and you can get a free account (with 1.000.000 free messages and 30.000 users per month). It allows you to push data to browsers, meaning you won't be hammering your server with AJAX requests.
On browsers, it uses websockets, if available. For older, non-websocket browsers, we will transparently fallback to whatever is that your browser can use.
Check out http://www.realtime.co and http://www.xrtml.org for downloads and documentation. Please let me know if you need any help as I am the Developer Evangelist for Realtime :)
It is something called asynchronous. Which you refresh the contents of a webpage or a DIV or anything else without reloading the page.
Actually you should use AJAX to load another page into a already present DIV in your page so it will be refreshed on a time basis.
AJAX
The documentation is really simple on w3 schools you can see there.
But the thing is you should use another page called a Handler or something to load and process the contents and then make them ready to be presented in your page and so you can load it time by time using javascript timers or etc.

iPhone HTML5 website on homescreen with jQuerymobile offline splash page?

How do I go about loading a splash to the user if they are offline? I want it to show after the initial loading image, I have a page called gone-offline.jsp but how to detect if user is offline on mobileinit?
I'm not using phone-gap
You need to decide what offline means to your business scnenario. This may sounds silly, but it depends on what your app wants to do. For example:
Does your app want to go offline when it is actually offline and can't reach other websites, or does it want be in offline status when it can't access your webservice.
Assuming you want to test that there is no connection to your webservice I would recommend the following:
1) Make an ajax call every x number of minutes to your webservice to check if it is still online
2) make a common method that handles time outs if your application thinks its online and is offline.
3) make it so that when your application is offline, it is trying to get back online in the background by doing a similar step to step 1.
To do ajax with JQuery see: http://api.jquery.com/jQuery.ajax/
Note that if you require cross domain json (you may or may not) then you will need to investigate CORS/JSON-P/XSS with iframes.
it's very simple using javascript.
if(navigator.onLine)
{
//online code here
}else{
//offline code here
}
(done with jQ mobile)