question

support-2 avatar image
support-2 asked

How to send a player event request

I am using an IOS obj C client. I am uncertain on how to create a PlayerEventRequest and send it. My code below is actually in swift but I can covert it if need be.

The error I get is "Invalid input parameters"


*********CODE*********

let playerRequest = WriteClientPlayerEventRequest()playerRequest.eventName = "event name dummy"PlayFabClientAPI.getInstance().writePlayerEvent(playerRequest, success: { (response, obj) in Dlog(message: "response of event from playfab \(response)")}, failure: { (error, obj) inDlog(message: "error of event from playfab \(error?.errorMessage)")}, withUserData: nil)
**************************

Thanks,

PlayStream
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1807605288 avatar image
1807605288 answered

Our Objective C SDK was provided to us by a customer. At present, we do not have the technical expertise to support this SDK.

Thankfully, it doesn't seem that your current issue is SDK specific.

Invalid input parameters implies that something is missing or wrong.

The error information you are reading is error.errorMessage. There is additional information in error.errorDetails. Specifically, you should be able to see this message inside of that dictionary:

"EventName": [ "Field contains invalid characters. Allowable values are ASCII alphanumeric and underscore characters." ]

You have a space in your EventName, and thus your event is throwing an error.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

support-2 avatar image support-2 commented ·

Thanks for the response. I just tried it and it worked. Are there any plans to go from 'beta' to a 'released' version of the Objective C SDK?

0 Likes 0 ·
brendan avatar image brendan support-2 commented ·

Not in the immediate future. Once we feel that we can fully support that specific SDK, we'll be moving it out of beta.

0 Likes 0 ·
support-2 avatar image
support-2 answered

Same code and hopefully in better format:

let playerRequest = WriteClientPlayerEventRequest()
playerRequest.eventName = "event name dummy"
PlayFabClientAPI.getInstance().writePlayerEvent(playerRequest, success: { (response, obj) in

Dlog(message: "response of event to playfab \(response)")

}, failure: { (error, obj) in Dlog(message: "error of event to playfab \(error?.errorMessage)")
}, withUserData: nil)
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1807605288 avatar image 1807605288 ♦ commented ·

Sorry, I changed your comment to an answer, because I misunderstood. My bad.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.