Page MenuHomePhabricator

Update iOS app to handle multilingual campaign using new apps campaign config
Closed, ResolvedPublic

Description

(See parent task)

Config page:

Production: https://donate.wikimedia.org/wiki/MediaWiki:AppsCampaignConfig.json?action=raw
Staging: https://test.wikipedia.org/wiki/MediaWiki:AppsCampaignConfig.json?action=raw

Testing Notes

This can be tested starting in Wikipedia TestFlight 7.4.3 (2809) build.

Testing tips:
All new donor experience work (in-app web view, new campaign modals with maybe later, multilingual campaign support, Apple Pay native donation) are set up to become available in the app only once the Netherlands or Italy Oct/Nov 2023 campaigns become valid.

  1. Device iOS Settings > Language & Region > Region needs to be set to either the Netherlands or Italy
  2. Device date & time needs to be set on or after the campaign start date (change device date to 10/17)
  3. After fresh install, you must background and foreground the app, then pull to refresh on the Explore feed to trigger a force refresh of the campaign data.
  4. Visit an article. Campaign text is set up to display in a language dependent on the article wiki (EN wiki article will display English, NL wiki article will display Dutch, IT wiki article will display in Italian).

Event Timeline

Tsevener triaged this task as High priority.
Tsevener created this task.
Tsevener added a subscriber: Dbrant.

Sync notes:

I think easiest would be to build PR off of https://github.com/wikimedia/wikipedia-ios/pull/4619, and add the ability to fetch the campaign config in WKDonateDataController's fetchConfigs method. We can save it to another static property in that class for access later. We should also cache it after fetching. We can reference the way WKWatchlistDataController uses the sharedCacheStore and/or userDefaultsStore for tips on how to do this.

Then in ArticleViewController+Announcements.swift, reference this config (load if from cache if necessary). Filter down to valid campaigns and campaign text based on countryCode (maybe based on Locale.current.regionCode, or GeoIP cookie), config asset language code (based on article wiki language code, with possibly default fallback), start / end dates, and whether or not they already dismissed the campaign ID or not. Then display announcement as we did before via wmf_showAnnouncementPanel or build a new Component based on the onboarding component.

You'll also need to persist flags per campaign ID when they dismiss so that we don't present to them again.

Tsevener updated the task description. (Show Details)

Assigning to @Mazevedo for campaign modal UI. Please build PR off of PR above.

@Mazevedo seems like https://phabricator.wikimedia.org/T346823 covers the UI-portion of this (which you already have in doing), so I'm going to move this into Needs Code Review.

Tsevener updated the task description. (Show Details)