How can open LinkedIn Comapny Url in iPhone app programmatically?

前端 未结 3 1179
离开以前
离开以前 2021-01-14 21:26

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 ....

st         


        
相关标签:
3条回答
  • 2021-01-14 21:54

    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.

    0 讨论(0)
  • 2021-01-14 21:58

    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.

    0 讨论(0)
  • 2021-01-14 21:59

    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];
    
    0 讨论(0)
提交回复
热议问题