jobeso / react-native-story-share Goto Github PK
View Code? Open in Web Editor NEWShare your images to instagram and snapchat stories with react native.
Share your images to instagram and snapchat stories with react native.
When i tried version 0.2.0 its work for me only in Android,
in ios i got :
info "_swift_unknownObjectRelease", referenced from:
info RNStoryShare.RNStoryShare.share(_: __C.NSDictionary, resolver: (Any?) -> (), rejecter: (Swift.String?, Swift.String?, Swift.Error?) -> ()) -> () in libRNStoryShare.a(RNStoryShare-5898797e35bc08a442bbd70b6ac41c79923a55e5e3af2d3e4ed70530ae898915.o)
info reabstraction thunk helper from @callee_unowned @convention(block) (@unowned Swift.AnyObject?) -> () to @escaping @callee_guaranteed (@in_guaranteed Any?) -> () in libRNStoryShare.a(RNStoryShare-5898797e35bc08a442bbd70b6ac41c79923a55e5e3af2d3e4ed70530ae898915.o)
info "_swift_updateClassMetadata2", referenced from:
info type metadata completion function for RNStoryShare.RNStoryShare in libRNStoryShare.a(RNStoryShare-5898797e35bc08a442bbd70b6ac41c79923a55e5e3af2d3e4ed70530ae898915.o)
info "_swift_willThrow", referenced from:
info RNStoryShare.RNStoryShare.share(_: __C.NSDictionary, resolver: (Any?) -> (), rejecter: (Swift.String?, Swift.String?, Swift.Error?) -> ()) -> () in libRNStoryShare.a(RNStoryShare-5898797e35bc08a442bbd70b6ac41c79923a55e5e3af2d3e4ed70530ae898915.o)
info RNStoryShare.RNStoryShare.shareToInstagram(_: __C.NSData, stickerData: __C.NSData?, attributionLink: Swift.String, resolve: (Any?) -> (), reject: (Swift.String?, Swift.String?, Swift.Error?) -> ()) -> () in libRNStoryShare.a(RNStoryShare-5898797e35bc08a442bbd70b6ac41c79923a55e5e3af2d3e4ed70530ae898915.o)
info ld: symbol(s) not found for architecture x86_64
info clang: error: linker command failed with exit code 1 (use -v to see invocation)
info
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening hangmeout.xcworkspace
** BUILD FAILED **
The following build commands failed:
Ld /Users/idanlevi/Documents/idan/hangmeout/ios/build/hangmeout/Build/Products/Debug-iphonesimulator/hangmeout.app/hangmeout normal x86_64
(1 failure)
. Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
I also try the latest version 0.4.0, but it's not working...
maybe i didn't installation well,
i work with react native 59.8 and cocoapods
i try to add # pod 'RNStoryShare', :path => '../node_modules/react-native-story-share/ios'
to Podfile
, it looks like install RNStoryShare...
I'm also linking in xcode
*i work with yarn
maybe i miss something with snapchat
I don't understand why i need it if i want work only with Instagram
? and how i . get snapchat SDK ?
someone can explain to me what the installation steps more slowly?
And when I run the function without putting a condition of isAvailable,
Possible Unhandled Promise Rejection (id: 4):
Error: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
Hey @Jobeso everything works fine, great work!
Was curious if you have any plans of integrating video support in this package.
Also, minor issue in the README, in my android App if I set stickerAsset: ''
it crashes Instagram, it worked with stickerAsset: null
.
Thanks, hope to hear from you!
I've followed the readme instructions and have share to instagram working correctly on ios.
When I followed the instructions for snap, the following executes all console.logs with RNStoryShare.isSnapchatAvailable() returning true, but it doesn't open snapchat.
Any pointers?
const openSnap = async () => {
console.log("Open snap pressed");
const isAvailable = await RNStoryShare.isSnapchatAvailable()
console.log('are you being called');
if (isAvailable) {
console.log("Hi", isAvailable);
RNStoryShare.shareToSnapchat({
type: RNStoryShare.BASE64, // or RNStoryShare.FILE
attributionLink: 'https://myproject.com',
backgroundAsset: base64Background,
stickerAsset: base64StickerAsset,
captionText: 'text exemple',
media: "photo", // or "video"
stickerOptions: {
height: 900,
width: 900
}
});
console.log("Hi2");
}
};
Expo diagnostics info:
Expo CLI 3.27.14 environment info:
System:
OS: macOS 10.15.7
Shell: 3.1.0 - /usr/local/bin/fish
Binaries:
Node: 12.16.3 - /usr/local/bin/node
Yarn: 1.22.0 - ~/.yarn/bin/yarn
npm: 6.14.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
IDEs:
Xcode: 12.0.1/12A7300 - /usr/bin/xcodebuild
npmPackages:
expo: ~39.0.2 => 39.0.3
react: 16.13.1 => 16.13.1
react-dom: 16.13.1 => 16.13.1
react-native: ~0.63.3 => 0.63.3
react-native-web: ~0.13.12 => 0.13.17
Expo Workflow: bare
Other info:
<application ...>
...
...
I just want to use Share to Instagram. is this still step required ?
looking at the implementation of module, I'm seeing that it doesn't support video by itself and that the user has to add it themselves, along with caption functionality. Adding these to the project would be a helpful inclusion, especially as the js says it supports video.
Hello!
I wanted to try the example project you have included in this repository to see how the library works, but that app seems to not do anything. I just ran yarn
and then react-native run-android
, and it runs successfully, but when clicking the "share to instagram" button, I get an error:
Am I missing something or is this a bug?
The first time (fresh install) I try to share to Instagram or Snap, it fails with the following error.
{ [Error: The file “Staats” couldn’t be opened because you don’t have permission to view it.]
framesToPop: 1,
code: 'RNStoryShare',
domain: 'NSCocoaErrorDomain',
userInfo:
{ NSUnderlyingError:
{ code: '13',
message: 'underlying error',
domain: 'NSPOSIXErrorDomain',
userInfo: {},
nativeStackIOS:
[ '0 staats 0x000000010412952c RCTJSErrorFromCodeMessageAndNSError + 156',
'1 staats 0x0000000104129850 RCTJSErrorFromCodeMessageAndNSError + 960',
'2 staats 0x00000001040d04d4 __41-[RCTModuleMethod processMethodSignature]_block_invoke_2.129 + 176',
'3 staats 0x00000001042d3ca8 $sSo8NSStringCSgACSo7NSErrorCSgIyByyy_SSSgAGs5Error_pSgIegggg_TR + 368',
'4 staats 0x00000001042d6c58 $s12RNStoryShareAAC16shareToInstagram_8resolver8rejecterySo12NSDictionaryC_yypSgXEySSSg_AIs5Error_pSgtXEtF + 7404',
'5 staats 0x00000001042d731c $s12RNStoryShareAAC16shareToInstagram_8resolver8rejecterySo12NSDictionaryC_yypSgXEySSSg_AIs5Error_pSgtXEtFTo + 180',
'6 CoreFoundation 0x000000019360c724 97285ACB-7B21-393A-ABF6-03F1DBB5D2A2 + 1283876',
'7 CoreFoundation 0x00000001934d5280 97285ACB-7B21-393A-ABF6-03F1DBB5D2A2 + 8832',
'8 CoreFoundation 0x00000001934d5e90 97285ACB-7B21-393A-ABF6-03F1DBB5D2A2 + 11920',
'9 staats 0x00000001040d1c38 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 1896',
'10 staats 0x000000010415ce8c _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 660',
'11 staats 0x000000010415ca00 _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 144',
'12 staats 0x000000010415c964 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28',
'13 libdispatch.dylib 0x0000000108181e48 _dispatch_call_block_and_release + 32',
'14 libdispatch.dylib 0x00000001081832a8 _dispatch_client_callout + 20',
'15 libdispatch.dylib 0x000000010819135c _dispatch_main_queue_callback_4CF + 1376',
'16 CoreFoundation 0x0000000193580e20 97285ACB-7B21-393A-ABF6-03F1DBB5D2A2 + 712224',
'17 CoreFoundation 0x000000019357bb7c 97285ACB-7B21-393A-ABF6-03F1DBB5D2A2 + 691068',
'18 CoreFoundation 0x000000019357b098 CFRunLoopRunSpecific + 480',
'19 GraphicsServices 0x000000019d6e5534 GSEventRunModal + 108',
'20 UIKitCore 0x000000019769b7ac UIApplicationMain + 1940',
'21 staats 0x000000010286dd78 main + 124',
'22 libdyld.dylib 0x00000001933faf30 0DC9A4BA-C3E8-3487-99DB-1B5C86597AF5 + 3888' ] },
NSFilePath: '/private/var/containers/Bundle/Application/9B05C12A-D9CC-45AC-B510-72131D5D914F/staats.app' },
nativeStackIOS:
[ '0 staats 0x000000010412952c RCTJSErrorFromCodeMessageAndNSError + 156',
'1 staats 0x00000001040d04d4 __41-[RCTModuleMethod processMethodSignature]_block_invoke_2.129 + 176',
'2 staats 0x00000001042d3ca8 $sSo8NSStringCSgACSo7NSErrorCSgIyByyy_SSSgAGs5Error_pSgIegggg_TR + 368',
'3 staats 0x00000001042d6c58 $s12RNStoryShareAAC16shareToInstagram_8resolver8rejecterySo12NSDictionaryC_yypSgXEySSSg_AIs5Error_pSgtXEtF + 7404',
'4 staats 0x00000001042d731c $s12RNStoryShareAAC16shareToInstagram_8resolver8rejecterySo12NSDictionaryC_yypSgXEySSSg_AIs5Error_pSgtXEtFTo + 180',
'5 CoreFoundation 0x000000019360c724 97285ACB-7B21-393A-ABF6-03F1DBB5D2A2 + 1283876',
'6 CoreFoundation 0x00000001934d5280 97285ACB-7B21-393A-ABF6-03F1DBB5D2A2 + 8832',
'7 CoreFoundation 0x00000001934d5e90 97285ACB-7B21-393A-ABF6-03F1DBB5D2A2 + 11920',
'8 staats 0x00000001040d1c38 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 1896',
'9 staats 0x000000010415ce8c _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 660',
'10 staats 0x000000010415ca00 _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 144',
'11 staats 0x000000010415c964 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28',
'12 libdispatch.dylib 0x0000000108181e48 _dispatch_call_block_and_release + 32',
'13 libdispatch.dylib 0x00000001081832a8 _dispatch_client_callout + 20',
'14 libdispatch.dylib 0x000000010819135c _dispatch_main_queue_callback_4CF + 1376',
'15 CoreFoundation 0x0000000193580e20 97285ACB-7B21-393A-ABF6-03F1DBB5D2A2 + 712224',
'16 CoreFoundation 0x000000019357bb7c 97285ACB-7B21-393A-ABF6-03F1DBB5D2A2 + 691068',
'17 CoreFoundation 0x000000019357b098 CFRunLoopRunSpecific + 480',
'18 GraphicsServices 0x000000019d6e5534 GSEventRunModal + 108',
'19 UIKitCore 0x000000019769b7ac UIApplicationMain + 1940',
'20 staats 0x000000010286dd78 main + 124',
'21 libdyld.dylib 0x00000001933faf30 0DC9A4BA-C3E8-3487-99DB-1B5C86597AF5 + 3888' ],
line: 1753,
column: 26,
sourceURL: 'http://192.168.2.90:8081/index.bundle?platform=ios&dev=true&minify=false' }
The build fails with the following error :
'UIImagePNGRepresentation' has been replaced by instance method 'UIImage.pngData()'
coming from the following lines :
I'm wondering if adding TypeScript support is possible
Hello :)
From RNStoryShareModule.java
:
private String generateFileName(){
Random r = new Random();
int hash = r.nextInt(999999);
return "image-" + hash + ".png";
}
It seems, we only generate .png
files even if we are trying to share a base64 .jpg file.
It results in a black screen on instagram story.
react-native-story-share: v0.6.0
I could do the manual linking, but looks like a downgrade IMO, theres any alternative?
I need to use this library because the old one of react-native-instagram-story-share is depracated, but i don't want to install the snapchat SDK in the project. The minimum API os snapchat SDK is 16, and my project uses the 19, because of this the build brokes.
Theres a way to solve this?
I used RNStoryShare.isInstagramAvailable() well for a while(a year)
but few days ago, RNStoryShare.isInstagramAvailable() not working suddenly.
It always returns 'false' on IOS.(android work fine)
How can I solve it??? anyone knows?
I use,
"react-native": "^0.59.10",
"react-native-story-share": "^0.2.0",
IOS 13
After I install the library and open the app it gets stuck at the splash screen. Any ideas?
dyld: Library not loaded: @rpath/PINCache.framework/PINCache Referenced from: /Users/virtumonde/Library/Developer/CoreSimulator/Devices/73CE3322-1BC4-4F6B-AB74-3855579E99B7/data/Containers/Bundle/Application/75E4666F-CF94-4426-BE66-9A6BE05DE9BF/Basic.app/Frameworks/SCSDKBitmojiKit.framework/SCSDKBitmojiKit Reason: image not found (lldb)
iOS Build Error: dyld: Library not loaded: @rpath/PINCache.framework/PINCache
Always Embed Swift Standard Libraries: Yes
RN: 0.60.0
dyld: Library not loaded: @rpath/PINCache.framework/PINCache
Referenced from: .../CoreSimulator/Devices/A40B2B91-4ADC-4F66-A635-1D41BF74DB3C/data/Containers/Bundle/Application/1E385D71-8295-4922-9145-C88463C0B699/adventure.app/Frameworks/SCSDKBitmojiKit.framework/SCSDKBitmojiKit
Reason: image not found
Need to add support the new feature.
This is due to a Facebook App ID requirement recently enforced by Instagram on January 30, 2023.
You can find their blog post at https://developers.facebook.com/blog/post/2022/10/10/introducing-important-update-to-Instagram-sharing-to-stories/, as well as their developer documentation: https://developers.facebook.com/docs/instagram/sharing-to-stories/.
To fix this issue, you would need to register your app on the Facebook developer console at https://developers.facebook.com/, obtain a Facebook app ID and pass it as the source_application param in your integrations.
What would be the best way to validate if the user is really posted story or not ? Thanks.
I just want to use this with Instagram only but it seems this package requires to have SnapChat SDK installed the . Is this correct?
Hi,
I don't use cacaoPod.
So I download SCSDKCreativeKit v1.3.1 from https://raw.githubusercontent.com/Snapchat/snap-kit-carthage/repo/SCSDKCreativeKit.json.
I add the framework to XCODE and the path in Frameworks Searchs Paths
I add the Header in Header Searchs Paths
Always Embed Swift Started Libraries
is true
and in library search paths
$(inherited)
$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
I still have this error :
No such module 'SCSDKCreativeKit'
Any idea ?
At some point RN changed where podspecs are suppose to go, recently I think.
Currently the auto linking process expects it in the root directory whereas this project has it in the ios
folder. Changing the path to
pod 'RNStoryShare', :path => '../node_modules/react-native-story-share/ios'
Fixes it but ideally it would be better to move it right?
I followed the instructions but after doing import RNStoryShare from 'react-native-story-share'
if I do console.log(RNStoryShare)
I see null
. Any idea? thanks
Can't seem to get it to work! Anyone else?
I think attributionLink
does not work propertly.
I'm trying to do something like happens on spotify:
Code to reproduce:
RNStoryShare.isInstagramAvailable()
.then(async isAvailable => {
if (isAvailable) {
await RNStoryShare.shareToInstagram({
type: RNStoryShare.BASE64,
attributionLink: 'https://www.mysite.com',
backgroundAsset: imageBase64,
backgroundBottomColor: '#ff2a00',
backgroundTopColor: '#33FF33'
});
}
})
.catch(e => console.log(e));
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.