Facebook Post Score Crashing

M

Makom

Guest
Hi, I'm trying to post scores using facebook extension, but it crashes my app on android devices after the graph request. I'm using the follow code to do it and I have publish_action permissions:
Code:
        Map = ds_map_create();
        ds_map_add(Map, "score", 2);
        facebook_graph_request("me/scores", "POST", Map, -1);
         ds_map_destroy(Map);
Can anyone help me? The information I found about facebook scores is too poor for Game Maker...
 
A

Aura

Guest
Define the crash and post the complete code with context. You must have activated the Facebook API in the Global Game Settings and called the facebook_init() function before any of the Facebook functions can be used correctly. It is recommended that you visit the Facebook Developers page before starting to use these functions as a firm understanding of how the Facebook Graph works and the available calls and permissions is essential for you to get the most from these functions.
 
M

Makom

Guest
The app just stop responding and closes. When I observe the log file of debug in ADB server, they don't show anything besides blueprints informations of the device. The Facebook API is working, I can login, get profile name and pictures. I do understand how graph works, I just don't know if the syntax on GML is right.
Here is the code for Facebook login and ask for permissions:
On create:
Code:
permissions = ds_list_create(); 
ds_list_add(permissions,"public_profile");
alarm[0]=30;
Alarm[0]:
Code:
var fbStatus;
fbStatus = facebook_status();                                       
show_debug_message( "facebook status: " + fbStatus );
switch (fbStatus)                                         
{
case "AUTHORISED":                                                  
    global.Auth = true;
    ds_list_clear(permissions);
    if(!(facebook_check_permission("publish_actions") && facebook_check_permission("user_friends"))){
        ds_list_add(permissions,"publish_actions");
        ds_list_add(permissions,"user_friends");
        facebook_request_publish_permissions(permissions);
    }
    scr_savetoini("Facebook","logged",1);
    instance_destroy();
    break;   
case "IDLE":                                                        
    facebook_login(permissions, fb_login_default);
    global.AskedForLogin=true;
    alarm[0] = 30;
    break;   
case "FAILED":                                                      
    facebook_login(permissions, fb_login_default); 
    global.AskedForLogin=true; 
    alarm[0] = 30;
    break;   
case "DENIED":                                                      
    if !global.AskedForLogin
        {                                                           
        facebook_login(permissions, fb_login_default); alarm[0] = 30;     
        global.AskedForLogin = true;                         
        }
    else
        {
        instance_destroy();                                         
        }
    break;
   
default: alarm[0] = 30;                                             
}
Posting Score:
Code:
Map = ds_map_create();
        ds_map_add(Map, "score", 2);
        facebook_graph_request("me/scores", "POST", Map, -1);
         ds_map_destroy(Map);
 
Top