Meteor.connect is not working react native in v0.61

it seems that in react native v0.61 netInfo has been removed from core package and meteor has’nt been updated since then. Anybody has clue what to do ???
really stock in the middle …

You need to fork it or find a fork that is updated.

I fork it for one of our projects but I stripped out somethings and it doesnt have the same API as the original one.

Or you can check this one that looks like it only fixes that issue and no more.

1 Like

Also be aware that asyncstorage has also been extracted to its own package and is deprecated from the react native import.

Hey @pmogollon!

Can you document your fork in Readme on the changes you’ve made?

That would be really useful if someone else wants to use it.

@vforvasile done. Let me know if there is something else missing.

It looks great @pmogollon!

Could you add some example for the methods below?

  • Call with timeout

  • loginWithPassword

Thanks for your contribution!

Sure, I just added examples for both Meteor.call and loginWithPassword.

I think ill remove all callbacks, still not sure.

Im open to ideas and improvements.

thanks did solve my problem. I had another question though. I cant use the callback function and when i use a function as documentation only error arg works but cant get the result at all. could you help me out here thanks…

I will suggest you to use it with promises or async/await. Ill probably remove the callbacks completely in a future version.

await Meteor.call('methodName', params);

Hope this helps.

1 Like

i tried that but result is still undefined however error work fine here is the code .

signUp = async () => {
try {
// Default timeout is 15,000 (15secs)
await Meteor.call(
‘user.createNewUser’,
‘aminnnssssdwssb’,
‘111111’,
(error, result) => {
console.log(‘error’, error);
console.log(‘result’, result);
},
);
} catch (error) {
Alert.alert(‘There was an error!’, error.reason);
} finally {
}
};

You dont need to pass the callback.

signUp = async () => {
  try {
    const response = await Meteor.call('user.createNewUser', 'aminnnssssdwssb', '111111');
  } catch (error) {
    Alert.alert(‘There was an error!’, error.reason);
  }
};

@pmogollon, in my case, loginWithPassword throws an error on the server saying not all the checks have been made.