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

Building react-native-spotify 1.2.11 with 0.61.1 #144

Open
patrice4github opened this issue Oct 2, 2019 · 30 comments
Open

Building react-native-spotify 1.2.11 with 0.61.1 #144

patrice4github opened this issue Oct 2, 2019 · 30 comments

Comments

@patrice4github
Copy link

I'm sorry, this is more a question than an issue.

Thanks for your solid work on this library it is very useful to me. I know Spotify is going to the remote version of the API, but in the mean time, I'd like build it locally to investigate an issue.

It stopped working properly after I upgraded to RN 0.61.1. I can no longer login. The web view appears a bit, and closes right away.

I'm trying to build it in the mean time to diagnose this but I can't. Can I ask about your setup?

Screen Shot 2019-10-02 at 10 11 16 AM

I have clone ancillary modules at the same level:

Screen Shot 2019-10-02 at 10 06 20 AM

I'm looking at the project includes

Screen Shot 2019-10-02 at 9 51 05 AM

Were you able to test 1.2.11 on IOS yesterday? I can't where <SpotifyAudioPlayback/SpotifyAudioPlayback.h> is going to be found from these locations.

Any help will be appreciated.

@lufinkey
Copy link
Owner

lufinkey commented Oct 2, 2019

So I've had this issue too, but it only seemed to happen on the iPhone 8 simulator on iOS 13. The iPhone 11 simulators seemed to work fine. It seems like a bug in iOS, but I'm not entirely sure at this point.

Can you let me know if you see something like this in your logs?

[ProcessSuspension] 0x1195f67b0 - ProcessAssertion::processAssertionWasInvalidated()

As for the include issue, not sure what's up with that. Might have something to do with the fact that I updated the submodule repos to point at my forked Spotify SDK repos. I'll take a look at that.

@lufinkey
Copy link
Owner

lufinkey commented Oct 2, 2019

Can you also see if passing {showDialog:true} to your login function fixes the issue?

@patrice4github
Copy link
Author

patrice4github commented Oct 2, 2019 via email

@lufinkey
Copy link
Owner

lufinkey commented Oct 2, 2019

So the framework should be included directly. Can you make sure that node_modules/rn-spotify-sdk/ios/external/SpotifySDK has the frameworks inside it?

@lufinkey
Copy link
Owner

lufinkey commented Oct 2, 2019

You shouldn't need to clone the frameworks yourself

@lufinkey
Copy link
Owner

lufinkey commented Oct 2, 2019

Can you also see if the project works when you use an older version of the module? Can you force it to use 1.2.10?

@patrice4github
Copy link
Author

patrice4github commented Oct 2, 2019 via email

@lufinkey
Copy link
Owner

lufinkey commented Oct 2, 2019

Cool so that confirms we have the same bug with the web view disappearing

@lufinkey
Copy link
Owner

lufinkey commented Oct 2, 2019

Please try with 1.2.10 and let me know if you still encounter the bug

@patrice4github
Copy link
Author

patrice4github commented Oct 2, 2019 via email

@patrice4github
Copy link
Author

patrice4github commented Oct 2, 2019 via email

@patrice4github
Copy link
Author

patrice4github commented Oct 2, 2019 via email

@lufinkey
Copy link
Owner

lufinkey commented Oct 2, 2019

Yeah that's what I was worried about. I think it an iOS bug. The odd thing is I retested my other project on the simulator again and the bug seems to have gone away. Not sure what that means.

Also the Spotify streaming SDK frameworks should be included in the node module folder when you install it via npm install rn-spotify-sdk. You just need to add the framework search path

@patrice4github
Copy link
Author

patrice4github commented Oct 2, 2019 via email

@lufinkey
Copy link
Owner

lufinkey commented Oct 2, 2019

It's not a header search path. It's a framework search path. They're different. The README explains where you need to add it.

@lufinkey
Copy link
Owner

lufinkey commented Oct 2, 2019

Screen Shot 2019-10-02 at 1 08 52 PM

@lufinkey
Copy link
Owner

lufinkey commented Oct 2, 2019

Also whatever images you attached are not visible to me

@patrice4github
Copy link
Author

My framework search patch seems correct:

Screen Shot 2019-10-02 at 1 13 24 PM

I have an import not found, will the framework search path help? I don't
see that you include node_modules in your header search path, I'm still
curious as to where this one resolves. Where is your node_modules direct compared to react-native-spotify?

Screen Shot 2019-10-02 at 1 14 19 PM

Screen Shot 2019-10-02 at 1 14 47 PM

@lufinkey
Copy link
Owner

lufinkey commented Oct 2, 2019

So again, that's not framework search paths. That's header search paths. They're different things. You need to add the framework search path where the README specifies

@lufinkey
Copy link
Owner

lufinkey commented Oct 2, 2019

I'm confused as to what you're trying to do? It looks like you've just cloned this project and are just trying to build it individually, which is not how react native works. You need to have a root project and add this as a npm dependency. The project will not build on its own

@patrice4github
Copy link
Author

patrice4github commented Oct 2, 2019 via email

@lufinkey lufinkey closed this as completed Oct 2, 2019
@therealaldo
Copy link

therealaldo commented Oct 3, 2019

I wanted to chime in and say I'm getting the same error with React/RCTDefines.h file not being found. It was working with 0.60.5, but as soon as I upgraded, the build process fails.

React Native: 0.61.2
RNSpotify: 1.2.10

@lufinkey lufinkey reopened this Oct 3, 2019
@patrice4github
Copy link
Author

About the Auth screen that no longer appears, I'm trying to understand the code logic:
In RNSpotifyAuthController.m, we can read:

Screen Shot 2019-10-03 at 2 16 49 PM

Now, the decisionHandler gets a PolicyAllow because canHandleRedirectURL returns false and the login page never appears.

The canHandleRedirectURL looks like this:

Screen Shot 2019-10-03 at 2 11 11 PM

Screen Shot 2019-10-03 at 2 10 57 PM

The auth page flickers and I don't have a chance to login.

The url (accounts.spotify.com) must have a prefix of the url for my mobile app in the Spotify Dashboard? Why this hasPrefix check?

The example app has:

	const spotifyOptions = {
	    "redirectURL":"examplespotifyapp://auth",

For mobile, there's no web redirection per se, it only has to match one of the values in the Spotify Dashboard. Am I missing something?

@lufinkey
Copy link
Owner

lufinkey commented Oct 3, 2019

This is a prefix check for the redirect URL. When it sees that the page is navigating to the redirect URL, it stops the navigation, grabs the values from the redirect URL, and closes the login page. As you've shown, canHandleRedirectURL is returning NO, thereby allowing the web page to continue loading. If it detects that it's navigating to a redirect URL, then it will close. However, the web view is closing despite never hitting a redirect URL. As far as I can tell, that bug does not have anything to do with this piece of code.

@lufinkey
Copy link
Owner

lufinkey commented Oct 3, 2019

jowabo://auth is not the prefix of https://accounts.spotify.com/authorize?clie...., so the page is allowed to continue loading

@patrice4github
Copy link
Author

patrice4github commented Oct 3, 2019 via email

@patrice4github
Copy link
Author

patrice4github commented Oct 3, 2019 via email

@therealaldo
Copy link

My issue got resolved when I installed the package via Cocoapods instead of doing the manual install. When I tried reinstalling the packages, the error didn't come up for this package, but for react-native-events. I still am not sure what caused the issue to begin with.

@patrice4github
Copy link
Author

I have had a ton of luck with this:

https://github.com/openbakery/gradle-xcodePlugin

I'm gonna call this "the best thing that happened to Xcode ever".

It tells you everything that works and doesn't. The minimal build.gradle in the Usage section is sufficient for me.

@hbarylskyi
Copy link

@therealaldo were you able to fix issues with react-native-events? I'm trying to install with cocoapods. I've added this

pod 'RNEventEmitter', :path => '../node_modules/react-native-events'
pod 'RNSpotify', :path => '../node_modules/rn-spotify-sdk'

to Podfile.

and had to run yarn add react-native-events in order for pod install to work.

But after that I'm getting a ton of errors related to react-native-events after building:
image

were you able to solve that?

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

4 participants