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

Transparent Modal #188

Closed
Epiczzor opened this issue Nov 12, 2019 · 2 comments
Closed

Transparent Modal #188

Epiczzor opened this issue Nov 12, 2019 · 2 comments

Comments

@Epiczzor
Copy link

Hey, I'm trying to set this up on 0.61, everything works fine but my share page does not load my react native code, it shows me a transparent page that slides up and I am able to close it, I am using separated bundles configuration. The name of my JS file that has the view code is ShareModule, the AppRegistry is set up on that page

This is my ShareSong.m ( MyShareEx.m)

//
//  ShareSong.m
//  ShareSong
//
//  Created by Sahil Singh on 03/11/19.
//  Copyright © 2019 Facebook. All rights reserved.
//

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

@interface ShareSong : ReactNativeShareExtension
@end

@implementation ShareSong

RCT_EXPORT_MODULE();

- (UIView*) shareView {
  NSURL *jsCodeLocation;


  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"ShareModule" fallbackResource:nil];
  
  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"ShareSong"
                                               initialProperties:nil
                                                   launchOptions:nil];

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

  return rootView;
}

@end

also I get this warning
IMG_6950

@Epiczzor
Copy link
Author

Epiczzor commented Nov 13, 2019

Update: It doesn't work in the simulator as well

Also i had trouble doing this part of the guide - App and app extension bundles

I got an error when i added lines in app target's "Bundle React Native code and images" phase

export NODE_BINARY=node
../bin/react-native-xcode.sh

In the share extension "Bundle React Native code and images" did not exist

Followed the steps on this issue: #182

@Epiczzor
Copy link
Author

Hey guys, turns out my issue was with Firebase, i didnt know how to check logs before but i realised i had to select share song as target instead of my app and then build. after further investigation of the log i realised that FIrebase was crashing the extension because it wasnt initialized. so i added the Initialization code and google services plist inside the Extension folder, and it worked !

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

1 participant