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


Java AppStore类代码示例

本文整理汇总了Java中com.linkedin.platform.internals.AppStore的典型用法代码示例。如果您正苦于以下问题:Java AppStore类的具体用法?Java AppStore怎么用?Java AppStore使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AppStore类属于com.linkedin.platform.internals包,在下文中一共展示了AppStore类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: openOtherProfile

import com.linkedin.platform.internals.AppStore; //导入依赖的package包/类
/**
 * opens a view which shows the profile of the given member
 * @param activity
 * @param memberId obtained through an api call
 * @param callback
 */
public void openOtherProfile(@NonNull Activity activity, String memberId, DeepLinkListener callback) {
    this.deepLinkListener = callback;

    LISession session = LISessionManager.getInstance(activity.getApplicationContext()).getSession();
    if (!session.isValid()) {
        callback.onDeepLinkError(new LIDeepLinkError(LIAppErrorCode.NOT_AUTHENTICATED, "there is no access token"));
        return;
    }
    try {
        if (!LIAppVersion.isLIAppCurrent(activity)) {
            AppStore.goAppStore(activity, true);
            return;
        }
        deepLinkToProfile(activity, memberId, session.getAccessToken());
    } catch (ActivityNotFoundException e) {
        callback.onDeepLinkError(new LIDeepLinkError(LIAppErrorCode.LINKEDIN_APP_NOT_FOUND,
                "LinkedIn app needs to be either installed or` updated"));
        deepLinkListener = null;
    }
}
 
开发者ID:neurospeech,项目名称:unofficial-linkedin-sdk-android,代码行数:27,代码来源:DeepLinkHelper.java

示例2: init

import com.linkedin.platform.internals.AppStore; //导入依赖的package包/类
/**
 * Brings the user to an authorization screen which allows the user to authorize
 * the application to access their LinkedIn data.  When the user authorizes the application
 * {@link com.linkedin.platform.listeners.AuthListener#onAuthSuccess()} is called.
 * If the user has previously authorized the application, onAuthSuccess will be called without
 * the authorization screen being shown.
 *
 * If there is no user logged into the LinkedIn application, the user will be prompted to login
 * to LinkedIn, after which the authorization screen will be shown.
 *
 * Either this method or {@link com.linkedin.platform.LISessionManager#init(AccessToken)} must be
 * called before the application can make API calls or DeepLink calls.
 *
 * @param activity               activity to return to after initialization
 * @param scope                  The type of LinkedIn data that for which access is requested.
 *                               see {@link com.linkedin.platform.utils.Scope}
 * @param callback               listener to execute on completion
 * @param showGoToAppStoreDialog determines behaviour when the LinkedIn app is not installed
 *                               if true, a dialog is shown which prompts the user to install
 *                               the LinkedIn app via the app store.  If false, the user is
 *                               taken directly to the app store.
 *
 */
public void init(Activity activity,
                 Scope scope, AuthListener callback, boolean showGoToAppStoreDialog) {
    //check if LI
    if (!LIAppVersion.isLIAppCurrent(ctx)) {
        AppStore.goAppStore(activity, showGoToAppStoreDialog);
        return;
    }
    authListener = callback;
    Intent i = new Intent();
    i.setClassName(LI_APP_PACKAGE_NAME, LI_APP_AUTH_CLASS_NAME);
    i.putExtra(SCOPE_DATA, scope.createScope());
    i.setAction(LI_APP_ACTION_AUTHORIZE_APP);
    i.addCategory(LI_APP_CATEGORY);
    try {
        activity.startActivityForResult(i, LI_SDK_AUTH_REQUEST_CODE);
    } catch (ActivityNotFoundException e) {
        Log.d(TAG, e.getMessage());
    }
}
 
开发者ID:neurospeech,项目名称:unofficial-linkedin-sdk-android,代码行数:43,代码来源:LISessionManager.java


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