| event - live event handle. |
| Copies a service event payload into an owned JSON value. Each call returns an independent JSON handle. Free it with FreeJson; freeing the event does not free the copy. Every payload has schemaVersion 1. Authentication/account payloads contain playerId and playerName; score payloads contain score as a decimal String; native-screen dismissal reports dismissed=true. Purchase payloads contain catalog offers, authoritative inventory, transaction state or spending receipts; their exact fields are listed in the guide. Other successful operations may contain only schemaVersion. Optional provider, providerCode and providerDomain are diagnostic. All game service commands run on the main Blitz runtime thread and are prohibited in Worker Functions. See the Game Services guide for setup and the playable target game. See also: InitGameServices, PollGameServiceEvent, GameServiceEventStatus. |
; GameServiceEventData Example
; ----------------------------
Graphics 640,480,0,2
Print "Native game services"
Print "Configure an iOS or Android export for live services."
Local request=InitGameServices()
If request=0 Then Print GameServiceLastError()
Local deadline=MilliSecs()+125000
While request>0 And MilliSecs()<deadline
Local event=PollGameServiceEvent()
If event
Print "Kind: "+GameServiceEventKind(event)
Print "Request: "+GameServiceEventRequest(event)
Print "Status: "+GameServiceEventStatus(event)
Print GameServiceEventError(event)
Local payload=GameServiceEventData(event)
Print JsonStringify(payload)
FreeJson payload
If GameServiceEventRequest(event)=request Then request=0
FreeGameServiceEvent event
EndIf
If KeyHit(1) Then Exit
Delay 10
Wend
Print "Press any key to close."
WaitKey
End