質問

I want to implement "ask for help" feature in my game (Facebook Unity SDK). If user A asks user B for help, and user B accepts, user A will get a gift.

My game is a single player experience right now so we have not created a server. Is there anyway to know if user B has accepted the request when User A logs in again next?

The solution here involves storing information in a database: send Facebook request and get a gift FB API

役に立ちましたか?

解決

Not really, you must delete your request on accepting, so request can only be in pending state.

You can remember ID when you send request to a player, and check what pending requests exist, and if you don't find your ID there, you know request was either accepted or rejected, but that probably doesn't help.

You will need to store request data somewhere. You can use service like parse.com, where you can just push data from client without having to do much work server-side. Parse is free until your game gets big and after that 200$ should not be too much.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top