コード例 #1
0
void publish_story()
{
	LOGV("publish_story enter");
	Session *session = Session::getActiveSession();
	Bundle *postParams = new Bundle();
	postParams->putString(to_string("name"), to_string("Facebook SDK for Android"));
	postParams->putString(to_string("caption"), to_string("Build great social apps and get more installs."));
	postParams->putString(to_string("description"), to_string("The Facebook SDK for Android makes it easier and faster to develop Facebook integrated Android apps."));
    postParams->putString(to_string("link"), to_string("https://developers.facebook.com/android"));
    postParams->putString(to_string("picture"), to_string("https://raw.github.com/fbsamples/ios-3.x-howtos/master/Images/iossdk_logo.png"));
    Request *request = new Request(*session, to_string("me/feed"), *postParams, com_facebook_HttpMethod::POST, *requestCallback);
    std::vector<Request*> requests;
    requests.push_back(request); 
    RequestAsyncTask *task = new RequestAsyncTask(requests);
    std::vector<Object*> *args = 0;
    task->execute(*args);
    delete task;
    delete request;
    delete postParams;
    delete session;
    LOGV("publish_story exit");
}
コード例 #2
0
void run_fql_query(const char * query)
{
	LOGV("run_fql_query enter");
	String fqlQuery = to_string(query);
	Bundle *params = new Bundle();
	params->putString(to_string("q"), fqlQuery);
	Session *session = Session::getActiveSession();
	Request *request = new Request(*session, to_string("/fql"), *params, com_facebook_HttpMethod::GET, *requestCallback);
	List *requestBatch = new ArrayList();
	requestBatch->add(*request);
	Request::executeBatchAsync(*requestBatch);
	delete requestBatch;
	delete request;
	delete session;
	delete params;
	LOGV("run_fql_query exit");
}
コード例 #3
0
void FightPrepare::fight()
{
	if (mState != Prepare_State_Loaded)
	{
		CCAssert(false,"数据还没准备好,请确认调用了prepareData函数载入数据,并且是在prepareSuccess回调接口中调用的这个函数");
		return;
	}

	Bundle bundle;
	bundle.putBool("testMode",mTestMode);
	if (!mTestMode)
	{
		bundle.putString("JumpToWhenEnd","FightEndLayer");
	}
	
	// 直接换scene
	ClientFightLayer* layer = (ClientFightLayer*)GameDirector::getDirector()->fight(mPreparedDir_vec,mCallback->getBg(mTaskId,mGridIndex),bundle);
	GameDirector::getDirector()->hideWaiting();
	layer->setBeforeFightPro(beforeFightPro);
}