I'm building a turned based game in iOS.
I have a custom UI and so far I can authenticate the user, find random matches, invite friends, and send data to and from the players.
My problem is this: When a player invites another player, the second player gets a push notification. The second player needs to go to the gamecenter to accept or decline the game and then come back. I have not found a way to create a custom GUI for this. The methods shown in Apple's APIs are deprecated ([GKTurnBasedEventHandler sharedTurnBasedEventHandler].delegate = self; | handleInviteFromGameCenter: | and so on) [https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/GameKit_Guide/ImplementingaTurn-BasedMatch/ImplementingaTurn-BasedMatch.html#//apple_ref/doc/uid/TP40008304-CH15-SW8].
Can someone please point me to the right direction? I don't mind if it is Objective-c or Swift.
Thank you
UPDATE:
I created TurnBasedSkeleton (github.com/mhatzitaskos/TurnBasedSkeleton). This project aims to create a skeleton for any turn based game using GameCenter. As GameCenter seems to lack in documentation and tutorials, especially as far as turn based gaming is concerned, I decided to create this project to help others who might want to integrate GameCenter to their projects.
You need to use the following class below as of iOS 7 and later.
https://developer.apple.com/library/ios/documentation/GameKit/Reference/GKLocalPlayerListener_Ref/index.html#//apple_ref/occ/intf/GKLocalPlayerListener
Under the GKLocalPlayer object there is a method called registerListener and pass the NSObject you created that conforms to GKLocalPlayerListener.
Related
TL/DR
How can I make an iOS app appear on share sheet to receive shared urls from any other app?
This is a super newbie post as I have never really touched swift to develop anything, but I couldnt find the answer to my question on google so i wanted to start here. Almost everything I found by googling around is UIActivityViewController which appears more to be about how to share content from my app to another app; while what I am trying to do is share urls from another app to my app.
I am try to build a simple app for ios (doesnt have to be old version compatible because it will be only used by me) that can be a receiver for shared urls from apps like safari, brave or youtube. All the app does is when user clicks on the share button, and then chooses the app, the app gets the relevant data that is being passed, and then posts it to a backend server.
I can accomplish this on my android app/devices with an intent filter action android.intent.action.SEND in the manifest, and then listening for it with Intent intent = getIntent() in my method.
Would someone be kind enough to point me in the right direction at what I should look into (google about). If you can also point me to some sample code examples on how to write an app that can be the receiver for shared data (like urls), that would be fantastic. I am not sure what to search for so that my app can show up on share sheet, and how to then react with the data.
Again, apologies for the super noob question, but I couldnt translate my idea to something relevant on google.
It can be achieved by an Action Extension. Search for it.
Here is one:
https://code.tutsplus.com/tutorials/ios-8-how-to-build-a-simple-action-extension--cms-22794
I think both Share extension and Action extension can do the job. It depends on your needs.
Check this table to make sure which one is more appropriate for your purpose.
You can refer to App Extension Programming Guide by Apple.
We're trying to integrate the Facebook SDK just so we can track installs and the effect of Facebook ads on our mobile game on iOS.
From what I've been reading it sounds like the purpose of calling FB.Init() is to give back a page to display to the user to log them into Facebook. That's not really what we're interested in so we just ignore it. Our game doesn't need or want to log anyone into Facebook -- merely to track the install of the app by App Id. Do we even need to call this?
Is it enough merely to include the SDK and set up the settings file in our app for iOS builds?
Yes, you have to call it.
This method is used to initialize and setup the SDK. All other SDK methods must be called after FB.Init(), because they
won't exist until you do.
I have been developing a chat application using Quickblox framework.
I have been reading and testing many official sample projects (including Q-municate) but i do not find a way to block / ban user.
Is there a method for achieving this functionality ? Do i need to implement Custom Objects ? Thanks.
You can use Custom Objects for now. For example, create a class and store IDs of blocked users there. And then develop appropriate logic on the client side.
QuickBlox is going to release 'true' block list soon, also it will be available within Q-municate project
My question is simple and vague. I can't get started in google play games. I need to create an application (in this case is a chess game that works in iOS and android). I've been doing the google tutorials but I can't create a game of my own.
I've done this quick start.
I can log in with my account to the game I've created and configured here.
The status of my game is "Ready to Test."
This is a four man group project and I'm in the iOS development. I'm new to apple devices and objective C, so it complicates my life a little.
For the first app I'm trying to do anything at all, like a tic-tac-toe game or a "chat game."
I've searched for a tutorial that guides me step-by-step so I can get it.
Can anyone help me here please?
Thank You!
What do you mean by "can't get started"?
Now your status is get started, you need to:
* Add your account as the tester account in the game service console so that you can sign in with this Google account when testing your game.
Implement the very basic code to access game service (sign in, leaderboard and/or achievements, etc.), which I assume you have already done if you have followed the quick start.
Test your game. You can provide a button in the game UI and when you click that button, perform the sign-in process. If you have already implement the leaderboard/achievements, you can also check them.
Let's say we wan to have a custom backend for a iOS game that manages user accounts and allows the users to send objects to each other, but we don't want to actually have the user to create a dedicated useraccount for our game. It would be possible to simply use the playerID for the usermanagement, but that would not be secure. Is there any way to use a local gamecenter authentication to also authenticate at a custom webservice?
Currently i ponder about how the game 'pocket frogs' enables the players to send gifts to gamecenter friends. Gamecenter doesn't seem to provide this functionality so i assume they use a custom backend for it, but how can such a backend authenticate the player?
I can't say for sure if this is how Pocket Frogs (PF) does it, but based on the fact that only Game Center (GC) friends who also play PF appear on the neighbours list, I think it may work like this:
When a player first starts the game, they get a user id (a 32-bit int, say) from the PF back end which is stored locally. Once the player has this id it can be stored in one of the GC leaderboards under the GKScore context property rather than the value. As far as I can see, PF automatically adds every player to all of the leaderboards pretty much straight away.
Then when another player wants to send a gift, PF gets the leaderboard scores for all of their GC friends and if they have a valid score they must be a PF player and the context value can be read to get their PF id.
In this way the PF back end gets the correct id, but doesn't need to use their GC id.
Incidentally, I tried out the idea of using challenges for sending gifts, and it can work. See http://www.lrgdigital.com/ofgame.html for the game I tried it with - you have to win a game before you can gift it. It has the benefit that you can send the gift to anyone on your friends list rather than only friends who play the game, but there are some limitations as well.
No. Gamecenter uses apple id and that is off limits for obvious reasons. And if you look into the game center framework, there is a way to get gamecenter friends.
Look here to see how to get an array of friends: Game Center Friend List