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

Add Facebook-App-ID persistent for Android #67

Open
hirbod opened this issue Feb 26, 2015 · 1 comment
Open

Add Facebook-App-ID persistent for Android #67

hirbod opened this issue Feb 26, 2015 · 1 comment

Comments

@hirbod
Copy link

hirbod commented Feb 26, 2015

Dear @koraybalci,

how did you enter your Facebook AppID for Android?
iOS was no problem at all, but the explanation for Android https://developers.facebook.com/docs/android/getting-started is confusing and I never found a way to implement it (need to change something in AndroidManifest + res/values/strings.xml)

But strings.xml will be overwritten everytime I do a build or run in cordova-cli.

Nontheless, the APP works fine without it but I think that maybe my Android 5 issues are related to the missing APP-ID. Could you show me your files (of course with censored ID) and how you add them persistent? Thank you very much!

The official Facebook Plugin has a custom.xml file (and they are using --variable method and generating automatic there own facebook.xml, with custom_rules.xml or something) https://github.com/Wizcorp/phonegap-facebook-plugin/blob/master/platforms/android/README.md

@hirbod
Copy link
Author

hirbod commented Feb 26, 2015

Ok, for now, I've found a simple way. Seems like cordova automatically import custom.xml files inside of that res/values/ folder.

Just created a facebookconnect.xml

with

<?xml version='1.0' encoding='utf-8'?>
<resources>
    <string name="fb_app_id">1234566</string>
    <string name="fb_app_name">MyAppName</string>
</resources>

And inside of my AndroidManifest.xml inside of Application

        <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/fb_app_id" />
        <activity android:label="@string/fb_app_name" android:name="com.facebook.LoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" />

This will break on an update, but for now, it's fine. But it seems it isn't that hard to

a) Include Facebook-Lib automatically as reference (currently very annoying doing with eclipse)
b) Change plugin.xml to Accept APP_ID and APP_NAME. There is also a PR for iOS, and Android is quite easy, too. Just need to define a custom.xml and do a little bit of config.

https://github.com/Wizcorp/phonegap-facebook-plugin/blob/master/plugin.xml

I like this plugin very much, but it will just be perfect when installation is also made with some variables instead of config trough XCode and Eclipse.

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

No branches or pull requests

2 participants