Shikhar13 / codenameone

Automatically exported from code.google.com/p/codenameone
0 stars 0 forks source link

RFE: Ability to create FaceBook notes #267

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I recently needed to include a feature in an app which enabled users to create 
notes and post it to FaceBook. Essentially, this is a slight modification to 
the code for creating FB posts. It would be a nice to have feature in 
codenameOne, then I could easily port the code from LWUI. 

I have reproduced the code for this feature below;

     /**
     * Post a note onto the users wall
     *
     * @param userId the userId
     * @param message the message to post
     */
    public void createNote(String userId, String subject, String message) throws IOException {
        checkAuthentication();

        FacebookRESTService con = new FacebookRESTService(token, userId, FacebookRESTService.NOTES, true);
        con.addArgument("subject","" + subject);
        con.addArgument("message", "" + message);
        if (slider != null) {
            SliderBridge.bindProgress(con, slider);
        }
        for (int i = 0; i < responseCodeListeners.size(); i++) {
            con.addResponseCodeListener((ActionListener) responseCodeListeners.elementAt(i));
        }
        current = con;        
        System.out.println(con.getUrl());
        NetworkManager.getInstance().addToQueueAndWait(con);
    }

  There was also an additional variable included in the FaceBookRestService class, show here;

    public static String NOTES = "notes";  

I hope the codenameOne team finds this suggestion useful.

Original issue reported on code.google.com by ba...@pledge51.com on 16 Jul 2012 at 4:05

GoogleCodeExporter commented 9 years ago
Assigning to Chen for evaluation

Original comment by shai.almog on 16 Jul 2012 at 7:22

GoogleCodeExporter commented 9 years ago
added this to the API, thanks.

Original comment by cf27...@gmail.com on 17 Jul 2012 at 11:58

GoogleCodeExporter commented 9 years ago

Original comment by cf27...@gmail.com on 17 Jul 2012 at 11:59