Git Product home page Git Product logo

Comments (15)

giannif avatar giannif commented on June 2, 2024 2

@devpascoe gotcha. We're a bit off in developing this, we'll have a new @giphy/react-native-components library and everything. Excited to work on it though, hopefully soon 🤞

from giphy-js.

destinybonavita avatar destinybonavita commented on June 2, 2024 1

Has anyone had any luck getting @giphy/js-fetch-api working in React Native?
I'm getting the error "Can't find variable: location" and not having much luck trying to figure out how to fix it.

from giphy-js.

giannif avatar giannif commented on June 2, 2024

Thanks @devpascoe ! When you say working again, what do you mean is working?

from giphy-js.

devpascoe avatar devpascoe commented on June 2, 2024

Working as in the Xcode project will build again.

from giphy-js.

devpascoe avatar devpascoe commented on June 2, 2024

Fun! Getting by with using your urls directly for now. 👍

from giphy-js.

banatiarpit97 avatar banatiarpit97 commented on June 2, 2024

Facing the same issue with Android app as well.

from giphy-js.

giannif avatar giannif commented on June 2, 2024

@banatiarpit97 don't forget we do have native SDKs: https://developers.giphy.com/docs/sdk#android React Native SDK isn't currently being worked on, but it is on the roadmap

from giphy-js.

banatiarpit97 avatar banatiarpit97 commented on June 2, 2024

Yes, I know about the Android SDK but integrative native SDK on a react native app would be a tedious task for me. Directly hitting Giphy URLs seems an easier option right now.
Anyways, excited to see a React Native SDK in future.

from giphy-js.

giannif avatar giannif commented on June 2, 2024

@destinybonavita can you see where location is being referenced? There isn't anything in the giphy/js repo that looks problematic to me. It could be a dependency though

from giphy-js.

destinybonavita avatar destinybonavita commented on June 2, 2024

@giannif I didn't see anything in the repo that could of been causing it. I searched my entire repo, node_modules included, for location but couldn't find anything. I eventually just decided to use the REST API.

from giphy-js.

giannif avatar giannif commented on June 2, 2024

@destinybonavita thanks for giving it a shot. React Native support is on our roadmap. Stay tuned

from giphy-js.

szymonograbek avatar szymonograbek commented on June 2, 2024

I've just worked on giphy picker for a react native project and to make this library work with it I needed to edit these files:

  • get-pingback-id.js in js-utils - react native doesn't have sessionStorage so as a workaround you can just check if the sessionStorage exists and if it doesn't generate new pingbackId without saving it
  • log.js in js-utils - to enable the Logger it uses location which is not available in react native so as a solution you need to add an additional check typeof location !== 'undefined'

from giphy-js.

giannif avatar giannif commented on June 2, 2024

@szymonograbek thanks for digging in here, I'm going to make the changes and do a release. Confused though about what I can do for sessionStorage, is there an error thrown? It looks like everything is a in a try catch and pingback id should still be stored in memory

from giphy-js.

szymonograbek avatar szymonograbek commented on June 2, 2024

@giannif Oh, that's true, I didn't notice the try/catch block. The change with checking if sessionStorage exists is not needed. Since yesterday I came across another issue and you need to follow this https://github.com/uuidjs/uuid#getrandomvalues-not-supported as getRandomValues in uuid is not supported in react-native

from giphy-js.

giannif avatar giannif commented on June 2, 2024

Good news everyone, we have an official React Native SDK coming soon. If you'd like to request access to the limited beta, email [email protected] and include your github user name

from giphy-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.