facebookarchive / react-native-fbsdk

A React Native wrapper around the Facebook SDKs for Android and iOS. Provides access to Facebook login, sharing, graph requests, app events etc.
https://developers.facebook.com/docs/react-native
Other
2.99k stars 907 forks source link

Has a problem with WebView when submit application to Apple #640

Open gus-waritthorn opened 5 years ago

gus-waritthorn commented 5 years ago

🐛 Bug Report

We got a waning when submit application to Apple when i try to fix this UiWebView problem i search "UiWebView" keyword in xcode i found that this library use UiWebView so i think this might be a problem ? image

To Reproduce

Expected Behavior

Submit to Apple's store without warning

Code Example

-

Environment

React Native Environment Info: System: OS: macOS 10.14.5 CPU: x64 Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz Memory: 79.64 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 8.11.2 - /usr/local/bin/node Yarn: 1.7.0 - /usr/local/bin/yarn npm: 6.9.0 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3 Android SDK: Build Tools: 23.0.1, 25.0.3, 26.0.2, 26.0.3, 27.0.1, 27.0.3, 28.0.1, 28.0.2, 28.0.3, 29.0.0 API Levels: 23, 24, 25, 26, 27, 28, 29 IDEs: Android Studio: 3.4 AI-183.6156.11.34.5522156 Xcode: 10.3/10G8 - /usr/bin/xcodebuild npmPackages: react: 16.5.0 => 16.5.0 react-native: 0.57.1 => 0.57.1 npmGlobalPackages: react-native-cli: 2.0.1

learnyst commented 5 years ago

Hi, We are also facing this issue. Please resolve. I think we need to update FBSdkCoreKit to 5.5

StevenMasini commented 5 years ago

Apparently UIWebView has already been removed from facebook-objc-sdk in 5.5.0.

According to the react-native-fbsdk.podspec, it is supposed to always use the latest version of FBSDKCoreKit, FBSDKLoginKit and FBSDKShareKit of 5.x.

 Pod::Spec.new do |s|
....
   s.subspec 'Core' do |ss|
     ss.dependency     'FBSDKCoreKit', '~> 5.0'
     ss.source_files = 'ios/RCTFBSDK/core/*.{h,m}'
   end

   s.subspec 'Login' do |ss|
     ss.dependency     'FBSDKLoginKit', '~> 5.0'
     ss.source_files = 'ios/RCTFBSDK/login/*.{h,m}'
   end

   s.subspec 'Share' do |ss|
     ss.dependency     'FBSDKShareKit', '~> 5.0'
     ss.source_files = 'ios/RCTFBSDK/share/*.{h,m}'
   end
 end

So the solution is to run pod update in your ios folder (This might update other dependencies).

One more thing

You can double check that no other library are referencing UIWebView in your project using the command grep -r UIWebView node_modules/*

numandev1 commented 5 years ago

@StevenMasini how can we remove uiwebview without update react-native to v60 ?

StevenMasini commented 5 years ago

@nomi9995 Well this thread is specific to react-native-fbsdk, but I can still answer you here I guess.

In the case of react-native-fbsdk you don't need to update to react native 0.60 to remove the occurence of UIWebView, you just need to udpate the native facebook sdk to a version upper to 5.5.0. Whether you use Cocoapods or manual integration.

In the case of react native itself, unfortunately there is no solution, you need to update to RN 0.60. UIWebView and other components got removed from react native core on this version.

See lean core removal and RN 0.60 changelog.

Then you will need to add react-native-webview dependency to your project, which since v7.0.1 version don't use UIWebView anymore.

evelant commented 4 years ago

I'm not entirely certain if react-native-fbsdk is the culprit or if it's another library but I'm on the latest version with FBSDK 5.8.0 and I still get the warning from Apple.

A comment in this file references using UIWebView but that may just be an outdated comment? https://github.com/facebook/react-native-fbsdk/blob/b8c48e59754633cdbaf924f9322d0f438b17640b/js/FBShareDialog.js

cgdstnc commented 4 years ago

same here. i'm using "react-native-fbsdk": "^1.1.1",

grep -r UIWebView node_modules/* resulst with following.


node_modules/fbjs/lib/UserAgent.js.flow:   * - UIWebView
node_modules/fbjs/lib/UserAgent.js:   * - UIWebView
node_modules/jsc-android/dist/include/JSContextPrivate.h:/*! @abstract The delegate the context will use when trying to load a module. Note, this delegate will be ignored for contexts re
turned by UIWebView. */
node_modules/metro/node_modules/fbjs/lib/UserAgent.js.flow:   * - UIWebView
node_modules/metro/node_modules/fbjs/lib/UserAgent.js:   * - UIWebView
node_modules/react-native/node_modules/fbjs/lib/UserAgent.js.flow:   * - UIWebView
node_modules/react-native/node_modules/fbjs/lib/UserAgent.js:   * - UIWebView
node_modules/react-native-fbsdk/js/FBShareDialog.js:   * Displays the dialog in a UIWebView within the app.
Velua commented 4 years ago

I'm in the same boat as @cgdstnc what can we do?

CptFabulouso commented 4 years ago

same here. i'm using "react-native-fbsdk": "^1.1.1",

grep -r UIWebView node_modules/* resulst with following.


node_modules/fbjs/lib/UserAgent.js.flow:   * - UIWebView
node_modules/fbjs/lib/UserAgent.js:   * - UIWebView
node_modules/jsc-android/dist/include/JSContextPrivate.h:/*! @abstract The delegate the context will use when trying to load a module. Note, this delegate will be ignored for contexts re
turned by UIWebView. */
node_modules/metro/node_modules/fbjs/lib/UserAgent.js.flow:   * - UIWebView
node_modules/metro/node_modules/fbjs/lib/UserAgent.js:   * - UIWebView
node_modules/react-native/node_modules/fbjs/lib/UserAgent.js.flow:   * - UIWebView
node_modules/react-native/node_modules/fbjs/lib/UserAgent.js:   * - UIWebView
node_modules/react-native-fbsdk/js/FBShareDialog.js:   * Displays the dialog in a UIWebView within the app.

I am having the same output, but all the UIWebView references are just in comments, that shouldn't trigger the warning, or does it?

cgdstnc commented 4 years ago

Hi, i resolved my problem but forgot to mention here. I grep my pods folder and as long as i could remember problem was in react-native-accountkit and older version of FBAudienceNetwork. I removed them send a build and problem resolved.

CptFabulouso commented 4 years ago

Thanks, grepping pods (or ios) folder helped me to find the cause, it was also issue with different library.

ManalLiaquat commented 4 years ago

same here. i'm using "react-native-fbsdk": "^1.1.1", grep -r UIWebView node_modules/* resulst with following.


node_modules/fbjs/lib/UserAgent.js.flow:   * - UIWebView
node_modules/fbjs/lib/UserAgent.js:   * - UIWebView
node_modules/jsc-android/dist/include/JSContextPrivate.h:/*! @abstract The delegate the context will use when trying to load a module. Note, this delegate will be ignored for contexts re
turned by UIWebView. */
node_modules/metro/node_modules/fbjs/lib/UserAgent.js.flow:   * - UIWebView
node_modules/metro/node_modules/fbjs/lib/UserAgent.js:   * - UIWebView
node_modules/react-native/node_modules/fbjs/lib/UserAgent.js.flow:   * - UIWebView
node_modules/react-native/node_modules/fbjs/lib/UserAgent.js:   * - UIWebView
node_modules/react-native-fbsdk/js/FBShareDialog.js:   * Displays the dialog in a UIWebView within the app.

I am having the same output, but all the UIWebView references are just in comments, that shouldn't trigger the warning, or does it?

Yeah true, but the last one that is node_modules/react-native-fbsdk/js/FBShareDialog.js: says that Displays the dialog in a UIWebView within the app which means that it uses UIWebView in the app. And under this comment there is a string name webview as shown in screenshot.

I am having the same warning from apple.

image

CptFabulouso commented 4 years ago

This alone should not trigger warning, it's just a type definition. They might have just overlooked it and forgot to delete. Try to grep your ios folder, probably some other library is causing the warning.

ManalLiaquat commented 4 years ago

@CptFabulouso I've received this email from Apple:

image

Apple will not accept any app with UiWebView after April 2020.

I grep my ios folder and I got these results:

image

ducpt2 commented 4 years ago

i have the issue the same like @cgdstnc post here. Any help please, i search UIWebview in Xcode and clear, nothing exist but still receive the warning from apple.

NewBieBR commented 4 years ago

Any update on this?

I did grep -r UIWebView ios/Pods/" and get:

Binary file ios/Pods//FBAudienceNetwork/Static/FBAudienceNetwork.framework/FBAudienceNetwork matches
danielroccha commented 4 years ago

Same issue

hwth commented 4 years ago

Same issue. Apple rejected the build after Apr 30

gg7star commented 4 years ago

maybe you need to update React Native version. Please refer this: https://react-native-community.github.io/upgrade-helper/?from=0.61.1&to=0.62.2

kostiantyn-solianyk commented 4 years ago

Same issue

hwth commented 4 years ago

maybe you need to update React Native version. Please refer this: https://react-native-community.github.io/upgrade-helper/?from=0.61.1&to=0.62.2

Thank you for you suggestion. But I solved by upgrading SDK version to 5.6. It worked for me. So I don't need to upgrade React Native version then.

hussainarthuna commented 4 years ago

maybe you need to update React Native version. Please refer this: https://react-native-community.github.io/upgrade-helper/?from=0.61.1&to=0.62.2

Thank you for you suggestion. But I solved by upgrading SDK version to 5.6. It worked for me. So I don't need to upgrade React Native version then.

Hey how did you updated the SDK? can you please help as i am getiing "react-native-fbsdk": "^1.1.2" as the latest version

hengkx commented 4 years ago

react native 0.62.2. same problem

peymancyb commented 4 years ago

same issue here, react-native-fbsdk: 2.0.0

suraneti commented 4 years ago

same here

"react-native": "0.59.10",
"react-native-fbsdk": "0.10.3"
hmoule commented 4 years ago

For me I had to remove the pod 'FBAudienceNetwork', '~> 5.1.0' which I no longer needed and that solved my issue

peymancyb commented 4 years ago

same here

aadityapaliwal94 commented 4 years ago

Even the latest version v2.0.0 has the Webview instance.

node_modules/react-native-fbsdk/lib/module/FBShareDialog.js.map:{"version":3,"sources":["FBShareDialog.js"],"names":["ShareDialog","require","NativeModules","FBShareDialog","module","exports","canShow","shareContent","show","setMode","mode","setShouldFailOnDataError","shouldFailOnDataError"],"mappings":"AAsBA,aAEA,GAAMA,CAAAA,WAAW,CAAGC,OAAO,CAAC,cAAD,CAAP,CAAwBC,aAAxB,CAAsCC,aAA1D,CAuCAC,MAAM,CAACC,OAAP,CAAiB,CAIfC,OAJe,kBAIPC,YAJO,CAIuC,CACpD,MAAOP,CAAAA,WAAW,CAACM,OAAZ,CAAoBC,YAApB,CAAP,CACD,CANc,CAWfC,IAXe,eAWVD,YAXU,CAWgC,CAC7C,MAAOP,CAAAA,WAAW,CAACQ,IAAZ,CAAiBD,YAAjB,CAAP,CACD,CAbc,CAkBfE,OAlBe,kBAkBPC,IAlBO,CAkBgB,CAC7BV,WAAW,CAACS,OAAZ,CAAoBC,IAApB,EACD,CApBc,CAyBfC,wBAzBe,mCAyBUC,qBAzBV,CAyB0C,CACvDZ,WAAW,CAACW,wBAAZ,CAAqCC,qBAArC,EACD,CA3Bc,CAAjB","sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to use,\n * copy, modify, and distribute this software in source code or binary form for use\n * in connection with the web services and APIs provided by Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use of\n * this software is subject to the Facebook Developer Principles and Policies\n * [http://developers.facebook.com/policy/]. This copyright notice shall be\n * included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *\n * @flow\n * @format\n */\n'use strict';\n\nconst ShareDialog = require('react-native').NativeModules.FBShareDialog;\nimport type {ShareContent} from './models/FBShareContent';\n\ntype ShareDialogMode = ShareDialogModeIOS | ShareDialogModeAndroid;\ntype ShareDialogModeAndroid =\n /**\n * The mode is determined automatically.\n */\n | 'automatic'\n /**\n * The native dialog is used.\n */\n | 'native'\n /**\n * The web dialog is used.\n */\n | 'web'\n /**\n * The feed dialog is used.\n */\n | 'feed';\ntype ShareDialogModeIOS =\n /*\n * Acts with the most appropriate mode that is available.\n */\n | 'automatic'\n /*\n * Displays the dialog in Safari.\n */\n | 'browser'\n /*\n * Displays the dialog in a UIWebView within the app.\n */\n | 'webview'\n /**\n * The native dialog is used.\n */\n | 'native';\n\nmodule.exports = {\n /**\n * Check if the dialog can be shown.\n */\n canShow(shareContent: ShareContent): Promise<boolean> {\n return ShareDialog.canShow(shareContent);\n },\n\n /**\n * Shows the dialog using the specified content.\n */\n show(shareContent: ShareContent): Promise<any> {\n return ShareDialog.show(shareContent);\n },\n\n /**\n * Sets the mode for the share dialog.\n */\n setMode(mode: ShareDialogMode) {\n ShareDialog.setMode(mode);\n },\n\n /**\n * Sets whether or not the native share dialog should fail when it encounters a data error.\n */\n setShouldFailOnDataError(shouldFailOnDataError: boolean) {\n ShareDialog.setShouldFailOnDataError(shouldFailOnDataError);\n },\n};\n"]} node_modules/react-native-fbsdk/lib/commonjs/FBShareDialog.js.flow: * Displays the dialog in a UIWebView within the app. node_modules/react-native-fbsdk/lib/commonjs/FBShareDialog.js.map:{"version":3,"sources":["FBShareDialog.js"],"names":["ShareDialog","require","NativeModules","FBShareDialog","module","exports","canShow","shareContent","show","setMode","mode","setShouldFailOnDataError","shouldFailOnDataError"],"mappings":"AAsBA,aAEA,GAAMA,CAAAA,WAAW,CAAGC,OAAO,CAAC,cAAD,CAAP,CAAwBC,aAAxB,CAAsCC,aAA1D,CAuCAC,MAAM,CAACC,OAAP,CAAiB,CAIfC,OAJe,kBAIPC,YAJO,CAIuC,CACpD,MAAOP,CAAAA,WAAW,CAACM,OAAZ,CAAoBC,YAApB,CAAP,CACD,CANc,CAWfC,IAXe,eAWVD,YAXU,CAWgC,CAC7C,MAAOP,CAAAA,WAAW,CAACQ,IAAZ,CAAiBD,YAAjB,CAAP,CACD,CAbc,CAkBfE,OAlBe,kBAkBPC,IAlBO,CAkBgB,CAC7BV,WAAW,CAACS,OAAZ,CAAoBC,IAApB,EACD,CApBc,CAyBfC,wBAzBe,mCAyBUC,qBAzBV,CAyB0C,CACvDZ,WAAW,CAACW,wBAAZ,CAAqCC,qBAArC,EACD,CA3Bc,CAAjB","sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * You are hereby granted a non-exclusive, worldwide, royalty-free license to use,\n * copy, modify, and distribute this software in source code or binary form for use\n * in connection with the web services and APIs provided by Facebook.\n *\n * As with any software that integrates with the Facebook platform, your use of\n * this software is subject to the Facebook Developer Principles and Policies\n * [http://developers.facebook.com/policy/]. This copyright notice shall be\n * included in all copies or substantial portions of the software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *\n * @flow\n * @format\n */\n'use strict';\n\nconst ShareDialog = require('react-native').NativeModules.FBShareDialog;\nimport type {ShareContent} from './models/FBShareContent';\n\ntype ShareDialogMode = ShareDialogModeIOS | ShareDialogModeAndroid;\ntype ShareDialogModeAndroid =\n /**\n * The mode is determined automatically.\n */\n | 'automatic'\n /**\n * The native dialog is used.\n */\n | 'native'\n /**\n * The web dialog is used.\n */\n | 'web'\n /**\n * The feed dialog is used.\n */\n | 'feed';\ntype ShareDialogModeIOS =\n /*\n * Acts with the most appropriate mode that is available.\n */\n | 'automatic'\n /*\n * Displays the dialog in Safari.\n */\n | 'browser'\n /*\n * Displays the dialog in a UIWebView within the app.\n */\n | 'webview'\n /**\n * The native dialog is used.\n */\n | 'native';\n\nmodule.exports = {\n /**\n * Check if the dialog can be shown.\n */\n canShow(shareContent: ShareContent): Promise<boolean> {\n return ShareDialog.canShow(shareContent);\n },\n\n /**\n * Shows the dialog using the specified content.\n */\n show(shareContent: ShareContent): Promise<any> {\n return ShareDialog.show(shareContent);\n },\n\n /**\n * Sets the mode for the share dialog.\n */\n setMode(mode: ShareDialogMode) {\n ShareDialog.setMode(mode);\n },\n\n /**\n * Sets whether or not the native share dialog should fail when it encounters a data error.\n */\n setShouldFailOnDataError(shouldFailOnDataError: boolean) {\n ShareDialog.setShouldFailOnDataError(shouldFailOnDataError);\n },\n};\n"]} node_modules/react-native-fbsdk/src/FBShareDialog.js: * Displays the dialog in a UIWebView within the app. node_modules/react-native-inappbrowser-reborn/README.md:Using in-app browser tabs (like SFAuthenticationSession/ASWebAuthenticationSession and Android Custom Tabs) where available. Embedded user-agents, known as web-views (like UIWebView and WKWebView), are explicitly not supported due to the usability and security reasons documented in [Section 8.12 of RFC 8252](https://tools.ietf.org/html/rfc8252#section-8.12). node_modules/react-native-webview/README.md:- [7.0.1](https://github.com/react-native-community/react-native-webview/releases/tag/v7.0.1) - Removed UIWebView node_modules/ua-parser-js/test/browser-test.json: "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Mobile/14A456 QQ/6.5.3.410 V1_IPH_SQ_6.5.3_1_APP_A Pixel/1080 Core/UIWebView NetType/WIFI Mem/26",

Any help?

Hamashassan commented 3 years ago

make sure you using the latest version of FBAudienceNetwork 6.2.0 (not 5.1.1)

jessiemblack commented 3 years ago

I'm still having this issue with react-native-fbsdk: "3.0.0", react-native: "0.63.3",