【问题标题】:Open wechat app account (chat conversation) in iOS app在 iOS 应用中打开微信应用帐户(聊天对话)
【发布时间】:2015-08-24 01:44:23
【问题描述】:

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

【问题讨论】:

  • 深度链接是什么意思?您想在移动应用中使用我们聊天的什么功能?
  • @Bluewings 有没有办法在 ios 应用上将用户转移到微信应用?当用户点击我的应用上的按钮时?

标签: html ios wechat


【解决方案1】:

您可以使用 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];
  }

}

参考Apple documentation

另一个SO Answer

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-28
    • 2023-03-28
    • 2019-04-29
    • 1970-01-01
    相关资源
    最近更新 更多