09:13 <Loqi> [[API/Account Methods]] http://geoloqi.org/wiki/index.php?diff=713&oldid=416&rcid=744 * Aaronpk * (+156)
09:39 <Loqi> [[API/account/set apn token]] N http://geoloqi.org/wiki/index.php?oldid=714&rcid=745 * Aaronpk * (+3306) Created page with '== URL == {{API_Endpoint|account/set_apn_token}} == Supported Request Methods == POST == Parameters == * {{API_Param|param=device_id|note=Required|description=The Apple device …'
11:53 MarkDilley joined #geoloqi
17:51 Jeff_ joined #geoloqi
17:53 Jeff_Lam joined #geoloqi
17:53 <Jeff_Lam> Hey Aaron. I just sent you my app's UA key & secret. Sorry for the late reply. RHoK ATL actually started *yesterday* at noon Eastern time and ended today at noon.
17:55 <aaronpk> got it!
17:55 <aaronpk> oh crazy, ours started this morning and goes until tomorrow
18:00 <aaronpk> did you guys get very far?
18:01 <aaronpk> can I see your project page?
18:01 <Jeff_Lam> Yeah, our "good samaritan" app sends out push notifications to the nearest good samaritans and uses the Twilio API to initiate a phone call between the first responder and the person in distress.
18:02 <aaronpk> that's awesome!
18:02 <Jeff_Lam> We didn't geolocate the nearest people for our demo since our test clients and teammates were colocated.
18:02 <aaronpk> hehe yea, probably fine for a demo
18:03 <Jeff_Lam> I still haven't created a project page on rhok.org yet, but you can look at my github repo: https://github.com/Agent007
18:04 <Jeff_Lam> I used the Titanium IDE to code the iOS app in JavaScript and it translates it to Obj-C and compiles it.
18:05 <Jeff_Lam> The "good samaritan" app is really the "e911" repo since I originally envisioned it as a crowdsourcing feature of an greater enhanced 911 system.
18:05 <aaronpk> sweet, that's a neat idea
18:06 <Jeff_Lam> Well, the FCC recently released the standards definition for e911 and there are already similar iPhone apps out there such as Guardly
18:09 <Jeff_Lam> Eventually, I would like to include an audio/video streaming session with someone acting as a 911 operator via something like the SkypeKit, which is currently in limited beta.
18:15 <aaronpk> wow, that would be super intense!
19:44 <Jeff_Lam> Aaron, I just tried the broadcast and it thinks it sent the push notifications to my mobile app, but I didn't see it :-( This time, I made sure I used the "broadcast" instead of the "count_broadcast" method :-)
19:50 Jeff_Lam joined #geoloqi
19:52 <Jeff_Lam> No rush, Aaron. I'm willing to work on this later.I think I'm gonna call it a night soon.
21:14 <aaronpk> hey, took off to get some dinner, I was super hungry
21:30 <aaronpk> Jeff_Lam: can you check in urban airship to see if their stats show any pushes were attempted? also check their error console to see if anything is there
21:33 <Jeff_Lam> Just tried again. Nothing on my UA error console and zero messages sent according to their stats page.
21:33 <aaronpk> k i'm going to turn on debugging and then try it again
21:34 <aaronpk> k go ahead
21:41 <aaronpk> oh strange, I got this error from UA: "device_token contains an invalid device token: 0"
21:42 <Jeff_Lam> Ok, let me check my device token
21:44 <aaronpk> k I see a "0" for one of your devices. I'm going to make my end ignore it if it's 0, but you should check to see why it would have sent a 0 anyway
21:47 <aaronpk> ok, I removed the "0" from that broadcast and attempted to send it again, did you get that one?
21:47 <aaronpk> I didn't get an error from UA this time
21:48 <Jeff_Lam> According to my debug output, my device token is normal. Hmmm...
21:49 <Jeff_Lam> I just tried re-registering my device token again.
21:49 <Jeff_Lam> Oh, yeah, I think I did get a broadcast from you.
21:50 <aaronpk> awesome!
21:50 <Jeff_Lam> I got it on my iPhone, but not my iPad.
21:51 <aaronpk> I think it's the "0" that's causing the glitch, let me remove the 0 from the list
21:52 <Jeff_Lam> My iPad is the one that you've been getting a device token of zero for. I've not updated my app on my iPhone yet.
21:52 <Jeff_Lam> Ok, let me know when you've removed it.
21:52 <aaronpk> ok it's gone
21:52 <Jeff_Lam> Ok, let me try re-registering my device...
21:55 <Jeff_Lam> I just re-registered it.
21:55 <aaronpk> didn't see an error from UA, did you get it?
21:55 <aaronpk> and it definitely tried to send it to your ipad
21:56 <Jeff_Lam> I got it on my iPhone, which doesn't have the call to the geoloqi set_apn_token...
21:57 <aaronpk> that's actually quite odd...unless my code isn't using the proper UA account...
21:58 <Jeff_Lam> Maybe the reason you got "0" was because it was trying to register my iPad2's device token, but it was already registered in *my* UA app...
22:01 <Jeff_Lam> In other words, since you already have my UA app's ID & secret, do you really need to register all the mobile devices for my app onto geoloqi?
22:02 <aaronpk> well I was under the impression that the device tokens are unique to an application, so when your app registers for push notifications it would get a different token than the geoloqi app got
22:03 <Jeff_Lam> Yeah, good point.
22:05 <aaronpk> ok yea it's not using your account yet :/ let me trace it real quick
22:05 <Jeff_Lam> ok
22:09 <aaronpk> oh! hmm... are you using your permanent access token for sending the broadcast message?
22:10 <Jeff_Lam> I just deleted the geoloqi app on my iPhone and tried another broadcast message. I didn't receive a message this time :-) I made sure my geoloqi app was turned off for a while, but it must've still somehow gotten the broadcast message.
22:10 <Jeff_Lam> Yeah I was using my permanent token.
22:11 <aaronpk> ok so that's what's wrong then. It will use the client that was authenticated when making the message/broadcast request when looking for a UA acount.
22:11 <aaronpk> if you use an access token that you got from your app, then it should use your UA account instead
22:11 <Jeff_Lam> Ah ok.
22:12 <Jeff_Lam> Ok, I will try that. Gonna call it a night for real now :-)
22:14 <aaronpk> ok sounds good! i'll b e back at the hackathon tomorrow!