Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support applicationId prefixed with "fb" #435

Merged
merged 3 commits into from Jul 16, 2015
Merged

Support applicationId prefixed with "fb" #435

merged 3 commits into from Jul 16, 2015

Conversation

nodrock
Copy link
Contributor

@nodrock nodrock commented Jul 14, 2015

It would be great to have opportunity to force applicationId to be string. Otherwise if you specify applicationId directly through Android manifest (not through constant in strings.xml file) it will overflow to 32-bit int instead of string. I suggest to support also applicationIds with prefix "fb" which will ensure that it will be parsed to string correctly. It will be also similar to CFBundleURLSchemes in iOS version of SDK which is also prefixed by "fb".

…flow of applicationId in Android manifest file
@swiese
Copy link
Contributor

swiese commented Jul 15, 2015

Hi nodrock thanks for your pull request and for bringing to light the issue with the integer overflow for app ids. Currently our recommended method, and Google's, for dealing with longs in the config is to place the long in a string resource file like we do for our samples.
https://github.com/facebook/facebook-android-sdk/blob/master/samples/Scrumptious/AndroidManifest.xml#L60

But I like your idea of the fb though to match our iOS SDK.

Do you also want to remove the attempt to parse the ID as an Integer since its unlikely that AppIds will fit in a 32 bit int?

@nodrock
Copy link
Contributor Author

nodrock commented Jul 16, 2015

Yes I read the recommended method, but I cannot apply it in my project, because I don't have access to resource files only to part of manifest file. I work on open source project to provide Facebook SDK for Adobe Air applications as native extension and I would like to provide easy way to set ApplicationId in manifest file not only through code.

Anyway, I agree there is no sense in leaving there code for 32bit ints so I will change the request to:

...
if (applicationId == null) {
  applicationId = ai.metaData.getString(APPLICATION_ID_PROPERTY);
  if(applicationId != null && applicationId.startsWith("fb")){
    applicationId = applicationId.substring(2);
  }
}
...

swiese added a commit that referenced this pull request Jul 16, 2015
Support applicationId prefixed with "fb"
@swiese swiese merged commit 39c39ef into facebook:dev Jul 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants