Error adding pinpoint analytics to a pure react native project

46 Views Asked by At

I am trying to capture an event with the Amazon Pinpoint analytics service. I have already followed the corresponding steps such as starting amplify, configuring my AWS account data, installing and importing the analytics functions of the amplify service.

I created a test function where pressing a button records the following event:

import { Amplify, Analytics } from 'aws-amplify';

const handleButton=()=>{

  Analytics.record({ name: 'test' });

}

.
.
.

I already have a pinpoint project linked to my project, what I want to achieve now is to be able to capture certain metrics and have them reflected in the pinpoint console, but my project throws this error:

Error image

Error

I have already carried out tests in a react web project and also in a project carried out with expo, and Analytics is recognized correctly and captures the metrics well, I think the problem is related to pure react native, surely something specific needs to be added Which expo or react web do it automatically, any suggestions? I tried everything in the documentation but I can't find a solution.

Thank you!

0

There are 0 best solutions below