lufinkey / react-native-spotify

A react native module for the Spotify SDK. [Deprecated]
378 stars 76 forks source link

UIWebView is deprecated #140

Closed psoren closed 5 years ago

psoren commented 5 years ago

Hi there,

I am using react native 0.60 and I am developing for iOS. I recently submitted my app to the app store, and I received an email from Apple containing the following:

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.

In the link above, Apple suggests using the WKWebView API instead of the UIWebView API. I also viewed the source code for this package, and found the following line in the ios/RNSpotifyWebViewController.m file:

_webView = [[UIWebView alloc] init];

I am not sure of the usage of the WKWebView API, but I do not think that this change would be too difficult.

lufinkey commented 5 years ago

I'll try to make this change when I have a chance

lufinkey commented 5 years ago

This is fixed in 1.2.10

hbarylskyi commented 4 years ago

Hey @lufinkey, I've been dealing with UIWebview problems in an app I'm working on since Apple does not let apps with UIWebView to be uploaded anymore.

After I removed rn-spotify-sdk from the project, Apple accepted the build, so seems like we still cannot use this package. I'm using version 1.2.13 of this library.

hbarylskyi commented 4 years ago

Maybe calls to UIWebView in rn-spotify-sdk/ios/external/SpotifySDK/Demo Projects/Simple Track Playback/Simple Track Playback/WebViewController.m are the problem?

or maybe this line in RNSpotifyAuthController? #pragma mark - UIWebViewDelegate

hbarylskyi commented 4 years ago

Also I don't know if issues can be reopened here; I can create a new one if you want.

lufinkey commented 4 years ago

UIWebView should already have been replaced with WKWebView. Are you using an old version of the library? Or could you point to the code that's causing the issue?

On Sat, May 9, 2020, 5:53 AM Hleb Barylskyi notifications@github.com wrote:

Also I don't know if issues can be reopened here; I can create a new one if you want.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lufinkey/react-native-spotify/issues/140#issuecomment-626140012, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3VGUP36ZQUVD6LWOCR3I3RQUR3HANCNFSM4ISFZPAA .

lufinkey commented 4 years ago

Ohh, if you're compiling code from the demo project, you probably shouldn't be doing that. No code from the SDK's demo project should be in your project.

iamcxa commented 4 years ago

@lufinkey I'm facing the same issue of UIWebView is deprecated, too. Seems there's still has an issue inside your package.

ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview).

Apple says that every time I submit my app to the store. I found the reason is the Spotify SDK we're using right now in your package contains this deprecated UIWebView.

Let's see how I found it. I'm sure I don't use any UIWebView API, so I type the command below in the root of my project.

grep -r UIWebViewDelegate node_modules/*

And the result shows:

Binary file node_modules/rn-spotify-sdk/ios/external/SpotifySDK/SpotifyAuthentication.framework/SpotifyAuthentication matches

(the file is this one: https://github.com/lufinkey/spotify-ios-streaming-sdk/blob/36b4837a7c144f5768f9cd393ab96fc0636ada23/SpotifyAuthentication.framework/SpotifyAuthentication)

we can achieve the app in this situation to verify if there have parts using deprecated UIWebView, which means finding the dependency on the achieved app files.

// today = (e.g. 2020-05-11)
cd  ~/Library/Developer/Xcode/Archives/${today} 

// e.g. MyApp 2020-5-11, 9.23 PM.xcarchive
cd "${appName} ${today}.xcarchive"

// search dependency
grep -r UIWebView ./*

After those commands, the result shows:

./BCSymbolMaps/9A644DF5-8D3F-31E5-967B-42EA38E95AEF.bcsymbolmap:l_OBJC_PROTOCOL_$_UIWebViewDelegate
./BCSymbolMaps/9A644DF5-8D3F-31E5-967B-42EA38E95AEF.bcsymbolmap:l_OBJC_LABEL_PROTOCOL_$_UIWebViewDelegate
./BCSymbolMaps/31174FD0-92F5-3821-BDF8-5F8B2AEB714A.bcsymbolmap:l_OBJC_PROTOCOL_$_UIWebViewDelegate
./BCSymbolMaps/31174FD0-92F5-3821-BDF8-5F8B2AEB714A.bcsymbolmap:l_OBJC_LABEL_PROTOCOL_$_UIWebViewDelegate

Which means there is something still using the deprecated UIWebView, it also meets the result when we grep UIWebViewDelegate in node_modules.

so, @lufinkey I wonder if there's possible that you can update the Spotify SDK to a relatively new version? I know that the version currently using is deprecated and can't be found in Github, but your package means to import to us --- we have a project depends on your great work. besides that, if the SDK doesn't be updated, it may affect all apps that used your package to deploy to the AppStore.

Ticalie commented 4 years ago

After trying all sorts of things, I've managed to pass ITMS-90809: Deprecated API Usage

What I did:

  1. yarn upgrade --latest
  2. Deleted /ios/external/SpotifyAuthentication.framework
  3. Removed all references to SpotifyAuthentication (in xcode, global search for SpotifyAuthentication)

Just got an approved TestFlight app. Spotify.logout(): Works! Spotify.login(): Works! Spotify.playURI(...): Works!

@lufinkey Is SpotifyAuthentication not needed in the external folder?? 🤔

Oh, and by the way: Thanks for providing this package 👍 :)

lufinkey commented 4 years ago

I believe I removed the dependence on it, so it's likely no longer needed.

On Tue, May 12, 2020, 10:30 AM Jesper Bromose notifications@github.com wrote:

After trying all sorts of things, I've managed to pass ITMS-90809: Deprecated API Usage

What I did:

  1. yarn upgrade --latest
  2. Deleted /ios/external/SpotifyAuthentication.framework
  3. Removed all references to SpotifyAuthentication (in xcode, global search for SpotifyAuthentication)

Just got an approved TestFlight app. Spotify.logout(): Works! Spotify.login(): Works! Spotify.playURI(...): Works!

@lufinkey https://github.com/lufinkey Is SpotifyAuthentication not needed in the eternal folder?? 🤔

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lufinkey/react-native-spotify/issues/140#issuecomment-627382000, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3VGUN2KU6RT5AU6WWP5TLRRFMQBANCNFSM4ISFZPAA .