diff --git a/README.md b/README.md index bfc9ab9..e14107a 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,8 @@ npm i --save react-native-meteor ## Compatibility notes +Upgraded packages to working in RN >= 0.57 + Since RN 0.26.0 you have to use ws or wss protocol to connect to your meteor server. http is not working on Android. It is recommended to always use the latest version of react-native-meteor compatible with your RN version: diff --git a/example/RNApp/android/.project b/example/RNApp/android/.project new file mode 100644 index 0000000..45c8807 --- /dev/null +++ b/example/RNApp/android/.project @@ -0,0 +1,17 @@ + + + android______ + Project android______ created by Buildship. + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.buildship.core.gradleprojectnature + + diff --git a/example/RNApp/android/.settings/org.eclipse.buildship.core.prefs b/example/RNApp/android/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..e889521 --- /dev/null +++ b/example/RNApp/android/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir= +eclipse.preferences.version=1 diff --git a/package.json b/package.json index e5e8fa3..e9e9d3f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-meteor", - "version": "1.4.0", + "version": "1.4.2", "description": "Full Meteor Client for React Native", "main": "src/Meteor.js", "scripts": { @@ -57,6 +57,6 @@ }, "peerDependencies": { "react": "*", - "react-native": ">= 0.49.0" + "react-native": ">= 0.57.0" } } diff --git a/src/Meteor.js b/src/Meteor.js index 20be280..d80d445 100644 --- a/src/Meteor.js +++ b/src/Meteor.js @@ -1,5 +1,5 @@ -import { NetInfo, Platform, View } from 'react-native'; - +import { Platform, View } from 'react-native'; +import NetInfo from "@react-native-community/netinfo"; import reactMixin from 'react-mixin'; import Trackr from 'trackr'; import EJSON from 'ejson'; @@ -75,7 +75,7 @@ module.exports = { reconnect() { Data.ddp && Data.ddp.connect(); }, - connect(endpoint, options) { + connect(endpoint, options, callback) { if (!endpoint) endpoint = Data._endpoint; if (!options) options = Data._options; @@ -107,6 +107,7 @@ module.exports = { console.info('Connected to DDP server.'); this._loadInitialUser().then(() => { this._subscriptionsRestart(); + typeof callback == 'function' && callback(); }); }); diff --git a/src/user/User.js b/src/user/User.js index 86fd1c9..fbd76a3 100644 --- a/src/user/User.js +++ b/src/user/User.js @@ -1,4 +1,4 @@ -import { AsyncStorage } from 'react-native'; +import AsyncStorage from '@react-native-community/async-storage'; import Data from '../Data'; import { hashPassword } from '../../lib/utils';