Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19577] Android: Update Facebook Module to support Facebook SDK 4.7.0

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-11-05T22:42:35.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.2.0
ComponentsAndroid
Labelsfacebook, facebookSDK, notable
ReporterChee Kiat Ng
AssigneeAshraf Abu
Created2015-09-25T02:52:39.000+0000
Updated2018-10-10T16:30:03.000+0000

Description

Facebook SDK has been updated to 4.7.0. Have to look at updating our module to support this.

Comments

  1. Ashraf Abu 2015-10-22

    Updated Facebook API to 4.7. Bumped fb titanium module Android to 5.0.0. KitchenSink PR:https://github.com/appcelerator/KitchenSink/pull/80 Facebook PR:https://github.com/appcelerator-modules/ti.facebook/pull/30

    Facebook Test User Accounts

    ||User name||User email|| |David Alajdbbcdajgf Greeneman|yuwagqj_greeneman_1444623211@tfbnw.net| |Barbara Alajeaccejfhc Carrierosky|xpgcjkg_carrierosky_1444623190@tfbnw.net| |Patricia Alajcfcffdcie Lausen|mtfzvmr_lausen_1444623189@tfbnw.net| All passwords are titaniumLion (Thanks to [~cng] for the Testing accounts)

    Steps to test

    1. install facebook Module, you can get it from here if you don't want to build it (https://gist.github.com/ashcoding/4d3eae3877fcb3278ff5/raw/9e59582682bfb44b4b8d255edd5f88258f1bec93/facebook-android-5.0.0.zip) 2. Run it with titanium SDK > 5.0 on KitchenSink (PR above). The KitchenSink tiapp.xml has been configured with a new Facebook app where the test users indicated can be used 3. Test everything in mashups/facebook PR for Titanium SDK master branch will come after this has been reviewed.
  2. Ashraf Abu 2015-11-06

    PR merged and module added to release page in github https://github.com/appcelerator-modules/ti.facebook/releases
  3. Hieu Pham 2015-11-12

    master backport: https://github.com/appcelerator/KitchenSink/pull/82
  4. Ashraf Abu 2015-11-13

    PR https://github.com/appcelerator/KitchenSink/pull/82 was into stable. It was merged. Still requires a PR into master branch. Seems like the default branch for Kitchen Sink is to Stable branch.
  5. Ashraf Abu 2015-12-09

    Master PR Titanium Mobile (5_2_0): https://github.com/appcelerator/titanium_mobile/pull/7562
  6. Ashraf Abu 2015-12-09

    Master PR merged.
  7. Lokesh Choudhary 2016-02-04

    [~msamah], I get warnings below after I run the Read Stream test in KS/Facebook with the instructions mentioned by [~cng] above:
       [DEBUG] :  D/com.facebook.GraphRequestAsyncTask: execute async task: {RequestAsyncTask:  connection: null, requests: [{Request:  accessToken: {AccessToken token:ACCESS_TOKEN_REMOVED permissions:[public_profile, contact_email, publish_actions, email, user_managed_groups]}, graphPath: me/groups, graphObject: null, httpMethod: GET, parameters: Bundle[{}]}]}
       [WARN] :   W/FacebookSDK.Request: starting with Graph API v2.4, GET requests for /me/groups should contain an explicit "fields" parameter.
       [WARN] :   W/System.err: java.lang.Exception
       [WARN] :   W/System.err: 	at com.facebook.internal.Logger.log(Logger.java:92)
       [WARN] :   W/System.err: 	at com.facebook.internal.Logger.log(Logger.java:77)
       [WARN] :   W/System.err: 	at com.facebook.GraphRequest.validateFieldsParamForGetRequests(GraphRequest.java:1648)
       [WARN] :   W/System.err: 	at com.facebook.GraphRequest.toHttpConnection(GraphRequest.java:1039)
       [WARN] :   W/System.err: 	at com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1147)
       [WARN] :   W/System.err: 	at com.facebook.GraphRequestBatch.executeAndWaitImpl(GraphRequestBatch.java:252)
       [WARN] :   W/System.err: 	at com.facebook.GraphRequestBatch.executeAndWait(GraphRequestBatch.java:201)
       [WARN] :   W/System.err: 	at com.facebook.GraphRequestAsyncTask.doInBackground(GraphRequestAsyncTask.java:169)
       [WARN] :   W/System.err: 	at com.facebook.GraphRequestAsyncTask.doInBackground(GraphRequestAsyncTask.java:1)
       [WARN] :   W/System.err: 	at android.os.AsyncTask$2.call(AsyncTask.java:295)
       [WARN] :   W/System.err: 	at java.util.concurrent.FutureTask.run(FutureTask.java:237)
       [WARN] :   W/System.err: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
       [WARN] :   W/System.err: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
       [WARN] :   W/System.err: 	at java.lang.Thread.run(Thread.java:818)
       
    Also, I don't see any results.
  8. Hans Knöchel 2016-02-05

    Looks like [this line](https://github.com/appcelerator-modules/ti.facebook/blob/master/android/src/facebook/TiFacebookModule.java#L213) needs to be formatted as stated [here](http://stackoverflow.com/a/29324162/5537752) to contain the fields key.
  9. Ashraf Abu 2016-02-05

    I'm using KitchenSink stable with https://github.com/appcelerator-modules/ti.facebook/releases/tag/android-5.0.0 that uses Facebook SDK 4.7.0 and do not face that problem.
  10. Lokesh Choudhary 2016-02-05

    [~msamah], What I saw: 1. Used KS from the PR in Kiat's comment : https://github.com/appcelerator/KitchenSink/pull/80 with 5.0.0 FB module :https://github.com/appcelerator-modules/ti.facebook/releases/tag/android-5.0.0 --- I see the warnings. 2. Used stable KS : https://github.com/appcelerator/KitchenSink/tree/stable with 5.0.0 FB module : https://github.com/appcelerator-modules/ti.facebook/releases/tag/android-5.0.0--- Ks crashes when clicked on "login with FB". 3. Used master KS : https://github.com/appcelerator/KitchenSink/tree/master with 5.0.0 FB module: https://github.com/appcelerator-modules/ti.facebook/releases/tag/android-5.0.0 --- Ks crashes when clicked on "login with FB". Is there any other version? Can you give me a link for KS version you used ?
  11. Ashraf Abu 2016-02-05

    [~lchoudhary] Please use stable branch and have this in tiappxml:
            <android xmlns:android="http://schemas.android.com/apk/res/android">
                <manifest>
                    <application>
                        <activity android:alwaysRetainTaskState="true"
                            android:configChanges="keyboardHidden|orientation"
                            android:label="KitchenSink"
                            android:name=".KitchensinkActivity" android:theme="@style/Theme.Titanium">
                            <intent-filter>
                                <action android:name="android.intent.action.MAIN"/>
                                <category android:name="android.intent.category.LAUNCHER"/>
                            </intent-filter>
                        </activity>
                        <activity
                            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
                            android:label="KitchenSinkFacebook"
                            android:name="com.facebook.FacebookActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
                        <activity android:label="KitchenSinkFacebook"
                            android:name="com.facebook.LoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
                        <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id"/>
                    </application>
                    <uses-sdk android:targetSdkVersion="23"/>
                </manifest>
                <activity android:name="ti.modules.titanium.ui.android.TiPreferencesActivity"/>
                <services>
                    <service type="interval" url="testservice.js"/>
                </services>
            </android>
        
  12. Ashraf Abu 2016-02-05

    PR to update this manifest: https://github.com/appcelerator/KitchenSink/pull/88
  13. Ashraf Abu 2016-02-05

    PR updated to use user_managed_groups
  14. Lokesh Choudhary 2016-02-05

    Cool [~msamah]
  15. Lokesh Choudhary 2016-02-09

    Verified the implementation. Checked by running KS/mashups/facebook tests in KS stable. Closing. Environment: Appc Studio : 4.5.0.201602070910 Ti SDK : 5.2.0.v20160208101502 Ti CLI : 5.0.6 Alloy : 1.7.33 MAC Yosemite : 10.10.5 Appc NPM : 4.2.3-2 Appc CLI : 5.2.0-249 Node: 4.2.2 Nexus 6P - Android 6.0.1

JSON Source