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

Stickers from URL #13

Open
kesepara opened this issue Dec 11, 2018 · 19 comments
Open

Stickers from URL #13

kesepara opened this issue Dec 11, 2018 · 19 comments

Comments

@kesepara
Copy link

Is it possible to add sticker packs to whatsapp from images which has fetched by url?

If not, is there any solution for this problem ? Maybe saving the image file first etc. ?

@Jobeso
Copy link
Owner

Jobeso commented Dec 11, 2018

Hey @kesepara,
this is currently not possible and not supported natively by WhatsApp. There are solutions to do that but I am currently not working on it. This is definitely something the library should support in the future. If there is someone willing to support on this, I'm glad for help.

@kesepara
Copy link
Author

kesepara commented Dec 11, 2018

Oh i see @Jobeso . I am working on a project right now that should contains this feature too. So i need to do this on my own. I will let you know when i did that. Do you have any ideas for me to do that quickly? Or any other plugins to work with to upload stickers from URL. For example i think that i need to use react-native-fs first to save the files first. Or do i need to save the files first?

Any suggestions would be really appreciated.

@Jobeso
Copy link
Owner

Jobeso commented Dec 13, 2018

Yeah I try to give you some hints. First of all, is your project cross platform or only for one os?

@kesepara
Copy link
Author

Yeah I try to give you some hints. First of all, is your project cross platform or only for one os?

Cross platform. I've created my project with "react-native init" command.

@Jobeso
Copy link
Owner

Jobeso commented Dec 13, 2018

So for iOS an approach could be to save them as a local image with rn-fs (like you mentioned) or to base64, convert them to imageData and add support of imageData to this library like discussed in #11. So there is a function addSticker in the native code in StickerPack.swift with imageData type as a parameter. This method is currently not exposed but could be an approach for you.
For Android it's not that easy and I don't know an approach currently but I can tell you about the problem. On Android the library uses a ContentProvider. This needs to be available even if the app is not in the foreground. A ContentProvider behaves similar to a static method so you can't use the dynamic approach. At least this is what I figured out when developing this library.

@kesepara
Copy link
Author

So for iOS an approach could be to save them as a local image with rn-fs (like you mentioned) or to base64, convert them to imageData and add support of imageData to this library like discussed in #11. So there is a function addSticker in the native code in StickerPack.swift with imageData type as a parameter. This method is currently not exposed but could be an approach for you.
For Android it's not that easy and I don't know an approach currently but I can tell you about the problem. On Android the library uses a ContentProvider. This needs to be available even if the app is not in the foreground. A ContentProvider behaves similar to a static method so you can't use the dynamic approach. At least this is what I figured out when developing this library.

Thank you for hints. I'll let you know if i can make any progress.

@PasinduDineth
Copy link

waiting for this feature. Thanks for the library. working fine!!

@srameshr
Copy link

Was this added to the plugin?

@Jobeso
Copy link
Owner

Jobeso commented Feb 20, 2019

@srameshr No I didn't implement it yet. I am actually thankful for help on that because I don't know a solution how to solve this on Android.
Do you have plans working on this?

@srameshr
Copy link

@Jobeso Oh, sorry. I have no idea about it. Does it work on iOS though?

@Jobeso
Copy link
Owner

Jobeso commented Feb 20, 2019

@srameshr No the functionality is also not supported by default by this library for iOS but I posted a way how to achieve this above. This is only theoretically because the official library from WhatApp doesn't support this behaviour. The above mentioned would be a way I assume it to work on iOS.

@jowo-io
Copy link

jowo-io commented Jun 7, 2019

@Jobeso thanks for taking the time to outline how this could be done on iOS.
The description was useful to me. (as is this entire repo, really awesome!)

I'm just wondering if anything has changed with what you said about Android?

... On Android the library uses a ContentProvider. This needs to be available even if the app is not in the foreground. A ContentProvider behaves similar to a static method so you can't use the dynamic approach. At least this is what I figured out when developing this library.

Any further info here would be greatly appreciated!

Cheers,
Jo

@Jobeso
Copy link
Owner

Jobeso commented Jun 7, 2019

Hey @pureth,
glad to hear that this library helps you :)
I browsed the WhatsApp sticker repo issues lately and found some hints how people implemented this behaviour on the native side but I didn't find the time to dig deeper into it yet.

@vasconcelosvcd
Copy link

vasconcelosvcd commented Jun 11, 2019

@Jobeso is there any repo that I can see where did you stop so I can try to help you ?

stickers-internet

I've found this repo, I'll get deeper into it.

@Jobeso
Copy link
Owner

Jobeso commented Jun 12, 2019

Hey @vasconcelosvcd,
great to hear that you want to help out, appreciate it. I think the repo you posted is a good lead. They also added some info to their readme about that here.
When I remember correctly my main problem was that the content provider or the content file parser acts statically and I couldn't figure out how to dynamically add stickers through the functions without having them available on app start.

@ursnj
Copy link

ursnj commented Dec 22, 2019

Any update on this ???

@malithjkmt
Copy link

malithjkmt commented Mar 21, 2020

Has anyone got a PR for this? :)
@Jobeso any updates?

@Pcpkomputer
Copy link

up up

@KishorJena
Copy link

KishorJena commented Nov 14, 2021

I found a guide on medium But I could not use it as I just resumed learning android after 3 years
Part 1
Part 2

I hope this will help someone who is looking for it

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

10 participants