How can open LinkedIn Comapny Url in iPhone app programmatically?

旧街凉风 提交于 2019-12-30 11:24:09

问题


I want open LinkedIn company Url from my iPhone app to LinkedIn app by using programmatically. I am use following code but not working please help me ....

string = [NSString stringWithFormat:@"linkedin://company/COMPANY_ID"];

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:string]]; 

回答1:


Reaplce your code like this:

     NSString *string = [NSString stringWithFormat:@"http://www.linkedin.com/your_companyName/Your_COMPANY_ID"];//if dyanmic then pass it as a parameter.

     NSURL *url = [NSURL URLWithString:string];

     [[UIApplication sharedApplication] openURL:url];



回答2:


The following works fine with the current linkedIn App as of date of posting.

NSString *string = [NSString stringWithFormat:@"linkedin://company/%@", companyID];
NSURL *url = [NSURL URLWithString:string];
[[UIApplication sharedApplication] openURL:url];

This will open the linkedIn app, prompting for login if not already and show the company page for the given companyID.




回答3:


You misuse the Format, I think what you wanted it to do should be done like this:

string = [NSString stringWithFormat:@"linkedin://%@/%@", company, COMPANY_ID];

assuming that company and COMPANY_ID are some strings you declared elsewhere.



来源:https://stackoverflow.com/questions/17466385/how-can-open-linkedin-comapny-url-in-iphone-app-programmatically

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