| 125 | } |
| 126 | |
| 127 | export class User implements IUser { |
| 128 | _native: com.google.firebase.auth.FirebaseUser; |
| 129 | get native() { |
| 130 | return this._native; |
| 131 | } |
| 132 | |
| 133 | get android() { |
| 134 | return this.native; |
| 135 | } |
| 136 | |
| 137 | static fromNative(user: com.google.firebase.auth.FirebaseUser) { |
| 138 | if (user instanceof com.google.firebase.auth.FirebaseUser) { |
| 139 | const usr = new User(); |
| 140 | usr._native = user; |
| 141 | return usr; |
| 142 | } |
| 143 | return null; |
| 144 | } |
| 145 | |
| 146 | get displayName(): string { |
| 147 | return this.native?.getDisplayName?.(); |
| 148 | } |
| 149 | |
| 150 | get anonymous() { |
| 151 | return this.native?.isAnonymous?.(); |
| 152 | } |
| 153 | |
| 154 | get emailVerified(): boolean { |
| 155 | return this.native?.isEmailVerified?.(); |
| 156 | } |
| 157 | |
| 158 | get email(): string { |
| 159 | return this.native?.getEmail?.(); |
| 160 | } |
| 161 | |
| 162 | get uid(): string { |
| 163 | return this.native?.getUid?.(); |
| 164 | } |
| 165 | |
| 166 | get phoneNumber(): string { |
| 167 | return this.native?.getPhoneNumber?.(); |
| 168 | } |
| 169 | |
| 170 | get providerId(): string { |
| 171 | return this.native?.getProviderId?.(); |
| 172 | } |
| 173 | |
| 174 | get photoURL(): string { |
| 175 | let url; |
| 176 | try { |
| 177 | url = this.native?.getPhotoUrl()?.toString?.(); |
| 178 | } catch (e) {} |
| 179 | return url; |
| 180 | } |
| 181 | |
| 182 | get metadata(): UserMetadata { |
| 183 | return UserMetadata.fromNative(this.native?.getMetadata?.()); |
| 184 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…