Spotify4Unity icon indicating copy to clipboard operation
Spotify4Unity copied to clipboard

None of the callbacks are firing despite successful connect on Unity 2019.4 iOS with ARFoundation

Open yosun opened this issue 4 years ago • 3 comments

Describe the bug

I am running your MobileScene in an ARFoundation project Unity 2019.4.4f1 LTS

Downloaded a fresh copy of your Unity asset and got it to run and click through the authentication on iOS. However, the app is not able to actually load data? Not even user profile?

It looks like none of the callbacks are ever being called even though it says successfully connected...

Here are some sample snippets from the xcode log:

Spotify4Unity - Successfully connected to the Spotify Web API
Scopes: PlaylistModifyPublic, PlaylistModifyPrivate, PlaylistReadPrivate, Streaming, UserReadPrivate, UserReadEmail, UserLibraryRead, UserLibraryModify, UserFollowModify, UserFollowRead, UserTopRead, PlaylistReadCollaborative, UserReadRecentlyPlayed, UserReadPlaybackState, UserModifyPlaybackState, UserReadCurrentlyPlaying
Spotify4Unity.SpotifyServiceBase:Configure(Token, AuthorizationCodeAuth)
Spotify4Unity.MobileSpotifyService:OnRecievedAuth(String)
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

NotSupportedException: System.Reflection.Emit.DynamicMethod::.ctor
  at System.Reflection.Emit.DynamicMethod..ctor (System.String name, System.Type returnType, System.Type[] parameterTypes, System.Type owner, System.Boolean skipVisibility) [0x00000] in <00000000000000000000000000000000>:0 
  at Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory.CreateDynamicMethod (System.String name, System.Type returnType, System.Type[] parameterTypes, System.Type owner) [0x00000] in <00000000000000000000000000000000>:0 
  at
Rethrow as AggregateException: One or more errors occurred.
  at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00000] in <00000000000000000000000000000000>:0 
  at System.Threading.Tasks.Task`1[TResult].GetResultCore (System.Boolean waitCompletionNotification) [0x00000] in <00000000000000000000000000000000>:0 
  at Spotify4Unity.SpotifyServiceBase.InitializeService () [0x00000] in <00000000000000000000000000000000>:0 
  at Spotify4Unity.SpotifyServiceBase.Configure (SpotifyAPI.Web.Models.Token token, SpotifyAPI.Web.Auth.AuthorizationCodeAuth auth) [0x00000] in <00000000000000000000000000000000>:0 
  at Spotify4Unity.MobileSpotifyService.OnRecievedAuth (System.String authArgs) [0x00000] in <00000000000000000000000000000000>:0 
 
(Filename: currently not available on il2cpp Line: -1)

Spotify4Unity - Saved auth token to reuse
Spotify4Unity.MobileSpotifyService:GotAuth(Token, AuthorizationCodeAuth)
EventDelegate`1:Invoke(T)
EventDelegate:Invoke(GameEventBase)
EventManager:TriggerEvent(GameEventBase)
EventManager:Update()
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

To Reproduce: If you can, list some of the steps you are taking

  • Use Unity 2019.4.4f1 AND ARFoundation 3.1.3
  • Download AR Foundation Samples https://github.com/Unity-Technologies/arfoundation-samples/tree/2.1
  • Make sure the right packages etc are there
  • Install and setup this asset
  • Build MobileScene to iPhone

Expected behavior

User info and other info should show up?

Platform:

  • iOS

Unity Version:

  • Unity 2019.4.4f1 LTS

yosun avatar Jul 18 '20 09:07 yosun

Unfortunately, it's always been a little ropey when it comes to Android/iOS support, especially since Unity has made a lot of changes since Spotify4Unity was first made. I personally haven't tested it on the newer versions so I can't say it supports them.

JoshLmao avatar Jul 18 '20 10:07 JoshLmao

Do you have any insights on what might be happening here?

Your docs mention it works with Unity 2019.3.0f2+ ... so I actually upgraded my project to .4 LTS

yosun avatar Jul 18 '20 10:07 yosun

I do have a little idea because others have had problems with IL2CPP. iirc, it's because of Newtonsoft.Json not being compatible, this is the latest issue which is similar (#26).

Try using JSON.NET for Unity. Read step 7 of the iOS setup steps and see if that fixed your problem

JoshLmao avatar Jul 18 '20 10:07 JoshLmao