Custom URL link for linked in app

泪湿孤枕 提交于 2020-01-14 05:26:49

问题


I am trying to open, linkedin app from my ios app. It is getting opened but with the user's home page. I want it to open with some profile. How can i send the profile id or name with custom url.


回答1:


try this:

NSString *actionUrl = @"linkedin://#profile/52458178";
NSString *actionUrlWeb = @"http://www.linkedin.com/in/chetankedawat";

BOOL canOpenURL = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:actionUrl]];

if (canOpenURL){
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:actionUrl]];
} else {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:actionUrlWeb]];
}


来源:https://stackoverflow.com/questions/25970370/custom-url-link-for-linked-in-app

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