0

有谁知道我是否可以在我的 iOS 应用程序中有一个指向微信帐户的深层链接?我有一个微信开发者账户(中文账户),只是想检查是否有办法在我的 iOS 应用程序中深度链接微信账户。那么有没有办法在我的 iOS 应用程序中深度链接到微信帐户聊天?

4

1 回答 1

0

您可以使用 url 方案从您的 iOS 应用程序中打开另一个 iOS 应用程序。

找到下面的代码以在按下按钮时从您的应用程序中打开微信应用程序。

- (void)buttonPressed:(UIButton *)button
{
  NSString *customURL = @"weixin://";

  if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:customURL]])
  {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:customURL]];
  }
  else
  {
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"URL error"
                              message:[NSString stringWithFormat:@"No custom URL defined for %@", customURL]
                              delegate:self cancelButtonTitle:@"Ok" 
                              otherButtonTitles:nil];
    [alert show];
  }

}

参考苹果文档

另一个答案

于 2015-08-25T06:59:45.690 回答