Skip to content
This repository was archived by the owner on May 15, 2020. It is now read-only.

Not working with react-native 0.7.0-rc.2 #2

Closed
PhilippKrone opened this issue Jun 30, 2015 · 18 comments
Closed

Not working with react-native 0.7.0-rc.2 #2

PhilippKrone opened this issue Jun 30, 2015 · 18 comments

Comments

@PhilippKrone
Copy link

Hi,

the fetch() statement creates an error in RCTNetworking.m (see facebook/react-native#1780).

Regards
Philipp

@PhilippKrone
Copy link
Author

@lwansbrough Please see facebook/react-native#1780

@jacob-israel-turner
Copy link
Contributor

Should this issue be closed now?

@dorthwein
Copy link
Contributor

Running into the same issue - I previously got it working on another app but no luck now....

@lwansbrough
Copy link
Collaborator

@dorthwein Check out the thread linked above. It's probably not going to be fixed for iOS 7 unfortunately.

dorthwein added a commit to dorthwein/react-native-google-analytics that referenced this issue Oct 7, 2015
@dorthwein
Copy link
Contributor

I read through the thread but the issue is persisting on iOS 9 simulator.

@lwansbrough
Copy link
Collaborator

@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.

lwansbrough added a commit that referenced this issue Oct 11, 2015
Changing request to "Get" method to resolve Issue #2
@lwansbrough
Copy link
Collaborator

Thanks @dorthwein for resolving this issue with an elegant fix.

@nicholasalanbrown
Copy link

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);
    });
  }

@ilanasufrin
Copy link

@nicholasalanbrown I'm having the same problem as you. Did you ever get a fix?

@nicholasalanbrown
Copy link

@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.

@nicholasalanbrown
Copy link

Just tried again but still consistently get this error:

image

..and still no data showing in GA

@tgoldenberg
Copy link

@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",

@nicholasalanbrown
Copy link

I tried downgrading to 0.13.0 and still got the same error FWIW.

@lwansbrough
Copy link
Collaborator

facebook/react-native#1780 It was being tracked there. Are you guys using iOS 7?

@Sexycrets
Copy link

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.

@lwansbrough
Copy link
Collaborator

@Sexycrets Thanks for the update

@adamloving
Copy link

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.

@lwansbrough
Copy link
Collaborator

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants