Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not taking local Image path #178

Closed
ghost opened this issue Apr 17, 2019 · 7 comments
Closed

Not taking local Image path #178

ghost opened this issue Apr 17, 2019 · 7 comments

Comments

@ghost
Copy link

ghost commented Apr 17, 2019

if i am giving local image path the image is not loading, but if load image from network it is working fine

react-native: 0.50.4

rect-native-razorpay: 2.0.20

@pronav
Copy link
Contributor

pronav commented Apr 17, 2019

Try passing image as base64 string

@ghost
Copy link
Author

ghost commented Apr 17, 2019

do i need to convert the image to base64 and pass on ?

@ghost
Copy link
Author

ghost commented Apr 17, 2019

i tried convert the .png to base64 and passed to it but still its not working

@pronav
Copy link
Contributor

pronav commented Apr 17, 2019

You can also pass local image as UIImage instance. If passing string, it should either be in base64 format or a url from internet.

@ghost
Copy link
Author

ghost commented Apr 17, 2019

base64 is working but UIImage instance is not working if give local path to it.

let options = {
      description: 'Credits towards consultation',
      UIImage: 'app/images/logo.png',
      currency: 'INR',
      key: 'rzp_test_5nvpgJkz0ruqSJ',
      amount: '5000',
      name: 'name',
      prefill: {
        email: email,
        contact: mobile,
        name: name
      },
      theme: { color: '#F37254' }
    };

@pronav
Copy link
Contributor

pronav commented Apr 17, 2019

By UIImage instance, I mean passing reference to image under the same key, i.e. image. something like this:

image: UIImage.init(contentsOfFile: imagePath)
...other options as before

@pronav pronav closed this as completed Apr 17, 2019
@SanjaySargam
Copy link

@pronav
getting this error
UIImage not recognised

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

No branches or pull requests

2 participants