Esempio n. 1
0
    $templateParameters = array('content' => 'Test notification content from php sdk', 'button0_surface' => 'canvas', 'button0_label' => 'Go To App Canvas', 'button1_surface' => 'appProfile', 'button1_label' => 'Go To App Profile');
    $rc = $ms->sendNotification('129910', '454304609,28568917', $templateParameters, 'http://api.myspace.com/v1/users/296768296');
    echo '<br><br>sendNotification returned ' . $rc;
    $profileInfo = $ms->getProfile($userId);
    displayProfileInfo($profileInfo);
    $albumInfo = $ms->getAlbumInfo($userId, "817520");
    displayAlbumInfo($albumInfo);
    $appData = $ms->getGlobalAppData();
    displayObject($appData, "appData");
    $ms->putGlobalAppData(array('animal' => 'giraffe', 'plant' => 'rose', 'mineral' => 'sandstone'));
    sleep(3);
    $appData = $ms->getGlobalAppData();
    displayObject($appData, "appData");
    $appData = $ms->getGlobalAppData('animal;plant');
    displayObject($appData, "appData for only animal and plant");
    $ms->clearGlobalAppData('animal;mineral');
    sleep(3);
    $appData = $ms->getGlobalAppData();
    displayObject($appData, "appData");
}
function displayObject($obj, $name)
{
    print '<b>' . $name . ' = </b>';
    print_r($obj);
    print '<br/>';
}
function displayAlbumInfo($albumInfo)
{
    $s = "album info:";
    $s .= "ID: " . $albumInfo->id;
    $s .= "Title: " . $albumInfo->title . "<br>";