当前位置: 首页>>代码示例>>Java>>正文


Java Utility.getMetadataApplicationId方法代码示例

本文整理汇总了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);
        }
    });
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:33,代码来源:AppLinkData.java


示例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);
    }

}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:24,代码来源:LoginButton.java


示例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;
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:18,代码来源:LoginButton.java


示例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;
    }
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:28,代码来源:LoginButton.java


示例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();
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:34,代码来源:AppEventsLogger.java


示例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);
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:8,代码来源:FacebookDialog.java


示例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);
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:16,代码来源:WebDialog.java



注:本文中的com.facebook.internal.Utility.getMetadataApplicationId方法示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。