0

Good afternoon. I've implemented the Facebook API (v3) in my Android app so users can share achievements etc. When the Facebook Activity is finished then onActivityResult is called in the parent Activity.

How can I recognize if the onActivityResult was called from a Facebook-Activity? Can I define the requestCode Facebook should use?

Any help is highly appreciated.

Update

Am I right that the requestCode of Facebook is always 64206?

sjkm
  • 3,887
  • 2
  • 25
  • 43
  • 1
    To answer your other question, yes: https://github.com/facebook/facebook-android-sdk/blob/master/facebook/src/com/facebook/Session.java#L69 – Ming Li Jul 09 '14 at 17:38
  • Thank you! Really great to know. Appeciate your help ;)! – sjkm Jul 09 '14 at 17:58

1 Answers1

1

You can set your own request code.

You'll need to create a Session.OpenRequest or Session.NewPermissionsRequest, but there is a setRequestCode method in both of those classes:

https://developers.facebook.com/docs/reference/android/current/class/Session.OpenRequest

https://developers.facebook.com/docs/reference/android/current/class/Session.NewPermissionsRequest

Ming Li
  • 15,672
  • 3
  • 37
  • 35
  • Great. Works like a charm! Thank you for your time. No idea why I overlooked that reference page. Have a nice evening – sjkm Jul 09 '14 at 17:34