Open EvanBacon opened 4 years ago
Could this also be used to implement the code for sharing to Instagram stories using Expo SDK? In the official documentation it requires native code to use the pasteboard in iOS https://developers.facebook.com/docs/instagram/sharing-to-stories/#ios-developers
we can create whatsapp stickers using react native managed workflow ?
I work on Expo and React, I was trying to get WhatsApp stickers working using the exposed native modules provided by
react-native
and the Expo SDK. This is in contrast to using specific native code dedicated to WhatsApp.On iOS, nearly everything works except the interface with the Pasteboard.
react-native
only surfaces the bare minimum for setting a string to the clipboard here. Adding support for[UIPasteboard setItems]
would be a reasonable native change to make, but even that wouldn't be enough due to the usage ofNSJSONSerialization
which makes things much trickier.Here is the minimum required native Objective-C code for supporting stickers on iOS:
It's concise but also very WhatsApp specific. A more ideal interface would be something like this:
On the Javascript side it can be used like this:
From what I understand, it may require changes on the WhatsApp iOS side to also accept an
NSDictionary
object in addition to the usualNSData
generated byNSJSONSerialization
.If this is a reasonable change to make that would be awesome! Stickers would be really easy to create and customize using a non-native interface.
Further
I figured I'd also leave my findings here for anyone else trying to get this working in the future: