Dr0ptp4kt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/169269

Change subject: Make zero-rating dialog and inspection less intrusive
......................................................................

Make zero-rating dialog and inspection less intrusive

When not in the webview, screens like search were prompting
excessively about zero-rating. Now, these screens outside of the
webview will usually not prompt about zero-rating, unless the
state of zero-rating has gone from On to Off, which is an event
worthy of a pause by the user. There is a chance that the user
may use the search screen and go into zero-rating mode On for
the very first time since installing the app. But that's a pretty
low probability event. It's much more likely that the user will
go into zero-rating mode On from the first time launch screen
or article reading mode. But if the low probability event does
occur, the user will get a prompt. Otherwise, if the user is in
a search screen the second or subsequent time zero-rating goes
into On mode, the user will still have a fixed bar back in the
webview screen showing zero-rating On and will also have the
More... screen to learn more about zero-rating.

In addition to the alert reduction, the app will now only check
for the outbound zero-rating applicability header, "X-CS",
when the URL is a .m.wikipedia.org subdomain. Presently, this is
the only place where such outbound header tagging can occur, so
there is no point initiating a "banner text" fetch on other
domains. This should have the fringe benefit of errant transitions
for On and Off triggering when domains like www.wikidata.org are
accessed by the app. A similar change has been enacted in the
Android app master branch already. Operators zero-rating apps traffic
zero-rate based upon well defined destination IP addresses and
domain names, which include subdomains of www.wikidata.org. In the
cases where other facets of the request may disqualify otherwise
zero-rated access, backoffice configuration supports the notion
of disabling zero-rating messaging on a given operator's network.

Change-Id: I04e319530af8986081ee9730b3ddd5f7af553230
---
M wikipedia/View Controllers/Navigation/Center/CenterNavController.m
M wikipedia/Web Image Interception/URLCache.m
2 files changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia 
refs/changes/69/169269/1

diff --git a/wikipedia/View Controllers/Navigation/Center/CenterNavController.m 
b/wikipedia/View Controllers/Navigation/Center/CenterNavController.m
index f93edad..99f8a02 100644
--- a/wikipedia/View Controllers/Navigation/Center/CenterNavController.m
+++ b/wikipedia/View Controllers/Navigation/Center/CenterNavController.m
@@ -144,7 +144,7 @@
 #pragma Wikipedia Zero alert dialogs
 
 -(void) promptFirstTimeZeroOnWithTitleIfAppropriate:(NSString *) title {
-    if (![SessionSingleton 
sharedInstance].zeroConfigState.zeroOnDialogShownOnce || ![self 
isTopViewControllerAWebviewController]) {
+    if (![SessionSingleton 
sharedInstance].zeroConfigState.zeroOnDialogShownOnce) {
         [[SessionSingleton sharedInstance].zeroConfigState 
setZeroOnDialogShownOnce];
         self.wikipediaZeroLearnMoreExternalUrl = 
MWLocalizedString(@"zero-webpage-url", nil);
         UIAlertView *dialog = [[UIAlertView alloc]
diff --git a/wikipedia/Web Image Interception/URLCache.m b/wikipedia/Web Image 
Interception/URLCache.m
index 30e1d69..cc56702 100644
--- a/wikipedia/Web Image Interception/URLCache.m
+++ b/wikipedia/Web Image Interception/URLCache.m
@@ -40,7 +40,8 @@
 {
     if (![self isMIMETypeRerouted:cachedResponse.response.MIMEType]) {
         [super storeCachedResponse:cachedResponse forRequest:request];
-        if ([cachedResponse.response.MIMEType 
rangeOfString:@"application/json"].location != NSNotFound) {
+        if ([[request URL].host hasSuffix:@".m.wikipedia.org"] &&
+            [cachedResponse.response.MIMEType 
rangeOfString:@"application/json"].location != NSNotFound) {
             // NSData *data = cachedResponse.data;
             // NSString *newStr = [[NSString alloc] initWithData:data
             //                                          
encoding:NSUTF8StringEncoding];

-- 
To view, visit https://gerrit.wikimedia.org/r/169269
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I04e319530af8986081ee9730b3ddd5f7af553230
Gerrit-PatchSet: 1
Gerrit-Project: apps/ios/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dr0ptp4kt <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to