Facebook Checkin: iOS OK, Android FAIL

Hi,

I’ve managed to get checkins to work in my app, on iOS. But it fails on Android.

In general, the procedure I follow is to first use the current location coordinates to search nearby places on Facebook. This is because a “checkin” requires a “place_id” which means only places that have a Facebook Page can be checked in to.

Step 1:
To search nearby places:
https://graph.facebook.com/search/?type=place&center=[latitude],[longitude]&distance=[metres]&format=json

local searchQuery = "search/?type=place&center=" .. storyboard.latitude .. "," .. storyboard.longitude .. "&distance=1000"  
  
facebook.request( searchQuery, "GET" )  

Step 2:
After getting list of nearby places, it is very easy to publish a Checkin:

local checkinCommand = {  
 place = fb.checkInPlace.id,  
 message = strings[lng].check\_in\_msg,  
 coordinates = json.encode({ latitude = storyboard.latitude, longitude = storyboard.longitude }),  
}  
  
facebook.request( "me/checkins", "POST", checkinCommand )  

This works perfectly on iOS. But on Android I have narrowed down the failure to wrong GET URL issued to graph.facebook.com while searching for nearby places. My logcat log caught this:

[text]
https://graph.facebook.com/search/?type=place&center=25.0592768,121.5441663&distance=1000?access_token=[blah_blah_very_long_facebook_access_token_is_inserted_here_by_facebook_dot_request_function]&format=json
[/text]

As you can see, the access_token is appended to the URL string AFTER my query string. So there is an unexpected ‘?’ there in the URL string.

It seems to me like there is a difference in facebook.request() of Corona for iOS and Android:
iOS:

facebook.request() {  
 if(path contains '?') {  
 url = "https://graph.facebook.com/" + path + '&' + access\_token  
 } else {  
 url = "https://graph.facebook.com/" + path + '?' + access\_token  
 }  
}  

Android:

facebook.request() {  
 url = "https://graph.facebook.com/" + path + "&" + access\_token  
}  

I tested with Corona builds 799 and 821. Same results.

Could I request someone please check this? It’d be really cool to get a quick fix :slight_smile:

Regards,
Kapil [import]uid: 135671 topic_id: 26792 reply_id: 326792[/import]