Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Android Advertising ID does not update unless app is relaunched #1033

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: removed actual write key with placeholder after testing
Sunita Prajapati committed Nov 18, 2024
commit 7c5a59e7ee4724e35dac959ccc7553ab90c7e895
2 changes: 1 addition & 1 deletion examples/AnalyticsReactNativeExample/App.tsx
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ import {useState} from 'react';
// import { BrazePlugin } from '@segment/analytics-react-native-plugin-braze';

const segmentClient = createClient({
writeKey: 'KDzygiYHVtaOeNDmSTzcGDH2KMkJCPTM',
writeKey: '<WRITE_KEY>',
trackAppLifecycleEvents: true,
collectDeviceId: true,
debug: true,
4 changes: 3 additions & 1 deletion examples/AnalyticsReactNativeExample/package.json
Original file line number Diff line number Diff line change
@@ -15,9 +15,11 @@
"clean:ios": "rimraf ios/build ios/Pods"
},
"dependencies": {
"@react-native-async-storage/async-storage": "^2.0.0",
"@react-native-async-storage/async-storage": "^2.1.0",
"@react-navigation/native": "^6.1.18",
"@react-navigation/stack": "^6.4.1",
"@segment/analytics-react-native": "^2.20.3",
"@segment/sovran-react-native": "^1.1.3",
"react": "18.3.1",
"react-native": "0.76.1",
"react-native-gesture-handler": "^2.20.2",
Loading

Unchanged files with check annotations Beta

},
};
const store = new MockSegmentStore({

Check warning on line 176 in packages/core/src/__tests__/internal/checkInstalledVersion.test.ts

GitHub Actions / build-and-test

'store' is already declared in the upper scope on line 22 column 9
context: {
...currentContext,
...injectedContextByPlugins,
expect(appStateChangeListener).toBeDefined();
appStateChangeListener!(to);

Check warning on line 64 in packages/core/src/__tests__/internal/handleAppStateChange.test.ts

GitHub Actions / build-and-test

Forbidden non-null assertion
// Since the calls to process lifecycle events are not awaitable we have to await for ticks here
await new Promise(process.nextTick);
await new Promise(process.nextTick);
it('stamps basic data: timestamp and messageId for pending events when not ready', async () => {
const client = new SegmentClient(clientArgs);
jest.spyOn(client.isReady, 'value', 'get').mockReturnValue(false);
// @ts-ignore

Check warning on line 41 in packages/core/src/__tests__/methods/process.test.ts

GitHub Actions / build-and-test

Do not use "@ts-ignore" because it alters compilation errors
const timeline = client.timeline;
jest.spyOn(timeline, 'process');
};
// While not ready only timestamp and messageId should be defined
// @ts-ignore

Check warning on line 56 in packages/core/src/__tests__/methods/process.test.ts

GitHub Actions / build-and-test

Do not use "@ts-ignore" because it alters compilation errors
const pendingEvents = client.store.pendingEvents.get();
expect(pendingEvents.length).toBe(1);
const pendingEvent = pendingEvents[0];
// When ready it replays events
jest.spyOn(client.isReady, 'value', 'get').mockReturnValue(true);
// @ts-ignore

Check warning on line 69 in packages/core/src/__tests__/methods/process.test.ts

GitHub Actions / build-and-test

Do not use "@ts-ignore" because it alters compilation errors
await client.onReady();
expectedEvent = {
...expectedEvent,
anonymousId: store.userInfo.get().anonymousId,
};
// @ts-ignore

Check warning on line 78 in packages/core/src/__tests__/methods/process.test.ts

GitHub Actions / build-and-test

Do not use "@ts-ignore" because it alters compilation errors
expect(client.store.pendingEvents.get().length).toBe(0);
expect(timeline.process).toHaveBeenCalledWith(
const client = new SegmentClient(clientArgs);
jest.spyOn(client.isReady, 'value', 'get').mockReturnValue(true);
// @ts-ignore

Check warning on line 90 in packages/core/src/__tests__/methods/process.test.ts

GitHub Actions / build-and-test

Do not use "@ts-ignore" because it alters compilation errors
const timeline = client.timeline;
jest.spyOn(timeline, 'process');
anonymousId: store.userInfo.get().anonymousId,
} as SegmentEvent;
// @ts-ignore

Check warning on line 107 in packages/core/src/__tests__/methods/process.test.ts

GitHub Actions / build-and-test

Do not use "@ts-ignore" because it alters compilation errors
const pendingEvents = client.store.pendingEvents.get();
expect(pendingEvents.length).toBe(0);
const client = new SegmentClient(clientArgs);
jest.spyOn(client.isReady, 'value', 'get').mockReturnValue(true);
// @ts-ignore

Check warning on line 120 in packages/core/src/__tests__/methods/process.test.ts

GitHub Actions / build-and-test

Do not use "@ts-ignore" because it alters compilation errors
const timeline = client.timeline;
jest.spyOn(timeline, 'process');
anonymousId: 'foo',
} as SegmentEvent;
// @ts-ignore

Check warning on line 152 in packages/core/src/__tests__/methods/process.test.ts

GitHub Actions / build-and-test

Do not use "@ts-ignore" because it alters compilation errors
const pendingEvents = client.store.pendingEvents.get();
expect(pendingEvents.length).toBe(0);