Skip to content

Instantly share code, notes, and snippets.

@im182cm
Last active December 7, 2017 00:57
Show Gist options
  • Save im182cm/ea9b9ac2fb45d1e74d452acf51903042 to your computer and use it in GitHub Desktop.
Save im182cm/ea9b9ac2fb45d1e74d452acf51903042 to your computer and use it in GitHub Desktop.
Facebook SDK requestCode

Facebook SDK requestCode

In Facebook SDK Guide, there are no comments about requestCode. However sometimes I needed to set requestCode on onActivityResult to distinguish with other action and prevent wrong behavior.

Summary

CallbackManagerImpl.RequestCodeOffset.XXX.toRequestCode()

Set enum value instead of XXX. Enum values are below.
Example : CallbackManagerImpl.RequestCodeOffset.Login.toRequestCode()

public enum RequestCodeOffset {
        Login(0),
        Share(1),
        Message(2),
        Like(3),
        GameRequest(4),
        AppGroupCreate(5),
        AppGroupJoin(6),
        AppInvite(7),
        DeviceShare(8),
        InAppPurchase(9),
        ;
}

Codes have brought from Facebook SDK v4.28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment