Skip to content

Commit

Permalink
[repo] Deprecate installationId (#10997)
Browse files Browse the repository at this point in the history
# Why

#6749 (comment)

# How

Where it was obvious how to, I replaced it with custom implementation. Where it wasn't obvious:

https://github.com/expo/expo/blob/b9fac3f10f8c073da02e27a26730633186a4df24/packages/expo-firebase-analytics/src/ExpoFirebaseAnalytics.ts#L51-L62

I left it as it was.

# Test Plan

TS compiles.
  • Loading branch information
sjchmiela committed Nov 23, 2020
1 parent d48a794 commit 7e34778
Show file tree
Hide file tree
Showing 31 changed files with 189 additions and 18 deletions.
2 changes: 2 additions & 0 deletions docs/pages/versions/unversioned/sdk/constants.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ Gets the user agent string which would be included in requests sent by a web vie

### `Constants.installationId`

> ⚠️ **This property is deprecated and will be removed in SDK 43. Please implement it on your own using `expo-application`'s [`androidId`](../application/#applicationandroidid) on Android and a storage API such as [`expo-secure-store`](../securestore/) on iOS and `localStorage` on Web.**
An identifier that is unique to this particular device and installation of the Expo client.

### `Constants.isDevice`
Expand Down
2 changes: 2 additions & 0 deletions packages/expo-application/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

### 🐛 Bug fixes

- Fixed TS types of `getIosIdForVendorAsync` method as it may return `null` in non-iOS environments. ([#10997](https://github.com/expo/expo/pull/10997) by [@sjchmiela](https://github.com/sjchmiela))

## 2.4.0 — 2020-11-17

_This version does not introduce any user-facing changes._
Expand Down
2 changes: 1 addition & 1 deletion packages/expo-application/build/Application.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/expo-application/build/Application.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/expo-application/build/Application.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/expo-application/src/Application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export async function getInstallReferrerAsync(): Promise<string> {
return await ExpoApplication.getInstallReferrerAsync();
}

export async function getIosIdForVendorAsync(): Promise<string> {
export async function getIosIdForVendorAsync(): Promise<string | null> {
if (!ExpoApplication.getIosIdForVendorAsync) {
throw new UnavailabilityError('expo-application', 'getIosIdForVendorAsync');
}
return await ExpoApplication.getIosIdForVendorAsync();
return (await ExpoApplication.getIosIdForVendorAsync()) ?? null;
}

export enum ApplicationReleaseType {
Expand Down
1 change: 1 addition & 0 deletions packages/expo-constants/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### 🛠 Breaking changes

- Fixed `installationId` being backed up on Android which resulted in multiple devices having the same `installationId`. ([#11005](https://github.com/expo/expo/pull/11005) by [@sjchmiela](https://github.com/sjchmiela))
- Deprecated `.installationId` and `.deviceId` as these properties can be implemented in user space. Instead, implement the installation identifier on your own using `expo-application`'s `.androidId` on Android and a storage API like `expo-secure-store` on iOS and `localStorage` on Web. ([#10997](https://github.com/expo/expo/pull/10997) by [@sjchmiela](https://github.com/sjchmiela))

### 🎉 New features

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7e34778

Please sign in to comment.