Skip to content

Commit

Permalink
Remove !IS_DEV check for idfa and ff it (#5808)
Browse files Browse the repository at this point in the history
* remove is prod check that wraps the check

* add ff

* add strict check for dev
  • Loading branch information
walmat authored and ibrahimtaveras00 committed Jun 4, 2024
1 parent 2dd5db3 commit fa48195
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
13 changes: 8 additions & 5 deletions src/model/backup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { Navigation } from '@/navigation';
import Routes from '@/navigation/routesNames';
import { clearAllStorages } from './mmkv';
import walletBackupStepTypes from '@/helpers/walletBackupStepTypes';
import { getRemoteConfig } from './remoteConfig';

const { DeviceUUID } = NativeModules;
const encryptor = new AesEncryptor();
Expand Down Expand Up @@ -723,6 +724,11 @@ export async function checkIdentifierOnLaunch() {
// Unable to really persist things on Android, so let's just exit early...
if (IS_ANDROID) return;

const { idfa_check_enabled } = getRemoteConfig();
if (!idfa_check_enabled || IS_DEV) {
return;
}

try {
const uuid = await getDeviceUUID();
if (!uuid) {
Expand Down Expand Up @@ -757,11 +763,8 @@ export async function checkIdentifierOnLaunch() {
return;
}

if (!IS_DEV) {
// if our identifiers match up, we can assume no reinstall/migration
if (currentIdentifier.value === uuid) {
return;
}
if (currentIdentifier.value === uuid) {
return;
}

return new Promise(resolve => {
Expand Down
6 changes: 5 additions & 1 deletion src/model/remoteConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ export interface RainbowConfig extends Record<string, string | boolean | number>
points_notifications_toggle: boolean;
dapp_browser: boolean;
swaps_v2: boolean;

idfa_check_enabled: boolean;
}

export const DEFAULT_CONFIG: RainbowConfig = {
Expand Down Expand Up @@ -165,6 +167,7 @@ export const DEFAULT_CONFIG: RainbowConfig = {
points_notifications_toggle: true,
dapp_browser: true,
swaps_v2: false,
idfa_check_enabled: true,
};

export async function fetchRemoteConfig(): Promise<RainbowConfig> {
Expand Down Expand Up @@ -216,7 +219,8 @@ export async function fetchRemoteConfig(): Promise<RainbowConfig> {
key === 'remote_cards_enabled' ||
key === 'points_notifications_toggle' ||
key === 'dapp_browser' ||
key === 'swaps_v2'
key === 'swaps_v2' ||
key === 'idfa_check_enabled'
) {
config[key] = entry.asBoolean();
} else {
Expand Down

0 comments on commit fa48195

Please sign in to comment.