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
Posts: 543
Registered: ‎12-23-2010
My Device: Z10
My Carrier: Airtel

How can I identify that the user has shared a message successfully on twitter or facebook?

Hi All,

 

I want to know wether the user has shared the message succesfully or cancelled on facebook, twitter postwall screen.

 

Any one have any idea, please share with me.

 

Thanks.

Developer
Posts: 323
Registered: ‎05-07-2009
My Device: BlackBerry Z10, PlayBook, 9900
My Carrier: Telus

Re: How can I identify that the user has shared a message successfully on twitter or facebook?

Are you just curious to know if your code is working? or are you trying to verify the post succeeded in order to "unlock" an achievement in a game?  e.g. if you post something on twitter/facebook you get "25 coins" in the game?

 

Or is it similar to the latter.. but you aren't actually triggering the messages being sent to Twitter/Facebook and you want to use their API's to look and see if the user has posted something?


PlayBook Apps: DataMine, Dots + Boxes, 5 Marbles
BlackBerry SmartPhone Apps: 5 Marbles Soon: **** (D.Z.A), ****Quest, **** Challenge, VaultCracker, DevBrowser, Radial****
Developer
Posts: 543
Registered: ‎12-23-2010
My Device: Z10
My Carrier: Airtel

Re: How can I identify that the user has shared a message successfully on twitter or facebook?

Hi Steve, thanks for your reply.
Actually my requirement is, I have to add some points to user when successfully did a like or share. Also I want to save the user name which the user has logged in.
Any idea....

Thanks
Developer
Posts: 828
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Rogers

Re: How can I identify that the user has shared a message successfully on twitter or facebook?

the username could be saved using Qsettings sample

Developer
Posts: 323
Registered: ‎05-07-2009
My Device: BlackBerry Z10, PlayBook, 9900
My Carrier: Telus

Re: How can I identify that the user has shared a message successfully on twitter or facebook?

There's a few options depending how deeply you want to get into this.

 

at a very basic level you can use these 2 URL formats (1 each for Twitter/Facebook) to get a count of Shares/Likes.

 

Facebook:

URL Format: http://graph.facebook.com/ + yourSpecificPage

e.g.

http://graph.facebook.com/https://www.facebook.com/5Marbles

 

Twitter:

URL Format http://urls.api.twitter.com/1/urls/count.json?url= + your SpecificPage

e.g.

http://urls.api.twitter.com/1/urls/count.json?url=http://appworld.blackberry.com/webstore/content/85...

 

Both return in JSON format the counts... and in some cases additional data.

 

If you generate a unique key for your URL... before the user shares it... you can then check later if that count is 0 or more... if it is 1 or more, the user has shared/liked that link.


PlayBook Apps: DataMine, Dots + Boxes, 5 Marbles
BlackBerry SmartPhone Apps: 5 Marbles Soon: **** (D.Z.A), ****Quest, **** Challenge, VaultCracker, DevBrowser, Radial****
Developer
Posts: 543
Registered: ‎12-23-2010
My Device: Z10
My Carrier: Airtel

Re: How can I identify that the user has shared a message successfully on twitter or facebook?

Hi Steve,

 

Here you suggested that for facebook,

 

URL Format: http://graph.facebook.com/ + yourSpecificPage.

 

This is my original scenario,

 

1) In my app any user can login through facebook or twitter using their  IDs, I need to capture the username(or) email which they are logged in.

 

For this I want to get the user twitter and facebook details which the user setup in the device.

Here my problem is I am unable to get those details.

 

I don't have any "specificpage"  for my application. 

 

2) Any user can like/share some things in my app, so that the user can get some points to redeem gifts.

Here like/share can happen in user's social page(like facebook wall, twitter).

I don't have any specific page for all users.

 

I need to hit some service when he succesfully liked/shared.

 

Any help will be appreciated.

 

Thanks in Advance. 

 

Developer
Posts: 323
Registered: ‎05-07-2009
My Device: BlackBerry Z10, PlayBook, 9900
My Carrier: Telus

Re: How can I identify that the user has shared a message successfully on twitter or facebook?

For the login part if your app (not the settings in the Hub) actually offers the option to login via Facebook/Twitter then during the login the screen typically shows up stating that if the user logs in this way that they are authorizing / aware that this app can read / post to their stream.

I haven't dug to deep into this but from other apps I've seen this does seem to grant them full access.

I would visit each of the sites and look up "log in with Facebook" (or twitter) and research the necessary steps.

If like to point out though that as a user this is often the point in an app where I stop. For me if the app *requires* logging in via Facebook I uninstall the app. For the younger generation they likely don't care but for me personally I don't want apps I've installed spamming my friends and family. (Again this is just my personal view)

That said I'm not against social integration... I've added to my apps too giving users the option to share a link if they want to.

PlayBook Apps: DataMine, Dots + Boxes, 5 Marbles
BlackBerry SmartPhone Apps: 5 Marbles Soon: **** (D.Z.A), ****Quest, **** Challenge, VaultCracker, DevBrowser, Radial****