Skip to content
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.

Facebook Network issues #28

Open
vaibhavb24 opened this issue Jul 8, 2013 · 6 comments
Open

Facebook Network issues #28

vaibhavb24 opened this issue Jul 8, 2013 · 6 comments

Comments

@vaibhavb24
Copy link

Hello everyone,

i am using FacebookBlackBerrySDK-v0.8.25.jar for post status but this is working on wifi connection but not working on sim network please give me any solutions for this problem immediately............

@timwindsor
Copy link
Contributor

Are you running the MDS Simulator? Have you tried setting up a Wifi Network on the SIM?

@vaibhavb24
Copy link
Author

Hello
it's working on simulator and device with wifi Network but i 'm using sim network then not working

@vaibhavb24
Copy link
Author

Hello timwindsor,
please check my code and give me solutions

import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.component.ButtonField;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.container.MainScreen;
import com.blackberry.facebook.ApplicationSettings;
import com.blackberry.facebook.Facebook;
import com.blackberry.facebook.inf.Profile;
import com.blackberry.facebook.inf.User;

public class MyScreen extends MainScreen
{

private User user;
String NEXT_URL = "http://www.facebook.com/connect/login_success.html";

String APPLICATION_ID = "xxxxxxxxxxxx";
String APPLICATION_SECRET = "xxxxxxxxxxxxxxxxxx";
String[] PERMISSIONS = Facebook.Permissions.ALL_PERMISSIONS;
private Facebook fb;
private ApplicationSettings as;
Profile profile;
ButtonField send;



public MyScreen()
{
    send=new ButtonField("send",ButtonField.CONSUME_CLICK);
    send.setChangeListener(new FieldChangeListener() {

        public void fieldChanged(Field field, int context) {
            // TODO Auto-generated method stub

            FBPost();

        }
    });

    add(send);

}

// FBpost calling
private void FBPost() {

    ApplicationSettings as = new ApplicationSettings(NEXT_URL,
            APPLICATION_ID, APPLICATION_SECRET, PERMISSIONS);

    Facebook fb = Facebook.getInstance(as);

    try {

        user = fb.getCurrentUser();

        String result = user.publishStatus("hi test fb2");

        if ((result != null) && !result.trim().equals("")) {
            Dialog.inform("Publish Success.");

        } else {
            Dialog.inform("Publish Failed.");

        }
    } catch (Exception e) {
        // TODO: handle exception
        e.printStackTrace();
    }

}

}

@boogie4eva
Copy link

I think i have done this before , what you need to do is download the source of the sdk and modify the connection access code to use your own connection class .

@timwindsor
Copy link
Contributor

For use with a sim network, you'll need to use the MDS Simulator. Or modify the connection code cause it's likely trying to use MDS for the network transport, which will fail on the simulator without MDS Sim running.

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

No branches or pull requests

4 participants
@timwindsor @boogie4eva @vaibhavb24 and others