Skip to content

Commit b4458da

Browse files
Android (#1003)
* feat: hide billing/plans links in Android app using MobileUI wrapper * 3.42.0 * Duplicate word 'please' should be removed Co-authored-by: Copilot <[email protected]> * feat: add BillingUI component to hide billing features on Android * 3.42.1 --------- Co-authored-by: Copilot <[email protected]>
1 parent 83d5b31 commit b4458da

19 files changed

+120
-62
lines changed

.github/workflows/build-android.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,8 @@ jobs:
129129
packageName: com.remoteit
130130
releaseFiles: ./android/app/build/outputs/bundle/release/app-release.aab
131131
track: internal
132-
status: inProgress
132+
status: completed
133133
inAppUpdatePriority: 0
134-
userFraction: 0.2
135134
changesNotSentForReview: true
136135
# whatsNewDirectory: distribution/whatsnew
137136
# mappingFile: app/build/outputs/mapping/release/mapping.txt

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ android {
1313
applicationId "com.remoteit"
1414
minSdkVersion rootProject.ext.minSdkVersion
1515
targetSdkVersion rootProject.ext.targetSdkVersion
16-
versionCode 287
17-
versionName "3.41.0"
16+
versionCode 289
17+
versionName "3.42.1"
1818
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1919
aaptOptions {
2020
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.

electron/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

electron/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "remoteit",
3-
"version": "3.41.0",
3+
"version": "3.42.1",
44
"private": true,
55
"main": "build/index.js",
66
"description": "Remote.It cross platform desktop application for creating and hosting connections",

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "remoteit-desktop-frontend",
3-
"version": "3.41.0",
3+
"version": "3.42.1",
44
"private": true,
55
"type": "module",
66
"scripts": {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react'
2+
import browser from '../services/browser'
3+
4+
type Props = {
5+
children?: React.ReactNode
6+
}
7+
8+
export const BillingUI: React.FC<Props> = ({ children }) => {
9+
return browser.isAndroid ? null : <>{children}</>
10+
}

frontend/src/components/EventList/EventList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { List, Box, Button, Typography } from '@mui/material'
88
import { fontSizes, spacing } from '../../styling'
99
import { humanizeDays, limitDays } from '../../models/plans'
1010
import { EventItem } from './EventItem'
11-
import { MobileUI } from '../MobileUI'
11+
import { BillingUI } from '../BillingUI'
1212
import { Notice } from '../Notice'
1313

1414
export interface LogListProps {
@@ -41,11 +41,11 @@ export const EventList: React.FC<LogListProps> = ({ device }) => {
4141
<Notice
4242
severity="warning"
4343
button={
44-
<MobileUI android hide>
44+
<BillingUI>
4545
<Button to="/account/plans" variant="contained" color="warning" size="small" component={Link}>
4646
Upgrade
4747
</Button>
48-
</MobileUI>
48+
</BillingUI>
4949
}
5050
>
5151
Plan upgrade required to view logs past {humanizeDays(logLimit?.value)}.

frontend/src/components/LicensingNoticeDisplay.tsx

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { useDispatch, useSelector } from 'react-redux'
55
import { PERSONAL_PLAN_ID } from '../models/plans'
66
import { LicensingTitle } from './LicensingTitle'
77
import { Timestamp } from './Timestamp'
8+
import { BillingUI } from './BillingUI'
89
import { Notice } from './Notice'
910
import { Link } from './Link'
1011
import { Icon } from './Icon'
@@ -29,11 +30,13 @@ export const LicensingNoticeDisplay: React.FC<Props> = ({ noticeType, license, s
2930

3031
const UpgradeButton = (
3132
<>
32-
<Link to="/account/plans">
33-
<Button color="primary" variant="contained" size="small">
34-
Upgrade
35-
</Button>
36-
</Link>
33+
<BillingUI>
34+
<Link to="/account/plans">
35+
<Button color="primary" variant="contained" size="small">
36+
Upgrade
37+
</Button>
38+
</Link>
39+
</BillingUI>
3740
<Tooltip title="Close">
3841
<IconButton onClick={onClose}>
3942
<Icon name="times" size="md" color="primary" />
@@ -49,7 +52,10 @@ export const LicensingNoticeDisplay: React.FC<Props> = ({ noticeType, license, s
4952
<Notice severity="warning" button={UpgradeButton}>
5053
{title} has expired.
5154
<em>
52-
Please upgrade your license. <Link to="/account/plans">Learn more.</Link>
55+
Please upgrade your license.{' '}
56+
<BillingUI>
57+
<Link to="/account/plans">Learn more.</Link>
58+
</BillingUI>
5359
</em>
5460
</Notice>
5561
)
@@ -59,7 +65,10 @@ export const LicensingNoticeDisplay: React.FC<Props> = ({ noticeType, license, s
5965
<Notice severity="error">
6066
{title} is past due.
6167
<em>
62-
Please update your payment method. <Link to="/account/plans">Learn more.</Link>
68+
Please update your payment method.{' '}
69+
<BillingUI>
70+
<Link to="/account/plans">Learn more.</Link>
71+
</BillingUI>
6372
</em>
6473
</Notice>
6574
)
@@ -70,7 +79,11 @@ export const LicensingNoticeDisplay: React.FC<Props> = ({ noticeType, license, s
7079
<Notice severity="warning">
7180
{title} is incomplete.
7281
<em>
73-
Please <Link to="/account/plans">update your payment information </Link> to continue service.
82+
Please{' '}
83+
<BillingUI>
84+
<Link to="/account/plans">update your payment information </Link>
85+
</BillingUI>{' '}
86+
to continue service.
7487
</em>
7588
</Notice>
7689
)
@@ -80,7 +93,10 @@ export const LicensingNoticeDisplay: React.FC<Props> = ({ noticeType, license, s
8093
<Notice severity="warning" button={UpgradeButton}>
8194
{title} has been canceled.
8295
<em>
83-
Please please check. <Link to="/account/plans">Learn more.</Link>
96+
Please check.{' '}
97+
<BillingUI>
98+
<Link to="/account/plans">Learn more.</Link>
99+
</BillingUI>
84100
</em>
85101
</Notice>
86102
)
@@ -91,7 +107,9 @@ export const LicensingNoticeDisplay: React.FC<Props> = ({ noticeType, license, s
91107
{title} <LicensingTitle count={serviceLimit?.value} />
92108
<em>
93109
You have exceeded your limit by {serviceLimit?.actual - serviceLimit?.value}.{' '}
94-
<Link to="/account/plans">Learn more.</Link>
110+
<BillingUI>
111+
<Link to="/account/plans">Learn more.</Link>
112+
</BillingUI>
95113
</em>
96114
</Notice>
97115
)

frontend/src/components/LicensingServiceNotice.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { useSelector } from 'react-redux'
66
import { Button } from '@mui/material'
77
import { Notice } from './Notice'
88
import { Link } from './Link'
9+
import { BillingUI } from './BillingUI'
910

1011
type Props = { device?: IDevice; license?: ILicense }
1112

@@ -25,17 +26,21 @@ export const LicensingServiceNotice: React.FC<Props> = props => {
2526
<Notice
2627
severity="warning"
2728
button={
28-
<Link to="/account/plans">
29-
<Button color="primary" variant="contained" size="small">
30-
Upgrade
31-
</Button>
32-
</Link>
29+
<BillingUI>
30+
<Link to="/account/plans">
31+
<Button color="primary" variant="contained" size="small">
32+
Upgrade
33+
</Button>
34+
</Link>
35+
</BillingUI>
3336
}
3437
>
3538
{title} <LicensingTitle count={serviceLimit?.value} />
3639
<em>
3740
This service will be accessible for {humanizeDays(evaluationLimit?.value)}, unless you upgrade your license.
38-
<Link to="/account/plans">Learn more.</Link>
41+
<BillingUI>
42+
<Link to="/account/plans">Learn more.</Link>
43+
</BillingUI>
3944
</em>
4045
</Notice>
4146
)

frontend/src/components/PlanActionChip.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { selectRemoteitLicense } from '../selectors/organizations'
1111
import { State } from '../store'
1212
import { ColorChip, Props as ChipProps } from './ColorChip'
1313
import { useHistory } from 'react-router-dom'
14+
import { BillingUI } from './BillingUI'
1415

1516
export const PlanActionChip: React.FC<ChipProps> = ({ ...props }) => {
1617
const license = useSelector((state: State) => selectRemoteitLicense(state))
@@ -36,5 +37,9 @@ export const PlanActionChip: React.FC<ChipProps> = ({ ...props }) => {
3637
return null
3738
}
3839

39-
return <ColorChip {...props} size="small" onClick={() => history.push('/account/plans')} />
40+
return (
41+
<BillingUI>
42+
<ColorChip {...props} size="small" onClick={() => history.push('/account/plans')} />
43+
</BillingUI>
44+
)
4045
}

0 commit comments

Comments
 (0)