【发布时间】:2013-04-02 07:20:05
【问题描述】:
我有一个推送通知到达我的 iOS 应用程序,该应用程序具有轨道 ID。我能够成功地将声音云应用程序打开到正确的轨道,但如果设备没有安装声音云应用程序,我想在移动 Safari 中打开该轨道。以下是我正在使用的代码:
NSString *soundCloudApp = @"soundcloud:tracks:";
NSString *soundCloudUrl = @"https://api.soundcloud.com/tracks";
NSURL *fanPageURL = [NSURL URLWithString:[soundCloudApp stringByAppendingString:data]];
if (![[UIApplication sharedApplication] openURL: fanPageURL]) {
//fanPageURL failed to open. Open the website in Safari instead
NSURL *webURL = [NSURL URLWithString:[soundCloudUrl stringByAppendingString:data]];
[[UIApplication sharedApplication] openURL: webURL];
}
问题是,如果我在https://api.soundcloud.com/tracks/my_track_id sound cloud 之类的东西中返回未经授权的访问。如果我尝试https://soundcloud.com/tracks/my_track_id 我找不到页面。任何方式我都可以在 safari 中只给定轨道 id 打开轨道?
谢谢!
【问题讨论】:
标签: ios web soundcloud url-scheme