gpt4 book ai didi

ios - iTunes Store 作为模态视图

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:21:58 26 4
gpt4 key购买 nike

我想在我的应用程序中打开一些 iTunes 歌曲的链接,但我不想从我的应用程序重定向到应用程序商店。我想打开 iTunes Store 作为模态视图,就像 Facebook 在您按下赞助应用程序时所做的那样。我该怎么做? (在带有 WebView 的“自制”模态视图中??我希望不是)

例如如何打开此链接作为模态视图,用户可以在那里购买:@"https://itunes.apple.com/us/album/how-i-feel/id731197191?i =731197197&ign-mpt=uo%3D4"

现在我正在使用这个:

[[UIApplication sharedApplication]
openURL:[NSURL URLWithString:@"itms://itunes.apple.com/us/album/how-i-feel/id731197191?i=731197197&uo=4"]];

当然它不会在模态视图中打开。

最佳答案

好的,所以我的问题已经解决了,我不会删除我的问题,因为我没有在堆栈溢出中找到它:

SKStoreProductViewController *storeProductViewController = [[SKStoreProductViewController alloc] init];

[storeProductViewController setDelegate:self];
[storeProductViewController loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier : @"731197191"} completionBlock:^(BOOL result, NSError *error) {
if (error) {
NSLog(@"Error %@ with User Info %@.", error, [error userInfo]);

} else {
// Present Store Product View Controller
[self presentViewController:storeProductViewController animated:YES completion:nil];
}
}];

关于ios - iTunes Store 作为模态视图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23982989/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com