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 working with React Native 0.60.5 #180

Closed
ketanvault opened this issue Sep 12, 2019 · 20 comments
Closed

Not working with React Native 0.60.5 #180

ketanvault opened this issue Sep 12, 2019 · 20 comments

Comments

@ketanvault
Copy link

Not working with React Native 0.60.5. Followed each & every step as there in the docs. Please help me to resolve this.

@jeffelector
Copy link

same case in here

@ketanvault
Copy link
Author

@alinz Please try to reply ASAP. I have to resolve this as it is required urgently.

@kumbhar-ketan
Copy link

Hey @alinz, I have the same problem. Please try to fix this ASAP.

@kumbhar-ketan
Copy link

kumbhar-ketan commented Sep 16, 2019

Hey @alinz, are you going to reply this ? I'm stuck at a point or else please suggest me another package.

@jeffelector
Copy link

Hey @alinz, are you going to reply this ? I'm stuck at a point or else please suggest me another package.

https://github.com/ajith-ab/react-native-file-share-intent
try this one.

@kumbhar-ketan
Copy link

@jeffelector is it doing all the sharing operations like sharing links, text, photos & videos ?

@jeffelector
Copy link

Adds the application to the share intent of the device, so it can be launched from other apps and receive data from them

this is from the documentation ..for me it work just fine i manage to pass string ,but for photo i am not sure.. i know it can be pass as uri to the photo and then you can make something with it .

@kumbhar-ketan
Copy link

@jeffelector Thanks for the information.

@tarang8811
Copy link

tarang8811 commented Oct 17, 2019

Hello any updates on this? My share extension is not working after upgrading to 0.60.5. It runs fine on android but does not work in iOS

@AkshayP8140
Copy link

Hello any updates on this? My share extension is not working after upgrading to 0.60.5. It runs fine on android but does not work in iOS

I also get this issue it not working in 0.60.5^ for iOS
I got this error --> 'React/RCTBridge.h' file not found

@kumbhar-ketan
Copy link

kumbhar-ketan commented Oct 22, 2019

Hey @tarang8811 & @AkshayP8140 Please add the libraries which are specified in documentation using add libraries to your Share Extension project. This library is not a pod specific. So have to add/link the libraries. Please read the document clearly about how to add libraries.
I have done it in my project which is on React 0.60.5.

@AkshayP8140
Copy link

@kumbhar-ketan
I make my project with this step
#182 (comment)

so,
After perform all that step I can run the project or extension but I not get my main page when I click on the extension

@kumbhar-ketan
Copy link

@AkshayP8140 Can you post your maindelegate file which you are using in share extension. Also post a share component which you are using to display UI on clicking of the share extension.

@AkshayP8140
Copy link

AkshayP8140 commented Oct 22, 2019

@AkshayP8140 Can you post your maindelegate file which you are using in share extension. Also post a share component which you are using to display UI on clicking of the share extension.

MyShareEx.m

#import <Foundation/Foundation.h>
#import "ReactNativeShareExtension.h"
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <React/RCTLog.h>

@interface MyShareEx : ReactNativeShareExtension
@end

@implementation MyShareEx

RCT_EXPORT_MODULE();

- (UIView*) shareView {
  NSURL *jsCodeLocation;

  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];

  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"MyShareEx"
                                               initialProperties:nil
                                                   launchOptions:nil];
  rootView.backgroundColor = nil;

  // Uncomment for console output in Xcode console for release mode on device:
  // RCTSetLogThreshold(RCTLogLevelInfo - 1);

  return rootView;
}

@end

index.js

import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
import Share_file from './Components/Share';

AppRegistry.registerComponent(appName, () => App);
AppRegistry.registerComponent('MyShareEx', () => Share_file);

@kumbhar-ketan
Copy link

@AkshayP8140 this is wrong. You can't open same intent twice. You must change the default entry file of your share extension to other file.
Like
In MyShareX.m file replace index by your js filename. In your case it is './Components/Share'

@AkshayP8140
Copy link

@kumbhar-ketan
like this

import {AppRegistry} from 'react-native';
import Share_file from './Components/Share';

AppRegistry.registerComponent('MyShareEx', () => Share_file);

@kumbhar-ketan
Copy link

No. You must register it in index js but you must set the entry point which you used to register it.
Ex.
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
import Share_file from './Share';

AppRegistry.registerComponent(appName, () => App);
AppRegistry.registerComponent('MyShareEx', () => Share_file);

Now change in your MyShareX.m file - @'index' => @'Share'

@AkshayP8140
Copy link

AkshayP8140 commented Oct 22, 2019

@kumbhar-ketan
I change but not working

#180 (comment) This is working in emulator but it not work in the device

I think it because of bundler issues
When I Run in Device In Xcode give this type pf console when I click on Extention

"Make sure you're running a packager server or have included a .jsbundle file in your application bundle."

@ajith-ab
Copy link

i ve used this package with all new features with react native greater than 0.60 support react-native-receive-sharing-intent

@ketanvault
Copy link
Author

@ajith-ab react-native-share-extension It works on latest react-native 0.62.2 version though. so I don't think I need what you suggest in every ticket of this package.

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

6 participants