Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

133
Views
AWS Datastore not saving users in the database on Android

I have a code that will save user in the database on my profile screen, but the code worked fine on iOS, but on android it throws a "Possible unhandled Promise Rejection" with "TypeError: Symbol.asyncIterator is not defined." Please how can solve the issue on Android so that it can save to database? I am working with React Native. Here is the code snippet:

import {Auth, DataStore} from 'aws-amplify';

const ProfileScreen = () => {

    const [name, setName] = useState('');
    const [bio, setBio] = useState('');
    const [gender, setGender] = useState();
    const [lookingfor, setLookingfor] = useState();

    const isValid = () => {
        return name && bio && gender && lookingfor;
    };

    const save = () => {
        if(!isValid()) {
            console.warn('Not valid');
            return;
        }

        const newUser = new User({
            name,
            bio,
            gender,
            lookingfor,
            image: 'https://notjustdev-dummy.s3.us-east-2.amazonaws.com/avatars/elon.png',
        });

        DataStore.save(newUser);

    };
    return ...

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Accoding to the documentation, since save returns a promise instead of doing the opeartion itself, add await or subscribe with then to the save function;

await DataStore.save(newUser); 

or

DataStore.save(newUser).then(...);
about 4 years ago · Juan Pablo Isaza Report

0

I've been doing the same project. It worked for me when I did:

npm install @azure/core-asynciterator-polyfill

Then added:

import '@azure/core-asynciterator-polyfill'; 

at the very top of my imports in the page I was working on.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!