Not working with react-native 0.7.0-rc.2
PhilippKrone opened this issue · 18 comments
Hi,
the fetch() statement creates an error in RCTNetworking.m (see facebook/react-native#1780).
Regards
Philipp
@lwansbrough Please see facebook/react-native#1780
Should this issue be closed now?
Running into the same issue - I previously got it working on another app but no luck now....
@dorthwein Check out the thread linked above. It's probably not going to be fixed for iOS 7 unfortunately.
I read through the thread but the issue is persisting on iOS 9 simulator.
@dorthwein Interesting, I'll look into it when I get a chance. If you discover the issue and have a fix, feel free to submit a PR. Thanks for resurfacing this issue.
Thanks @dorthwein for resolving this issue with an elegant fix.
This might be related, I get this error in Xcode when following a simple parallel to your setup instructions:
[tid:com.facebook.React.RCTNetworkingQueue][RCTNetworking.m:320] Received data was not a string, or was not a recognised encoding.
I get the same in the Chrome console. I also see no data tracked in Google Analytics. Here's my code:
import React from 'react-native';
import globalStyles from '../styles/styles';
import Colors from '../styles/colors';
import Config from '../config';
let {
AppRegistry,
View,
Text,
Image,
TouchableOpacity,
StyleSheet,
Animated,
Easing,
Dimensions,
StatusBarIOS,
ScrollView,
} = React;
var {
Analytics,
Tracking: GATracking,
Hits: GAHits,
Experiment: GAExperiment
} = require('react-native-google-analytics');
let {
width: deviceWidth,
height: deviceHeight
} = Dimensions.get('window');
var ga = this.ga = null;
class Welcome extends React.Component{
componentWillMount() {
GATracking.getClientId(function(err, clientId) {
ga = new Analytics('UA-47880XXX-X', clientId);
var screenView = new GAHits.ScreenView('GA Test', '1', 'org.reactjs.native.example.test');
ga.send(screenView);
});
}
@nicholasalanbrown I'm having the same problem as you. Did you ever get a fix?
@lwansbrough still haven't been able to get it to work, though @lwansbrough did offer to take a look after I posted to the Facebook React Native Community.
@lwansbrough, any update on this issue? I tried the above code after following the README and got the same error. Does this have anything to do with the version of RN? I am using "react-native": "^0.14.2",
I tried downgrading to 0.13.0
and still got the same error FWIW.
facebook/react-native#1780 It was being tracked there. Are you guys using iOS 7?
Had the same issue. Switching iOS from 7.0 to 8.1 solved it. I receive the events on GA.
The "Received data was not a string, or was not a recognised encoding." warning is still present.
@Sexycrets Thanks for the update
Still seeing this on iOS 9.3. Tracked the error message down to here: https://github.com/facebook/react-native/blob/master/Libraries/Network/RCTNetworking.m#L330 Looks like the response from ga.send() contains data, but cannot be decoded.
@adamloving Yeah, it's been an ongoing issue. You get a warning but the analytics are sent fine. The response is irrelevant. It's a React Native bug - image data isn't supported over XHR.