本文整理匯總了Java中com.facebook.internal.Utility.getMetadataApplicationId方法的典型用法代碼示例。如果您正苦於以下問題:Java Utility.getMetadataApplicationId方法的具體用法?Java Utility.getMetadataApplicationId怎麽用?Java Utility.getMetadataApplicationId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.facebook.internal.Utility
的用法示例。
在下文中一共展示了Utility.getMetadataApplicationId方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: fetchDeferredAppLinkData
import com.facebook.internal.Utility; //導入方法依賴的package包/類
/**
* Asynchronously fetches app link information that might have been stored for use after
* installation of the app
*
* @param context The context
* @param applicationId Facebook application Id. If null, it is taken from the manifest
* @param completionHandler CompletionHandler to be notified with the AppLinkData object or null
* if none is available. Must not be null.
*/
public static void fetchDeferredAppLinkData(
Context context,
String applicationId,
final CompletionHandler completionHandler) {
Validate.notNull(context, "context");
Validate.notNull(completionHandler, "completionHandler");
if (applicationId == null) {
applicationId = Utility.getMetadataApplicationId(context);
}
Validate.notNull(applicationId, "applicationId");
final Context applicationContext = context.getApplicationContext();
final String applicationIdCopy = applicationId;
FacebookSdk.getExecutor().execute(new Runnable() {
@Override
public void run() {
fetchDeferredAppLinkFromServer(
applicationContext, applicationIdCopy, completionHandler);
}
});
}
示例2: checkNuxSettings
import com.facebook.internal.Utility; //導入方法依賴的package包/類
private void checkNuxSettings() {
if (nuxMode == ToolTipMode.DISPLAY_ALWAYS) {
String nuxString = getResources().getString(R.string.com_facebook_tooltip_default);
displayNux(nuxString);
} else {
// kick off an async request
final String appId = Utility.getMetadataApplicationId(getContext());
AsyncTask<Void, Void, FetchedAppSettings> task = new AsyncTask<Void, Void, Utility.FetchedAppSettings>() {
@Override
protected FetchedAppSettings doInBackground(Void... params) {
FetchedAppSettings settings = Utility.queryAppSettings(appId, false);
return settings;
}
@Override
protected void onPostExecute(FetchedAppSettings result) {
showNuxPerSettings(result);
}
};
task.execute((Void[])null);
}
}
示例3: initializeActiveSessionWithCachedToken
import com.facebook.internal.Utility; //導入方法依賴的package包/類
private boolean initializeActiveSessionWithCachedToken(Context context) {
if (context == null) {
return false;
}
Session session = Session.getActiveSession();
if (session != null) {
return session.isOpened();
}
String applicationId = Utility.getMetadataApplicationId(context);
if (applicationId == null) {
return false;
}
return Session.openActiveSessionFromCache(context) != null;
}
示例4: checkToolTipSettings
import com.facebook.internal.Utility; //導入方法依賴的package包/類
private void checkToolTipSettings() {
switch (toolTipMode) {
case AUTOMATIC:
// kick off an async request
final String appId = Utility.getMetadataApplicationId(getContext());
FacebookSdk.getExecutor().execute(new Runnable() {
@Override
public void run() {
final FetchedAppSettings settings = Utility.queryAppSettings(appId, false);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
showToolTipPerSettings(settings);
}
});
}
});
break;
case DISPLAY_ALWAYS:
String toolTipString = getResources().getString(
R.string.com_facebook_tooltip_default);
displayToolTip(toolTipString);
break;
case NEVER_DISPLAY:
break;
}
}
示例5: AppEventsLogger
import com.facebook.internal.Utility; //導入方法依賴的package包/類
/**
* Constructor is private, newLogger() methods should be used to build an instance.
*/
private AppEventsLogger(Context context, String applicationId, AccessToken accessToken) {
Validate.notNull(context, "context");
this.contextName = Utility.getActivityName(context);
if (accessToken == null) {
accessToken = AccessToken.getCurrentAccessToken();
}
// If we have a session and the appId passed is null or matches the session's app ID:
if (accessToken != null &&
(applicationId == null || applicationId.equals(accessToken.getApplicationId()))
) {
accessTokenAppId = new AccessTokenAppIdPair(accessToken);
} else {
// If no app ID passed, get it from the manifest:
if (applicationId == null) {
applicationId = Utility.getMetadataApplicationId(context);
}
accessTokenAppId = new AccessTokenAppIdPair(null, applicationId);
}
synchronized (staticLock) {
if (applicationContext == null) {
applicationContext = context.getApplicationContext();
}
}
initializeTimersIfNeeded();
}
示例6: Builder
import com.facebook.internal.Utility; //導入方法依賴的package包/類
Builder(Activity activity) {
Validate.notNull(activity, "activity");
this.activity = activity;
applicationId = Utility.getMetadataApplicationId(activity);
appCall = new PendingCall(NativeProtocol.DIALOG_REQUEST_CODE);
}
示例7: BuilderBase
import com.facebook.internal.Utility; //導入方法依賴的package包/類
protected BuilderBase(Context context, String action) {
Session activeSession = Session.getActiveSession();
if (activeSession != null && activeSession.isOpened()) {
this.session = activeSession;
} else {
String applicationId = Utility.getMetadataApplicationId(context);
if (applicationId != null) {
this.applicationId = applicationId;
} else {
throw new FacebookException("Attempted to create a builder without an open" +
" Active Session or a valid default Application ID.");
}
}
finishInit(context, action, null);
}