iOS real time 2 players app - ios

I am currently writing an iOS real time game app auto-matchmaking function. I really need help to find out how can the two players can interact. Specifically, when plaeryA pressed the find match button indicating playerA is looking for a match. It sends a query to Parse database and sees that playerB is is also looking for a match. Now, I want them to be matched. I know it is a very bad idea to use queries to frequently polling the data from the database to check if the player is matched or not. Is there anyway I can achieve it such that 'if A and B is matched, a notification/alert is sent to both players to wait for their acceptance, if A & B both accepted the match, then the two players would perform the segue to the game view controller simultaneously.
I googled online, all I got is that I have to either use Apple's Game Center or Google Play service. But both of them requires users login. I do not really want that because it would be tedious user experience. The user had to register and sign in the account of my app, and now they have to sign in either game center or google again.
Any advice/help is greatly appreciated!!

Related

Tracking User with Google Ad Link

I'm not sure I've stated the title correctly, but I have what I think is an unusual issue. Not something I'm terribly worried about but curious. If I'm tagging this inappropriately I apologize.
I have a google ad running and track clicks using Final URL. So I track keywords, Ad_ID, Location, etc. Looking at the database I noticed that I am getting a hit on my website from what appears to be one user fairly regularly (sometimes minutes apart - other times days - 3200 entries) for the last 2 years, at least to when I started tracking this way. The entry shows the same keywords and the same location - which is local - a mobile device - but not an Ad_ID or a referring URL. I take the google info from the query string in the url so the query string would have to be the same every time.
I recently added a tracking cookie (long expiration) on the user end and this activity shows up with a different cookie value every time meaning either its either a different device or the device doesn't accept cookies. Each hit also starts a new session.
These hits do not show up as clicks on Google Ads so I'm not being charged, it also means that someone is not actually out there clicking on the ad.
I don't see where this is causing problems but am curious as to where this may be coming from. I don't know if there is a way to stop it.
So nothing critical but ideas on what might be causing this would be appreciated. I also get a ton of spam or bot hits on the site but that's a different issue.
Thanks!

My Own Impressions on AdMob?

I successfully made an app and its waiting for review right now. But meanwhile i've been playing the game on my mom's phone because, one, i dont have an iphone and its for iphone, and two, I actually like playing it. But I looked at my admob because i wanted to make sure i wasnt messing with it by playing my own app but it turns out i have 100 impressions! D: No clicks though, and i know im not supposed to click on my own ads. What do the impressions do? what are they? Am I going to get in trouble? I stopped playing the game now.
btw my moms iphone no longer has my developer Apple ID signed in on it, but it can still play the app and the UDID is still registered with the developer account if that matters.
Nothing to worry about.
Impressions are when an ad is displayed.
Requests are when an ad is requested.
Clicks is when you clicked on an ad (you haven't done that so nothing to worry about).
It's probably a good idea to add some quick code that differentiates between you and every other user. "If username == 'MobileGamer', don't display ads", or something similar. Just to be safe.
For example, I have several websites where both the ads and the stats-tracking code is omitted if I'm the logged-in user. That way, Google can't claim that I'm trying to steal money from them when I'm using my own website (they've tried before), and my user stats aren't skewed by huge activity spikes whenever I'm adding features or testing.
I haven't used AdMob specifically, but ad companies are famously strict with this sort of thing. I was once kicked from an advertising plan simply because my roommate, who was on the same network as me, clicked on an ad no my website once.
Better not to risk it. Just don't show the ads at all, for you or your testers.

iBeacon notification database

I have a question which I have not been able to figure out so I decided to see if I can get some help on here.
I am working on an iBeacons project and I have been able to understand the basic function of iBeacons, setting up UUID'S and major and minor id's to specify exact notifications, but my question is how do I dynamically update information I send out to the users without having to go into the code each time to do this. Do I need to create a database to store all my information I want to push out to users? if so how will this database constantly refresh messages pushed out to users? An example would be lets say if you walk into a store and you get a notification in the shoe section saying there is a 10 percent off, you look at the notification but not too impressed and start to walk out, then you get another notification saying for today only you can get a 25 percent off... The app has to dynamically refresh for this to be possible.
Please help me clarify this
Thank you very much for the help
What you probably want is to store this deal information in a web service so you can update it without changing the app. Your app would need to download the updated deal information from the web service either when it starts up or when it sees an iBeacon.
My company, Radius Networks, offers a tool called Proximity Kit that makes this easy. You can assign arbitrary key/value pairs to iBeacons using a web interface. Then your app downloads them automatically an has access to them whenever you see iBeacons.
In your scenario, they key/values could be something like:
primary_offer_text=10% off all shoes
secondary_offer_text=20% off all shoes

iOS: can game center account somehow be used for authentication on custom webservice?

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

How to implement an iOS app personalized start page?

I'm developing my first iOS app and I'm facing a challenge.
I'd like to present new users a personalized screen when the app starts at the first time. Let me explain more.
The flow should be more or less like this:
My app isn't installed on the user's device.
Then the user gets an SMS on his iPhone with a short message and a link to install my app. The message is part of a conversation. Another user of this app had sent this message (through my backend) in order to join this user to the conversation.
This install URL doesn't necesarrily link directly to the itunes store, it can link to a conversations specific link such as myapp.com/conv/12345
The page at myapp.com/conv/* will detect the device and if it's an iPhone would redirect the user to the appstore to install myapp.
The user then installs myapp and launches it.
Now I'd like to present the same conversation 12345 to the user, before he even needs to login, register or what have you. That's the difficult part... I don't want the user to start an a blank page, I'd like to take it right to the conversation 12345 page.
I assume steps 1-5 are easy, but I can't think of a way to implement 6. I admit that I'm not familiar enough with the intrinsic of the appstore but as far as my understanding goes, "all apps are made equal", I mean the app itself when it gets installed it has no context, it doesn't know what "caused" it to be installed, it isn't aware of the click on myapp.com/conv/12345. Is this correct?
If there was a way for an app to know something like a referrer URL for the instllation or something along these lines that would be awesome.
If there was a way for app to query the device for its phone number
then I could make this work (b/c the SMS was sent to a specific phone
number, so I can track the most recent conversation sent to this
number on my backend). But since apps are sandboxed, accessing the phone
number is off limit.
Well, I suppose I could ask the user to type a unique code from the SMS when the
app starts, say 12345 and then I'd be able to display the
conversation to him. But that's problematic in two ways, first,
security - the user can join a conversation not meant
for him, and second, that's less than optimal
user experience, I want this to work like magic, I don't want to make
users memorize and type strings into my app the first time they
install, I'm sure they won't appreciate it... (they could
copy-paste, but still...)
Another option is asking the user to type his phone number. But that
again has a few drawbacks, one is that again it's less than optimal
UX, I'm asking a user to type his phone number to an app he doesn't
yet know or trust, second I'll need to verify (authenticate) the
phone number, I mean what prevents that user from typing a phone
number that doesn't belong to him?
If I had access to the SMSs then I could dig up that code, but I find
it hard to believe that apps get access to SMSs, it's just sounds
like another reasonable sandbox restriction. Of course I'm not
speaking of jailbroken devices.
BTW, if the user just went over to the appstore to install my app (and didn't go through a conversation SMS) that's fine, in this case I'll just present a normal register/login page. The interesting case is where the user was already part of the conversation when receiving the SMS and now I want him to (effortlessly) become part of the same conversation through my app.
To sum up - is there a trick to present "personalized" pages the first time an app is installed and launched that would get that user right into the context of the conversation sent to him over SMS without having to request additional input?
Thanks!
It's impossible to do. Your application is installed without the knowledge you need whatsoever. As you pointed out, it's a reasonable sandboxing restriction.
What you could do is a challenge-response based system, but it would be about as intrusive to the user as is registering/login in.
Ran, you can keep a flag in NSUserDefaults (equivalent to Android's SharedPreferences)
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html

Resources