Skip to content

Commit

Permalink
Merge pull request #818 from Wizcorp/develop
Browse files Browse the repository at this point in the history
Update Master
  • Loading branch information
aogilvie committed Nov 27, 2014
2 parents 23c97f0 + 151feda commit d8b0f69
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 48 deletions.
32 changes: 32 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Contributing to PhoneGap Facebook Plugin

:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:

The following is a set of guidelines for contributing to the PhoneGap Facebook Connect Plugin.

These are just guidelines, not rules, use your best judgement and feel free to propose changes to this document in a pull request.

## Getting Help

Before creating a Github issue make sure you...

- Check the [Troubleshooting Guide](TROUBLESHOOTING.md) for well known issues.
- Search the [issues list](https://github.com/Wizcorp/phonegap-facebook-plugin/issues) for existing closed or still open issues
- Create a Github issue

#### Creating an Issue

When submitting an issue please add as much of the following information:

- Tell us what you expected to happen and what actually happened. ("It doesn't work" is **not** a solveable problem)
- Provide sample code so people can test and debug the problem.
- Provide `adb logcat` or Xcode console output.

Can you solve the problem yourself? If so see the next section on Pull Requests and send us the fix!!! <3

## Pull Requests

- Include screenshots and animated GIFs in your pull request whenever possible.
- Try to follow the [JavaScript](https://github.com/Wizcorp/javascript-styleguide/blob/master/README.md), [Objective-C](http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml) or [Java](https://google-styleguide.googlecode.com/svn/trunk/javaguide.html) style guides. Although these are just guides, please at least support continuety (that means **using 4 spaces please**).
- **Send your pull request to the develop branch.**
- If you can, provide sample testing code.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ For a more instructive example change the above `fbLoginSuccess` to;

### Getting a User's Birthday

Using the graph api this is a very simple task: [currently iOS only!]
Using the graph api this is a very simple task:

facebookConnectPlugin.api("<user-id>/?fields=id,email", ["user_birthday"],
function (result) {
Expand Down
49 changes: 48 additions & 1 deletion TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Troubleshooting

If you cannot solve your issue here please check the **existing issues** on Github, if you still cannot find a solution please [create an issue](https://github.com/Wizcorp/phonegap-facebook-plugin/issues).
Can't solve your issue here? Check the [existing issues](https://github.com/Wizcorp/phonegap-facebook-plugin/issues) on Github. If you still cannot find a solution please [create and issue after reading the contributing guide](CONTRIBUTING.md).

When creating a Github issue **remember to**:

Expand All @@ -19,6 +19,7 @@ When creating a Github issue **remember to**:
- [No Reply From Login?](#no-reply-from-login)
- [My Hash Does Not Work, I am Using Windows](#my-hash-does-not-work-i-am-using-windows)
- [Jar mismatch! Fix your dependencies](#jar-mismatch-fix-your-dependencies)
- [Open Fullscreen Dialog in Landscape Orientation](#open-fullscreen-dialog-in-landscape-orientation)

- [**iOS**](#ios)
- [Missing FacebookConnectPlugin](#missing-facebookconnectplugin)
Expand Down Expand Up @@ -126,6 +127,52 @@ BUILD FAILED
- Solution
- You may have duplicate android-support-v4.jar files. Remove android-support-v4.jar from the `/libs` folder of your project.

### Open Fullscreen Dialog in Landscape Orientation
- Problem:
- In landscape orientation the dialog is too small to use keyboard input

- Solution:
- One can force the dialog to be displayed fullscreen, providing additional screen space for the dialog

Add this import to `facebookConnectPlugin.java`

`import android.content.res.Configuration;`

Change the feed dialog from:

```
WebDialog feedDialog = (new WebDialog.FeedDialogBuilder(me.cordova.getActivity(), Session.getActiveSession(), paramBundle)).setOnCompleteListener(dialogCallback).build();
feedDialog.show();
```

to

```
WebDialog.FeedDialogBuilder feedDialog = (new WebDialog.FeedDialogBuilder(me.cordova.getActivity(), Session.getActiveSession(), paramBundle)).setOnCompleteListener(dialogCallback);
if (cordova.getActivity().getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
feedDialog.setTheme(android.R.style.Theme_Wallpaper_NoTitleBar_Fullscreen);
}
feedDialog.build().show();
```

Change the feed dialog from:

```
WebDialog requestsDialog = (new WebDialog.RequestsDialogBuilder(me.cordova.getActivity(), Session.getActiveSession(), paramBundle)).setOnCompleteListener(dialogCallback)
.build();
requestsDialog.show();
```

to

```
WebDialog.RequestsDialogBuilder requestsDialog = (new WebDialog.RequestsDialogBuilder(me.cordova.getActivity(), Session.getActiveSession(), paramBundle)).setOnCompleteListener(dialogCallback);
if (cordova.getActivity().getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
requestsDialog.setTheme(android.R.style.Theme_Wallpaper_NoTitleBar_Fullscreen);
}
requestsDialog.build().show();
```

## iOS
### Missing FacebookConnectPlugin
- Problem:
Expand Down
48 changes: 3 additions & 45 deletions platforms/android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,50 +30,8 @@ $ cordova platform add android
$ cordova -d plugin add /path/to/cloned/phonegap-facebook-plugin --variable APP_ID="123456789" --variable APP_NAME="myApplication"
```

## Setup with Eclipse
You can now use the plugin right away

**Android requires an additional step which is to reference the FacebookSDK project as a library to your project.**
## Setup with Eclipse (Removed)

Open your project in Eclipse (New > Project... Existing Android project from source), import everything (***see Img. 1***).

![image](./android_setup_1.png) ***Img. 1***

In Eclipse, right click your project folder in the left-had column. Select "Properties", select Android in the left column and in the right side of the window add FacebookSDK as a library (***see Img. 2***).

![image](./android_setup_2.png) ***Img. 2***


## Setup without Eclipse (just CLI)

Follow the steps below:

cordova create myApp

cd myApp/

cordova platform add android

cordova -d plugin add https://github.com/phonegap/phonegap-facebook-plugin.git --variable APP_ID="123456789" --variable APP_NAME="myApplication"

android update project --subprojects --path "platforms/android" --target android-19 --library "CordovaLib"

android update project --subprojects --path "platforms/android" --target android-19 --library "com.phonegap.plugins.facebookconnect/FacebookLib"

cd platforms/android/

ant clean

cd com.phonegap.plugins.facebookconnect/FacebookLib

ant clean

open -e AndroidManifest.xml

// change your minSdkVersion and your targetSdkVersion to your environment settings for me it was:
// <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" />

ant release

cd ../../..

cordova build android
** You no longer need the additional Eclipse steps. A custom_rules.xml file was added for configuring ANT properly.
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="com.phonegap.plugins.facebookconnect"
version="0.10.0">
version="0.10.1">

<name>Facebook Connect</name>

Expand Down

0 comments on commit d8b0f69

Please sign in to comment.