Could not open linkedIn app with (company profile) url by another android app?

五迷三道 提交于 2019-12-31 00:45:41

问题


i want to open a url from my app, that is "http://www.linkedin.com/company/company-name", If LinkedIn app is installed, need to launch the app. Otherwise, open the url by launch a browser. My code is like below `

public void launchLinkedIn()
 {
        final String urlFb = "linkedin://" + pageId;
        Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setData(Uri.parse(urlFb));

        final PackageManager packageManager = activity.getPackageManager();
        List<ResolveInfo> list = packageManager.queryIntentActivities(intent,
                PackageManager.MATCH_DEFAULT_ONLY);

        if (list.size() == 0) {
            final String urlBrowser = "http://www.linkedin.com/company/" + pageId;
            intent.setData(Uri.parse(urlBrowser));
        }
        activity.startActivity(intent);
    }

`

Now this code is invoke directly to browse even i have linkedin app.. Please help anyone for me. Thanks in advance.


回答1:


I know that this is a few months ago, but I'm running into the same issue at the moment

After using APKTool to decrypt the app, I've found their deep linking information: Although the list has various items, the ones that are useful & functional are

you
profile/memberId
group/groupId

There appears to be no deep linking method for getting to companies, which seems a little strange, but it's how they've built it

I have tried jumping to the activity with setClassName(), but that always crashes as I don't think it's available from the outside

It appears as though the only way to properly get to a company pages is by using linkedin-j

I hope this helps someone



来源:https://stackoverflow.com/questions/24926588/could-not-open-linkedin-app-with-company-profile-url-by-another-android-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!