![]() |
1
36
1)安装本地服务器
RoutingHTTPServer
3)为mobileconfig文件(文档)配置本地根路径:
4)为了让Web服务器有时间发送文件,请添加以下内容:
5)在控制器中,使用存储在文档中的mobileconfig的名称调用safari:
|
![]() |
2
27
来自Malinois的答案对我有效,但是,我想要一个在用户安装MobileConfig后自动返回应用程序的解决方案。 我花了4个小时,但这里有一个解决方案,建立在Malinois拥有一个本地HTTP服务器的想法上:将HTML返回给Safari,Safari会自我刷新;服务器第一次返回MobileConfig,第二次返回自定义URL方案以返回应用程序。用户体验是我想要的:应用程序调用safari,safari打开mobileconfig,当用户在mobileconfig上点击“完成”时,safari再次加载你的应用程序(自定义url方案)。
…下面是从应用程序(即viewcontroller)调用此函数的代码:
希望这能帮助别人。 |
![]() |
3
6
我已经编写了一个类,用于通过safari安装mobileconfig文件,然后返回应用程序。它依赖于http服务器引擎 Swifter 我发现效果很好。 我想在下面分享我的代码。它的灵感来自于我在www上找到的多个代码源,所以如果你找到了自己的代码片段,就贡献给你。
|
![]() |
4
4
我认为您需要的是使用简单证书注册协议(SCEP)的“空中注册”。看看 OTA Enrollment Guide 以及 Enterprise Deployment Guide . 根据 Device Config Overview 你只有四个选择:
|
![]() |
6
0
你有没有试过让应用程序在第一次启动时就把配置文件发给用户? -(IBAction)mailConfigProfile { MFMailComposeViewController *email = [[MFMailComposeViewController alloc] init]; email.mailComposeDelegate = self; [email setSubject:@"My App's Configuration Profile"]; NSString *filePath = [[NSBundle mainBundle] pathForResource:@"MyAppConfig" ofType:@"mobileconfig"]; NSData *configData = [NSData dataWithContentsOfFile:filePath]; [email addAttachmentData:configData mimeType:@"application/x-apple-aspen-config" fileName:@"MyAppConfig.mobileconfig"]; NSString *emailBody = @"Please tap the attachment to install the configuration profile for My App."; [email setMessageBody:emailBody isHTML:YES]; [self presentModalViewController:email animated:YES]; [email release]; } 我做了一个iBaction,以防你想把它绑定到一个按钮上,这样用户就可以随时将它重新发送给自己。注意,在上面的例子中,我可能没有正确的mime类型,您应该验证一下。 |
![]() |
7
0
我想到了另一种可能的工作方式(不幸的是,我没有一个配置文件来测试): // Create a UIViewController which contains a UIWebView - (void)viewDidLoad { [super viewDidLoad]; // Tells the webView to load the config profile [self.webView loadRequest:[NSURLRequest requestWithURL:self.cpUrl]]; } // Then in your code when you see that the profile hasn't been installed: ConfigProfileViewController *cpVC = [[ConfigProfileViewController alloc] initWithNibName:@"MobileConfigView" bundle:nil]; NSString *cpPath = [[NSBundle mainBundle] pathForResource:@"configProfileName" ofType:@".mobileconfig"]; cpVC.cpURL = [NSURL URLWithString:cpPath]; // Then if your app has a nav controller you can just push the view // on and it will load your mobile config (which should install it). [self.navigationController pushViewController:controller animated:YES]; [cpVC release]; |
![]() |
8
0
不确定为什么需要配置配置文件,但可以尝试从uiwebview中破解此委托:
否则,可以考虑从安全服务器启用安装。 |
![]() |
9
0
只需将文件托管在扩展名为*.mobileconfig的网站上,并将mime类型设置为application/x-apple-aspen-config。系统将提示用户,但如果用户接受,则应安装配置文件。 不能以编程方式安装这些配置文件。 |
![]() |
10
0
这是一条很好的线索,尤其是博客 mentioned above . 对于那些做香豆素的人,这是我加的2美分。我将叶证书作为内容嵌入到我的应用程序中,然后使用以下代码进行检查:
(伙计,我喜欢这段代码有多干净,而不是苹果的任何一种语言) |
![]() |
user2606782 · 限制子视图在superview边界内的移动 7 年前 |