Skip to content

PurchaseTester: Add new UI to configure internal proxy behavior#1016

Merged
tonidero merged 1 commit into
mainfrom
purchase-tester-proxy-ui
May 29, 2023
Merged

PurchaseTester: Add new UI to configure internal proxy behavior#1016
tonidero merged 1 commit into
mainfrom
purchase-tester-proxy-ui

Conversation

@tonidero

@tonidero tonidero commented May 23, 2023

Copy link
Copy Markdown
Contributor

Description

This PR adds a new button to the ConfigureFragment, LoginFragment and OverviewFragment. This will open a bottom sheet where we can modify the behavior of our internal proxy. This will help with testing offline entitlements and trusted entitlements. Note that this UI will only be helpful when using our internal proxy. When using other proxies, the requests will fail and the UI will display the corresponding error

device-2023-05-23-101143.mp4

@tonidero tonidero added the test label May 23, 2023
}

@Suppress("EmptyFunctionBlock")
binding.proxyUrlInput.addTextChangedListener(object : TextWatcher {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this so we could configure the proxy setting from before the SDK was configured. This means we will update the property on every change, which is probably fine.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's fine for a sample app. Would listening to onFocusChange also do the trick, but without the intermediate calls while editing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some situations where the edittext doesn't lose focus, causing the proxy url to not be updated in time. For example, if you are editting the proxy url edittext and then click a button, the focus isn't lost. Updating on text change was the quickest alternative I could find, even though it's clearly not optimal

@tonidero tonidero marked this pull request as ready for review May 23, 2023 08:17
@tonidero tonidero requested a review from a team May 23, 2023 08:17
@codecov

codecov Bot commented May 23, 2023

Copy link
Copy Markdown

Codecov Report

Merging #1016 (a6bfce8) into main (3dc486d) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1016   +/-   ##
=======================================
  Coverage   85.37%   85.37%           
=======================================
  Files         169      169           
  Lines        6005     6005           
  Branches      839      839           
=======================================
  Hits         5127     5127           
  Misses        546      546           
  Partials      332      332           

@NachoSoto

Copy link
Copy Markdown
Contributor

This looks amazing 😍
We could do something similar in iOS. I did this for macOS only because it was much easier as a separate window.

I'll let somebody else review this cause I know virtually nothing about Android UI.

@aboedo aboedo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love it!

}

@Suppress("EmptyFunctionBlock")
binding.proxyUrlInput.addTextChangedListener(object : TextWatcher {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's fine for a sample app. Would listening to onFocusChange also do the trick, but without the intermediate calls while editing?

@tonidero

tonidero commented May 29, 2023

Copy link
Copy Markdown
Contributor Author

Merging this for now. If there are any further comments, I can address in followup PRs

@tonidero tonidero merged commit faf63e5 into main May 29, 2023
@tonidero tonidero deleted the purchase-tester-proxy-ui branch May 29, 2023 16:29
tonidero added a commit that referenced this pull request Jun 1, 2023
**This is an automatic release.**

### New Features
* Offline entitlements support (#1030) via Toni Rico (@tonidero)
### Bugfixes
* Fix billing connection error when querying purchases early in the
process lifetime (#1032) via Toni Rico (@tonidero)
### Performance Improvements
* Perform product entitlement mapping request after more critical
requests (#1017) via Toni Rico (@tonidero)
### Dependency Updates
* Bump fastlane from 2.212.2 to 2.213.0 (#1024) via dependabot[bot]
(@dependabot[bot])
### Other Changes
* Get offerings response from disk cache if available (#1029) via Toni
Rico (@tonidero)
* Improve offline entitlements logs to mention limitations of this mode
(#1039) via Toni Rico (@tonidero)
* Improve error message when backend returns internal error code (#1038)
via Toni Rico (@tonidero)
* PurchaseTester: Add new UI to configure internal proxy behavior
(#1016) via Toni Rico (@tonidero)
* Updated readme to include links to migration guides (#1021) via Marcos
Castany (@mcastany)
* Store offerings response in SharedPreferences (#1028) via Toni Rico
(@tonidero)
* Refactor offerings code out of Purchases (#1027) via Toni Rico
(@tonidero)

---------

Co-authored-by: revenuecat-ops <ops@revenuecat.com>
Co-authored-by: Toni Rico <antonio.rico.diez@revenuecat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants