Weird error when sending friend request

0 votes
InvalidCastException: Cannot cast from source type to destination type.
AssemblyCSharp.UserResponse.OnSuccess (System.Object user) (at Assets/scripts/UserResponse.cs:32)
com.shephertz.app42.paas.sdk.csharp.connection.RESTConnectorWWW.buildResponseForObjectService (System.String successValue, App42CallBack callBacK, System.String resource)
com.shephertz.app42.paas.sdk.csharp.connection.RESTConnectorWWW+<execute>d__3.MoveNext ()
 
Not really sure what that means, here's a link to my script -
 
 
Any tips of making this code more efficient would also be helpful.
asked Mar 6, 2014 in App42 Cloud API-BaaS by JoeCrill (25 points)

1 Answer

0 votes

Please share your UserResponse script file. I think you done incorrect type casting in your callback.

answered Mar 6, 2014 by sshukla480 (407 points)
http://codeshare.io/h6DYu

That's the code that was imported from the app42 unity sdk
This sample code for our user service, and you are trying to invalid type casting with user object to buddy object. Please use BuddyResponse instead of UserResponse in your script.
Learn how to use our buddy API's please see:
http://api.shephertz.com/app42-docs/buddy-management-service/?sdk=unity
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...