Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
kylefowler
Posts: 526
Registered: ‎05-17-2009
My Device: 9900

foursquare bb10 sdk

Hey guys - wanted to let you all know about the foursquare for BB10 "Sdk" that we just announced and have built in to the preloaded app.

Check it out here http://engineering.foursquare.com/2013/01/31/native-app-integration-like-never-before-the-foursquare...

Let me know if you have any questions or have any ideas of what you might want to see in a future release!
Like all of my posts
Please use plain text.
Developer
greenback
Posts: 531
Registered: ‎10-17-2010
My Device: BlackBerry Z10, DAC

Re: foursquare bb10 sdk

This is awesome. Thank you Kyle!

 

:Rockon:

Please use plain text.
Developer
yogeshwarp
Posts: 30
Registered: ‎11-09-2012
My Device: Dev Alpha A

Re: foursquare bb10 sdk

Great! wish more companies join in and do the same for BB10 to make it even more awesome dev platform
Please use plain text.
Developer
kylefowler
Posts: 526
Registered: ‎05-17-2009
My Device: 9900

Re: foursquare bb10 sdk

There a small bug where the access token json is invalid json. Whoops.

You will have to parse the response to pull the token out, but that should be pretty easy.

QString response;
response.split("\"").at(1) //should give you the token
Like all of my posts
Please use plain text.
Developer
ekke
Posts: 1,538
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: foursquare bb10 sdk


kylefowler wrote:
There a small bug where the access token json is invalid json. Whoops.

You will have to parse the response to pull the token out, but that should be pretty easy.

QString response;
response.split("\"").at(1) //should give you the token

will this survive updates from your app ? perhaps at first test if valid JSON and if not, then parse and pull ?

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Developer
kylefowler
Posts: 526
Registered: ‎05-17-2009
My Device: 9900

Re: foursquare bb10 sdk

That would be the best fail safe solution. I havent decided if I'm going to make the change yet. Its as easy to pull the token out of that string as it is to run it through the JSON parser.
Like all of my posts
Please use plain text.
Developer
ekke
Posts: 1,538
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: foursquare bb10 sdk

today I started to integrate Foursquare

 

went to foursquare developer and registered my app

got a CLIENT ID and SECRET CLIENT ID

 

then I tried to SSO with Foursquare and got an error

 

Connecting failed

<my-app> has a configuration problem and was unable to connect to your foursquare account.

Cause for error: redirect_uri_mismatch

 

----

I have to say I had no idea what I should put into the redirect-uri field while registering the app,

so I used the same as my welcome-page-url

 

If someone has an idea what to enter into this field would be great

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Developer
ekke
Posts: 1,538
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: foursquare bb10 sdk

Kyle,

another question about onPageSuggestion.

 

I tried to get a value into the Search Field which appears together with the Pages,

but its always empty.

 

constructed the query similar to Venue Search which works well.

 

InvokeRequest cardRequest;
cardRequest.setTarget("com.foursquare.blackberry.uri");
cardRequest.setAction("bb.action.OPEN");
QUrl uri = QUrl("foursquare://users/suggest");
uri.addQueryItem("type", "page");
uri.addQueryItem("query", "xyz");
cardRequest.setUri(uri);
mInvokeManager->invoke(cardRequest);

 type=page was used

query=xyz was not used

 

thx for cool Foursquare integration

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Developer
kylefowler
Posts: 526
Registered: ‎05-17-2009
My Device: 9900

Re: foursquare bb10 sdk

Sorry Ekke, I should have added that as a comment in the sample and I'll add it now but the callback should be http://localhost

Second part, yeah the query param isnt mapped to the page search yet. That is something I could add, but would have to be included in an app update at some point in the future.
Like all of my posts
Please use plain text.
Developer
ekke
Posts: 1,538
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: foursquare bb10 sdk

[ Edited ]

kylefowler wrote:
Sorry Ekke, I should have added that as a comment in the sample and I'll add it now but the callback should be http://localhost


works now perfect. my app is connected :smileyhappy:


kylefowler wrote:
Second part, yeah the query param isnt mapped to the page search yet. That is something I could add, but would have to be included in an app update at some point in the future.

so I let the query=xxx in my code and one day by magic it will work ;-)

--------

next question to verify:

Venue search card

QUrl uri = QUrl("foursquare://venues/search");
uri.addQueryItem("client_id", mFoursquareClientId);
uri.addQueryItem("client_secret", mFoursquareClientSecret);
QString token = mSettings->getValueFor(SETTINGS_KEY_FOURSQUARE_TOKEN, "");
if(!token.isEmpty()){
    uri.addQueryItem("oauth_token", token);
}
uri.addQueryItem("query", "xxx");
cardRequest.setUri(uri);
mInvokeManager->invoke(cardRequest);

 I have noticed it worked without the token using client id and client-secret.

Is it correct to send all 3 values if I got a Token or should I remove client id and client secret if a token is there ?

thx again

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.