GoldenOwlAsia / react-native-twitter-signin

MIT License
167 stars 303 forks source link

iOS - Package using UiWebView #158

Open federicoEllena opened 4 years ago

federicoEllena commented 4 years ago

My app is currently running on rn 0.62, and i'm using the latest version of this library. I've been getting this warning recently when submitting it to the appstore:

ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs . See https://developer.apple.com/documentation/uikit/uiwebview for more information.

I tracked down where this object is currently used, by doing a simple grep over my node_modules, and got this:

node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:@interface RCTWebView () <UIWebViewDelegate, RCTAutoInsetsProtocol> node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m: UIWebView _webView; node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m: _webView = [[UIWebView alloc] initWithFrame:self.bounds]; node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:#pragma mark - UIWebViewDelegate methods node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:- (BOOL)webView:(__unused UIWebView )webView shouldStartLoadWithRequest:(NSURLRequest )request node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m: navigationType:(UIWebViewNavigationType)navigationType node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m: @(UIWebViewNavigationTypeLinkClicked): @"click", node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m: @(UIWebViewNavigationTypeFormSubmitted): @"formsubmit", node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m: @(UIWebViewNavigationTypeBackForward): @"backforward", node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m: @(UIWebViewNavigationTypeReload): @"reload", node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m: @(UIWebViewNavigationTypeFormResubmitted): @"formresubmit", node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m: @(UIWebViewNavigationTypeOther): @"other", node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:- (void)webView:(__unused UIWebView )webView didFailLoadWithError:(NSError )error node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m: // Error code 102 "Frame load interrupted" is raised by the UIWebView if node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:- (void)webViewDidFinishLoad:(UIWebView )webView node_modules/react-native-twitter-signin/ios/dependencies/TwitterKit.framework/Headers/TWTRTweet.h: * Suitable for loading in a UIWebView, WKWebView or passing to Safari: Binary file node_modules/react-native-twitter-signin/ios/dependencies/TwitterKit.framework/TwitterKit matches

So,it seems like this soon-to-be-deprecated object is being used in multiple files.

Any ideas on how to solve this, anyone facing the same issue around here?. Am I missing something? :octocat: Any help or hints are most welcome! :smile:

yash-atreya commented 4 years ago

Yes, I got faced the same problem a few days ago. First: rm -rf node_modules/react-native-twitter-signin/ios/dependencies Second: Go to node_modules/react-native-twitter-signin/ios/react-native-twitter-signin.podspec

And edit pod 'TwitterKit', '~> 3.3.0 to pod 'TwitterKit5'

Run pod update and this should solve your issue

Simlar issue: #151

mrKorg commented 4 years ago

I have the same issue, but edit pod 'TwitterKit', '~> 3.3.0 to pod 'TwitterKit5' don't help me. I have The 'Pods-sdc' target has frameworks with conflicting names: twitterkit.framework. now

yash-atreya commented 4 years ago

Try pod deintegrate remove pod TwitterKit5 from your podfile

Clean Xcode and pod install

srinivasanBG commented 3 years ago

The above is solved ?

Please give me some solution .

sordev commented 3 years ago

Yes, I got faced the same problem a few days ago. First: rm -rf node_modules/react-native-twitter-signin/ios/dependencies Second: Go to node_modules/react-native-twitter-signin/ios/react-native-twitter-signin.podspec

And edit pod 'TwitterKit', '~> 3.3.0 to pod 'TwitterKit5'

Run pod update and this should solve your issue

Simlar issue: #151

This fixed my issue, Thank you :)

SriSamVictor commented 3 years ago

Actually it was not in ios/react-native-twitter-signin.podspec. It was directly in the path of node_modules/react-native-twitter-signin/react-native-twitter-signin.podspec

Go to this path: => node_modules/react-native-twitter-signin/react-native-twitter-signin.podspec

s.dependency "TwitterKit", "~> 3.3"

Change to this

s.dependency "TwitterKit5"

go to terminal : cd ios/pod install

You will see twitterkit will be upgrade 3.3 something to 5.2.0. This is build will upload to testflight it will working for me

Amacelia commented 2 years ago

I fixed this apple rejection issue by removing 4 files from react-native-twitter-signin in node_modules.

//Sample output of grep -r UIWebView node_modules/*
// node_modules/react-native-fbsdk/src/FBShareDialog.js:   * Displays the dialog in a UIWebView within the app.
// node_modules/react-native-gesture-handler/node_modules/fbjs/lib/UserAgent.js.flow:   * - UIWebView
// node_modules/react-native-gesture-handler/node_modules/fbjs/lib/UserAgent.js:   * - UIWebView
// node_modules/react-native-reanimated/node_modules/fbjs/lib/UserAgent.js.flow:   * - UIWebView
// node_modules/react-native-reanimated/node_modules/fbjs/lib/UserAgent.js:   * - UIWebView
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:@interface RCTWebView () <UIWebViewDelegate, RCTAutoInsetsProtocol>
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:  UIWebView *_webView;
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:    _webView = [[UIWebView alloc] initWithFrame:self.bounds];
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:#pragma mark - UIWebViewDelegate methods
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:- (BOOL)webView:(__unused UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m: navigationType:(UIWebViewNavigationType)navigationType
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:      @(UIWebViewNavigationTypeLinkClicked): @"click",
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:      @(UIWebViewNavigationTypeFormSubmitted): @"formsubmit",
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:      @(UIWebViewNavigationTypeBackForward): @"backforward",
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:      @(UIWebViewNavigationTypeReload): @"reload",
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:      @(UIWebViewNavigationTypeFormResubmitted): @"formresubmit",
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:      @(UIWebViewNavigationTypeOther): @"other",
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:- (void)webView:(__unused UIWebView *)webView didFailLoadWithError:(NSError *)error
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:      // Error code 102 "Frame load interrupted" is raised by the UIWebView if
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:- (void)webViewDidFinishLoad:(UIWebView *)webView

So I went to /<PROJ DIR>/node_modules/react-native-twitter-signin/node_modules/react-native/React/Views and ran rm RCTWebView* in the terminal which removed the following files: (RCTWebView.h, RCTWebView.m, RCTWebViewManager.h, and RCTWebViewManager.m)