本文整理汇总了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;
}
}
示例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());
}
}