fix(analytics) avoid Amplitude initialization failure on mobile

This commit is contained in:
Saúl Ibarra Corretgé 2020-09-24 11:51:54 +02:00 committed by Saúl Ibarra Corretgé
parent ce4ef96941
commit 1a339100ab
1 changed files with 5 additions and 0 deletions

View File

@ -72,6 +72,11 @@ export default class AmplitudeHandler extends AbstractHandler {
* @returns {Object}
*/
getIdentityProps() {
// TODO: Remove when web and native Aplitude implementations are unified.
if (navigator.product === 'ReactNative') {
return {};
}
return {
sessionId: amplitude.getInstance(this._amplitudeOptions).getSessionId(),
deviceId: amplitude.getInstance(this._amplitudeOptions).options.deviceId,