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

[firebase-analytics] Add DebugView support on Expo client #7796

Merged
merged 21 commits into from Apr 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b908be6
[firebase-analytics] Add FirebaseAnalyticsJS export
IjzerenHein Apr 7, 2020
414d9e4
[firebase-analytics] Add sessionId required for DebugView
IjzerenHein Apr 7, 2020
568a669
[firebase-analytics] Add DebugView support for JS analytics
IjzerenHein Apr 7, 2020
417a0f1
[firebase-analytics] update build files
IjzerenHein Apr 7, 2020
ef5eb2b
[firebase-analytics] Add debug-mode for Expo client
IjzerenHein Apr 10, 2020
a13fe40
[docs] Add firebase-analytics `setDebugModeEnabled` option
IjzerenHein Apr 10, 2020
7056b94
[fireabse-analytics] Add debug-mode test
IjzerenHein Apr 10, 2020
591c2b8
[firebase-analytics] Update JS build files
IjzerenHein Apr 10, 2020
160ba70
[firebase-analytics] Better error message when setDebugModeEnabled is…
IjzerenHein Apr 10, 2020
b50780e
[fireabse-analytics] Update js build files
IjzerenHein Apr 10, 2020
09b0d08
[firebase-analytics] Fix failing test on setDebugModeEnabled
IjzerenHein Apr 14, 2020
a20e2fa
[firebase-analytics] Fix not all events visible in cloud
IjzerenHein Apr 14, 2020
4b05373
[firebase-analytics] Update JS build files
IjzerenHein Apr 14, 2020
3c83a9e
[fireabse-analytics] Update headers to closer match JS SDK
IjzerenHein Apr 14, 2020
295d952
[firebase-analytics] Add initial sending of session start
IjzerenHein Apr 14, 2020
38ec508
[firebase-analytics] Add session-number support
IjzerenHein Apr 14, 2020
a6e22d4
[firebase-analytics] Log to console when debug-mode is enabled
IjzerenHein Apr 14, 2020
fc611c2
[firebase-analytics] Fix typing
IjzerenHein Apr 14, 2020
c7453d5
[firebase-analytics] Update js build files
IjzerenHein Apr 14, 2020
109c709
[firebase-analytics] Fix test-suite
IjzerenHein Apr 14, 2020
c553bcd
[firebase-analytics] Update changelog
IjzerenHein Apr 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 22 additions & 0 deletions apps/test-suite/tests/FirebaseAnalytics.js
Expand Up @@ -6,6 +6,8 @@ export const name = 'FirebaseAnalytics';

export async function test({ describe, beforeAll, afterAll, it, xit, expect }) {
const isConfigured = !!FirebaseCore.DEFAULT_APP_OPTIONS;
const isWebConfigured = !!FirebaseCore.DEFAULT_WEB_APP_OPTIONS;
const isExpoClient = FirebaseCore.DEFAULT_APP_NAME !== '[DEFAULT]';
const itWhenConfigured = isConfigured ? it : xit;
const itWhenNotConfigured = isConfigured ? xit : it;

Expand Down Expand Up @@ -163,5 +165,25 @@ export async function test({ describe, beforeAll, afterAll, it, xit, expect }) {
expect(error).toBeNull();
});
});
describe('setDebugModeEnabled()', async () => {
it(
isExpoClient && isConfigured && isWebConfigured
? `runs on client with web-config`
: `fails when not on client or without web-config`,
async () => {
let error = null;
try {
await Analytics.setDebugModeEnabled(true);
} catch (e) {
error = e;
}
if (isExpoClient && isConfigured && isWebConfigured) {
expect(error).toBeNull();
} else {
expect(error).not.toBeNull();
}
}
);
});
});
}
10 changes: 10 additions & 0 deletions docs/pages/versions/unversioned/sdk/firebase-analytics.md
Expand Up @@ -300,6 +300,16 @@ on the Expo client.
Analytics.setUnavailabilityLogging(false);
```

### setDebugModeEnabled

```tsx
setDebugModeEnabled(isEnabled: boolean): Promise<void>
```

Enables debug mode *(Expo client only)* so events can be tracked using the [DebugView in the Analytics dashboard](https://firebase.google.com/docs/analytics/debugview#reporting).

This option is **only available on the standard Expo client**. When using a standalone build, the bare workflow or web, use the [natively available options](https://firebase.google.com/docs/analytics/debugview).

# Examples

## How do people use my app?
Expand Down
10 changes: 10 additions & 0 deletions docs/pages/versions/v37.0.0/sdk/firebase-analytics.md
Expand Up @@ -300,6 +300,16 @@ on the Expo client.
Analytics.setUnavailabilityLogging(false);
```

### setDebugModeEnabled

```tsx
setDebugModeEnabled(isEnabled: boolean): Promise<void>
```

Enables debug mode *(Expo client only)* so events can be tracked using the [DebugView in the Analytics dashboard](https://firebase.google.com/docs/analytics/debugview#reporting).

This option is **only available on the standard Expo client**. When using a standalone build, the bare workflow or web, use the [natively available options](https://firebase.google.com/docs/analytics/debugview).

# Examples

## How do people use my app?
Expand Down
5 changes: 4 additions & 1 deletion packages/expo-firebase-analytics/CHANGELOG.md
Expand Up @@ -6,7 +6,10 @@

### 🎉 New features

- Add `setDebugModeEnabled` for enabling DebugView on the Expo client. ([#7796](https://github.com/expo/expo/pull/7796) by [@IjzerenHein](https://github.com/IjzerenHein))

### 🐛 Bug fixes

- Fix `expo-firebase-analytics` not recording events on the Expo client running on certain Android devices. ([#7192](https://github.com/expo/expo/pull/7679) by [@IjzerenHein](https://github.com/IjzerenHein))
- Fix no events recorded on the Expo client when running on certain Android devices. ([#7679](https://github.com/expo/expo/pull/7679) by [@IjzerenHein](https://github.com/IjzerenHein))
- Fix `setAnalyticsCollectionEnabled` throwing an error.
- Fixes & improvements to the pure JS analytics client. ([#7796](https://github.com/expo/expo/pull/7796) by [@IjzerenHein](https://github.com/IjzerenHein))
14 changes: 13 additions & 1 deletion packages/expo-firebase-analytics/build/Analytics.d.ts

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

19 changes: 18 additions & 1 deletion packages/expo-firebase-analytics/build/Analytics.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-firebase-analytics/build/Analytics.js.map

Large diffs are not rendered by default.

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

18 changes: 16 additions & 2 deletions packages/expo-firebase-analytics/build/ExpoFirebaseAnalytics.js

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