Skip to content

Commit 36bdb04

Browse files
authored
Bug 1993521 - Expose getAttachedClients from FxaClient wrapperr=bdk,gmalekpour (#7007)
We want to use this a way to know if a user has an attached service connected.
1 parent 2cbb4c1 commit 36bdb04

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
### Places
2020
- `places::storage::history_metadata::get_most_recent(limit: i32)` was added to get most recent history metadata limited to a number. ([#7002](https://github.com/mozilla/application-services/pull/7002))
2121

22+
### FxA Client
23+
- Expose `getAttachedClients` from the uniffi layer in the Android wrapper.
2224

2325
## 🦊 What's Changed 🦊
2426

components/fxa-client/android/src/main/java/mozilla/appservices/fxaclient/FxaClient.kt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,29 @@ class FxaClient(inner: FirefoxAccount, persistCallback: PersistCallback?) : Auto
265265
}
266266
}
267267

268+
/**
269+
* Get the list of all client applications attached to the user's account.
270+
*
271+
* This method returns a list of [AttachedClient] structs representing all the applications
272+
* connected to the user's account. This includes applications that are registered as a device
273+
* as well as server-side services that the user has connected.
274+
*
275+
* This information is really only useful for targeted messaging or marketing purposes,
276+
* e.g. if the application wants to advertize a related product, but first wants to check
277+
* whether the user is already using that product.
278+
*
279+
* # Notes
280+
*
281+
* - Attached client metadata is only visible to applications that have been
282+
* granted the `https:///identity.mozilla.com/apps/oldsync` scope.
283+
284+
*/
285+
fun getAttachedClients(): List<AttachedClient> {
286+
return withMetrics {
287+
this.inner.getAttachedClients()
288+
}
289+
}
290+
268291
/**
269292
* Tries to fetch an access token for the given scope.
270293
*

0 commit comments

Comments
 (0)