capacitor-community / capacitor-community/firebase-analytics

Unable to set userId to null

Open
#49 17 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
178
Forks
70
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
setUserId method does not accept null.

https://github.com/capacitor-community/firebase-analytics/blob/master/src/web.ts#L83

**To Reproduce**
```
FirebaseAnalytics.setUserId({
userId: null,
});
```

**Expected behavior**
When the user logs out, it must be possible to assign null value to it.

See here: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics#public-void-setuserid-string-id

Contributor guide

Open the contributing guide

Research direction

Inspect src/web.ts around line 83 and reproduce the setUserId call with userId: null. Compare the expected logout behavior with the linked Firebase Analytics reference; done means the call accepts null and clears the user ID without an error.

Written by the indexing model from the issue text.

Assessment

Tech stack
firebase, typescript
Domain
analytics, api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.