Open fk1blow opened 7 years ago
@fk1blow Both share and app should have the script. Also make sure to register you share component in JS as well. This described here
Both extension and host app are registered(and already where when i submitted this issue) and after your comment, i added the script to the host. Again, it does the same - it opens the host app instead of the extension.
Running this again on the simulator, after require-ing both share and host app(inside the index.ios.js), it starts to behave exactly like the physical device, opening the host app instead.
@fk1blow, One other thing, make sure the name of the component that you registered are currectly spelled in Objective-c code side of Share Extension. Double check the moduleName:@"MyShareEx"
and replace MyShareEx
with the one that you register inside index.ios.js
- (UIView*) shareView {
NSURL *jsCodeLocation;
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"MyShareEx"
initialProperties:nil
launchOptions:nil];
rootView.backgroundColor = nil;
return rootView;
}
if that one doesn't work then you have to make a sample project and send it to me so I can debug it for you.
both are the same, unfortunately! I will try to do it natively, because i'm running out of time!
Thanks!
Can you provide me a sample project? If you do I might be able to help you and get you going.
I've got everything working on the simulator, but when trying to test it on a physical device(with no dev server whatsoever), instead of opening the share extension, it opens up the host application.
Before this, it didn't opened anything and then i remembered to add the https://github.com/alinz/react-native-share-extension#test-on-device-without-dev-server. Should this script be added to both host app and extension or just the extension?
currenty package.json:
Thanks in advance!