From b84ed08d9d5444eb24e93a63cbdbc0239099a50a Mon Sep 17 00:00:00 2001 From: "Ashraf A. S" Date: Thu, 12 Mar 2015 10:28:58 +0800 Subject: [PATCH 1/3] [MOD-2104] Like button default values causing errors --- android/src/facebook/LikeButtonProxy.java | 6 +++--- android/src/facebook/LikeButtonView.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/src/facebook/LikeButtonProxy.java b/android/src/facebook/LikeButtonProxy.java index 53e97196..57367611 100644 --- a/android/src/facebook/LikeButtonProxy.java +++ b/android/src/facebook/LikeButtonProxy.java @@ -31,9 +31,9 @@ public class LikeButtonProxy extends TiViewProxy public LikeButtonProxy() { super(); - defaultValues.put("likeViewStyle", Style.STANDARD); - defaultValues.put("auxiliaryViewPosition", AuxiliaryViewPosition.BOTTOM); - defaultValues.put("horizontalAlignment", HorizontalAlignment.CENTER); + defaultValues.put("likeViewStyle", "standard"); + defaultValues.put("auxiliaryViewPosition", "bottom"); + defaultValues.put("horizontalAlignment", "center"); Log.d(TAG, "[VIEWPROXY LIFECYCLE EVENT] init"); } diff --git a/android/src/facebook/LikeButtonView.java b/android/src/facebook/LikeButtonView.java index 8f72caf8..0dec7270 100644 --- a/android/src/facebook/LikeButtonView.java +++ b/android/src/facebook/LikeButtonView.java @@ -43,7 +43,7 @@ public LikeButtonView(TiViewProxy proxy) private void setLikeViewStyle(String name) { for(Style style : Style.values()) { - if (style.toString().equals(name)) { + if (style.toString().equalsIgnoreCase(name)) { likeView.setLikeViewStyle(style); break; } @@ -52,7 +52,7 @@ private void setLikeViewStyle(String name) { private void setAuxiliaryViewPosition(String name) { for(AuxiliaryViewPosition avp : AuxiliaryViewPosition.values()) { - if (avp.toString().equals(name)) { + if (avp.toString().equalsIgnoreCase(name)) { likeView.setAuxiliaryViewPosition(avp); break; } @@ -61,7 +61,7 @@ private void setAuxiliaryViewPosition(String name) { private void setHorizontalAlignment(String name) { for(HorizontalAlignment ha : HorizontalAlignment.values()) { - if (ha.toString().equals(name)) { + if (ha.toString().equalsIgnoreCase(name)) { likeView.setHorizontalAlignment(ha); break; } From c4bff1db6e039a6576f7d402e31c86b5d1cc2265 Mon Sep 17 00:00:00 2001 From: "Ashraf A. S" Date: Thu, 12 Mar 2015 10:49:02 +0800 Subject: [PATCH 2/3] [MOD-2105] Fixing Android requestPermissions --- android/src/facebook/TiFacebookModule.java | 32 ++-------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/android/src/facebook/TiFacebookModule.java b/android/src/facebook/TiFacebookModule.java index f03d8d8f..8b1e7c48 100644 --- a/android/src/facebook/TiFacebookModule.java +++ b/android/src/facebook/TiFacebookModule.java @@ -746,40 +746,14 @@ public void onComplete(Bundle values, } }); } - - @Kroll.method - public void requestNewReadPermissions(String[] permissions, final KrollFunction callback) { - requestNewReadPermissions(permissions, AUDIENCE_EVERYONE, callback); - } @Kroll.method - public void requestNewReadPermissions(String[] permissions, int audienceChoice, final KrollFunction callback) { - SessionDefaultAudience audience; - switch(audienceChoice){ - case TiFacebookModule.AUDIENCE_NONE: - audience = SessionDefaultAudience.NONE; - break; - case TiFacebookModule.AUDIENCE_ONLY_ME: - audience = SessionDefaultAudience.ONLY_ME; - break; - case TiFacebookModule.AUDIENCE_FRIENDS: - audience = SessionDefaultAudience.FRIENDS; - break; - default: - case TiFacebookModule.AUDIENCE_EVERYONE: - audience = SessionDefaultAudience.EVERYONE; - break; - } + public void requestNewReadPermissions(String[] permissions, final KrollFunction callback) { permissionCallback = callback; Session.getActiveSession().requestNewReadPermissions( - new NewPermissionsRequest(TiApplication.getInstance().getCurrentActivity(), Arrays.asList(permissions)).setDefaultAudience(audience)); - } - - @Kroll.method - public void requestNewPublishPermissions(String[] permissions, final KrollFunction callback) { - requestNewPublishPermissions(permissions, AUDIENCE_EVERYONE, callback); + new NewPermissionsRequest(TiApplication.getInstance().getCurrentActivity(), Arrays.asList(permissions))); } - + @Kroll.method public void requestNewPublishPermissions(String[] permissions, int audienceChoice, final KrollFunction callback) { SessionDefaultAudience audience; From 1f8d945c7fd0242bbecc37b780eb56a8d8dbf396 Mon Sep 17 00:00:00 2001 From: "Ashraf A. S" Date: Thu, 12 Mar 2015 10:52:17 +0800 Subject: [PATCH 3/3] [MOD-2105] Updating Docs --- apidoc/Facebook.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/apidoc/Facebook.yml b/apidoc/Facebook.yml index a53bbccf..cc6c732a 100644 --- a/apidoc/Facebook.yml +++ b/apidoc/Facebook.yml @@ -400,11 +400,6 @@ methods: [official Facebook Permissions Reference](https://developers.facebook.com/docs/facebook-login/permissions/v2.2) type: Array - - name: audience - summary: | - The extent of the visibility read permissions will have. The value of audience should be one of [AUDIENCE_NONE](Modules.Facebook.AUDIENCE_NONE), - [AUDIENCE_ONLY_ME](Modules.Facebook.AUDIENCE_ONLY_ME), [AUDIENCE_FRIENDS](Modules.Facebook.AUDIENCE_FRIENDS), or [AUDIENCE_EVERYONE](Modules.Facebook.AUDIENCE_EVERYONE). - type: Number - name: callback summary: Callback to invoke when the request completes. type: Callback