Code Monkey home page Code Monkey logo

Comments (11)

ankits47b avatar ankits47b commented on July 27, 2024 3

In Android there is a method onSketchSaved that help you to get path
onSketchSaved={(success, filePath) => { console.log('onSketchSaved', 'filePath: ' + filePath); }}

from react-native-sketch-canvas.

ankits47b avatar ankits47b commented on July 27, 2024

++

from react-native-sketch-canvas.

terrylinla avatar terrylinla commented on July 27, 2024

You can get the image path after saving now~

from react-native-sketch-canvas.

dawidvdh avatar dawidvdh commented on July 27, 2024

@terrylinla how does one go about getting the URI after saving?

from react-native-sketch-canvas.

dawidvdh avatar dawidvdh commented on July 27, 2024

Awesome got it thanks @ankits47b

from react-native-sketch-canvas.

karlsecco avatar karlsecco commented on July 27, 2024

File path seems to be consistently undefined using onSketchSaved on iOS and Android emulators, even using the exact component example in the docs, only adding:

onSketchSaved={(success, path) => console.log(success, path)}

This method does run and I can get success to log as false but even when success is true, path is always undefined. How do I get actually get the saved image without using another library to capture the View?

Thanks.

from react-native-sketch-canvas.

palashkaria avatar palashkaria commented on July 27, 2024

@karlsecco you might want to see if this is related to the android 10 permissions issue; there the success value was false though. Did you change the permissions to get true? #142 (comment)

from react-native-sketch-canvas.

karlsecco avatar karlsecco commented on July 27, 2024

@palashkaria Thanks for the reply. Yes I am able to get success === true on both iOS and Android yet even then the path === undefined every time. I've seen implementations to handle null returns when a folder and filename are not indicated on save, therefore conditionally fetching from camera roll on iOS, but path for me is never null, just undefined. I don't know how to get a return value for path.

from react-native-sketch-canvas.

kunalword avatar kunalword commented on July 27, 2024

Always null on save in android :
onSketchSaved={(success, uri) => {
uri = "file:///" + uri;
console.log(success ? 'Image saved!' : 'Failed to save image!', uri);
}

//
'Failed to save image!', 'file:///null'

from react-native-sketch-canvas.

karlsecco avatar karlsecco commented on July 27, 2024

@kunalword your file path is null because your save failed

from react-native-sketch-canvas.

alephpt avatar alephpt commented on July 27, 2024

no luck on this either? 👎

from react-native-sketch-canvas.

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.