[MOD-2203] Facebook: Module should inject tiapp.xml requirements for user
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 5.2.0 |
Fix Version/s | n/a |
Components | |
Labels | n/a |
Reporter | Fokke Zandbergen |
Assignee | Unknown |
Created | 2016-03-02T10:17:19.000+0000 |
Updated | 2018-03-06T18:52:39.000+0000 |
Description
To use the Facebook module the user has to add a whole set of properties totiapp.xml
:
http://docs.appcelerator.com/platform/latest/#!/api/Modules.Facebook
However, except for maybe those that depend on the linked Facebook app (ID, name) all of this should be injected by the module itself using the timodule.xml
.
Comments
- Hans Knöchel 2016-03-02
{quote}
Right now, the timodule.xml is only used in Android, and it supports all of the tags listed in the Android section above. Any custom metadata your Android module defines in it's timodule.xml
section will automatically be merged with a Titanium application that installs your module. {quote} http://docs.appcelerator.com/platform/latest/#!/guide/tiapp.xml_and_timodule.xml_Reference-section-29004921_tiapp.xmlandtimodule.xmlReference-timodule.xml That's why it's currently not implemented. - Fokke Zandbergen 2016-03-02 So for Android we could still do this right?
- Hans Knöchel 2016-03-02 Yes, but there are no android-specific manifest settings required by ti.facebook as far as I know.
- Fokke Zandbergen 2016-03-02
We do at http://docs.appcelerator.com/platform/latest/#!/api/Modules.Facebook :
<ti:app> <android xmlns:android="http://schemas.android.com/apk/res/android"> <manifest> <application> <activity android:label="@string/app_name" android:name="com.facebook.LoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/> <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/> </application> </manifest> </android> <ti:app>
- Hans Knöchel 2016-03-02 But those are user-specific values that we cannot pre-fill. :-) Tell me that exactly can be added and I'll add it. Simple as that.
- Fokke Zandbergen 2016-03-02
They are not user-specific. The only user-specific thing is the value of
@string/facebook_app_id
which you set viastrings.xml
. See the linked doc. - Hans Knöchel 2016-03-09
PR: https://github.com/appcelerator-modules/ti.facebook/pull/44
We need to ensure the values get merged with the values set in the
tiapp.xml
correctly. - Fokke Zandbergen 2016-03-09 Well, there's one way to find out ;)
- Chris Barber 2016-03-09
As stated on Flowdock, the
timodule.xml
andtiapp.xml
are not merged and nor will they ever be. Only in the Android builds will thetimodule.xml
's<application><android><manifest>
be scrubbed and merged with the finalAndroidManifest.xml
. I'm not sold that setting the@string/facebook_app_id
viastrings.xml
is a good idea. First it's Android only. Second we should have all settings in one place, namely thetiapp.xml
. Since this is a module, it must not modify the Titanium app. The module's documentation should be clear as to what settings the user must add to thetiapp.xml
. - Fokke Zandbergen 2016-03-10 [~cbarber] we actually do the same with modules like [ti.map](https://github.com/appcelerator-modules/ti.map/blob/master/android/timodule.xml) and it's much more user friendly (and less likely to give errors) then letting the user add those. I agree it shouldn't use string though. Just like the linked ti.map it should refer to a tiapp property.
- Fokke Zandbergen 2016-03-10 Plus.. iOS modules should be able to do the same: TIMOB-20542
- Hans Knöchel 2016-04-17 Removing from review, since it's currently not technically possible to inject it properly.