react-native-segment icon indicating copy to clipboard operation
react-native-segment copied to clipboard

Android support

Open lovegrovegeorge opened this issue 8 years ago • 6 comments

Any roadmap plans for this to function with Android?

lovegrovegeorge avatar Mar 31 '16 00:03 lovegrovegeorge

Definitely not perfect, but I filed a PR for Android support here: https://github.com/smore-inc/react-native-segment-io-analytics/pull/18

rreusser avatar Apr 19 '16 21:04 rreusser

any updates on the android support ?

mrharel avatar Jun 28 '16 09:06 mrharel

@mrharel did you check out https://github.com/smore-inc/react-native-segment-io-analytics ?

kevinstumpf avatar Jun 28 '16 16:06 kevinstumpf

@mrharel: update, to the best of my knowledge, is that, as @kevinstumpf points out, smore-inc's version has an android PR, and that @cancan101 cleaned up my PR wonderfully: smore-inc/react-native-segment-io-analytics#26 in a way that's hopefully reasonably usable, depending on the rigor and extent of your needs.

rreusser avatar Jun 28 '16 16:06 rreusser

thanks for the update. actually, since i only needed the identity i decided that it will be much simpler just to use the HTTP API using fetch to support all devices

fetch('https://api.segment.io/v1/identify',{
      method: "POST",
      headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json',
        'Authorization': 'Basic eVFQcWZwaXcwQTdueU1kdmlweDACeWo1V2NFV2RCTEs6 '

      },
      body: JSON.stringify(segmentData)
    }).then((response) => response.json())
      .then((responseData) => {
        console.log(responseData);
      }).catch((err)=>{
      console.error(err);
    });

i have to provide the context data manually (OS and version...) but other than that it is very simple.

mrharel avatar Jun 28 '16 16:06 mrharel

Nice. Keepin' it simple. 👍

rreusser avatar Jun 28 '16 16:06 rreusser