我正在编写一个拥有本地保存视频(.mov)的iOS应用程序.我正试图通过UIActivityViewController附加视频.它适用于电子邮件.视频已成功附加和发送.保存到相机胶卷时也可以使用.
附加到Messages时它不起作用.仅显示文本.Twitter和Facebook甚至都没有出现.当我删除视频附件时,Twitter和Facebook终于开始显示.我真的不太关心消息,但有人能告诉我Facebook和Twitter没有出现的原因吗?
继承我的代码:
- (IBAction) shareVideo {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *URL = [documentsDirectory stringByAppendingPathComponent:demoName];
NSString* someText = demoName;
NSURL *urlToShare = [NSURL fileURLWithPath:URL isDirectory:NO];
NSArray* dataToShare = @[someText, urlToShare];
UIActivityViewController* activityViewController =
[[UIActivityViewController alloc] initWithActivityItems:dataToShare
applicationActivities:nil];
activityViewController.excludedActivityTypes = @[UIActivityTypePrint,UIActivityTypeCopyToPasteboard,UIActivityTypeAssignToContact];
activityViewController.completionHandler = ^(NSString *activityType, BOOL completed) {
//if (completed) {
[self dismissViewControllerAnimated:YES completion:nil];
//}
};
[self presentViewController:activityViewController animated:YES completion:nil];
}
Run Code Online (Sandbox Code Playgroud) 尝试将小型FileStream传递给我的WCF服务时,我得到"此流不支持超时"错误.谁能看到我做错了什么?
接口:
[OperationContract]
List<SystemClass> ReadExcelFile(System.IO.FileStream stream);
Run Code Online (Sandbox Code Playgroud)
Web.Config中
<bindings>
<basicHttpBinding>
<binding name="streaming" maxReceivedMessageSize="2147483647" transferMode="Streamed">
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="MISDashboard.wcfService" behaviorConfiguration="">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="streaming" contract="MISDashboard.wcfService"></endpoint>
</service>
</services>
...
<httpRuntime maxRequestLength="2147483647"/>
Run Code Online (Sandbox Code Playgroud) 我正在尝试在 WCF 服务中检索登录的 Windows 用户。我尝试过使用 ServiceSecurityContext 但 Current 始终为空。
ServiceSecurityContext.Current.WindowsIdentity.Name
Run Code Online (Sandbox Code Playgroud)
我也尝试过使用OperationContext。在这种情况下,ServiceSecurityContext 返回 null。
OperationContext.Current.ServiceSecurityContext.PrimaryIdentity.Name
Run Code Online (Sandbox Code Playgroud)
这是我的 web.config:
<bindings>
<basicHttpBinding>
<binding name="HttpWindowsBinding">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</binding>
</basicHttpBinding>
</bindings>
Run Code Online (Sandbox Code Playgroud)
还
<authentication mode="Windows"/>
Run Code Online (Sandbox Code Playgroud)
谁能看到我做错了什么吗?
更新:我放弃了让 ServiceSecurityContext 工作的尝试。最后,我通过设置aspNetCompatibilityEnabled =“true”找到了解决方案。
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" />
Run Code Online (Sandbox Code Playgroud)
我还在我的服务类中添加了以下属性:
[System.ServiceModel.Activation.AspNetCompatibilityRequirements(RequirementsMode = System.ServiceModel.Activation.AspNetCompatibilityRequirementsMode.Required)]
Run Code Online (Sandbox Code Playgroud)
这允许我通过以下方式检索 Windows 用户:
HttpContext.Current.User.Identity.Name
Run Code Online (Sandbox Code Playgroud) 我一直在使用postMessage从iFrame到CRM进行一段时间的通信.它在CRM 2011和CRM 2015中有效,但它不再适用于CRM 2016.
iFrame javascript代码:
var pass_data = {
'refresh': 'false',
'expand': 'true'
};
window.parent.postMessage(JSON.stringify(pass_data), 'crm url');
Run Code Online (Sandbox Code Playgroud)
CRM javascript:
function setListener() {
if (window.XMLHttpRequest) {
//for browsers other than ie
window.addEventListener("message", receivePostMessage, false);
} else {
//ie
window.attachEvent('onmessage',receivePostMessage);
}
}
function receivePostMessage(event) {
//do something with event.data
var pass_data = JSON.parse(event.data);
alert(pass_data);
}
Run Code Online (Sandbox Code Playgroud)
setListener()在页面加载时被调用,我已经确认它正被调用.我已经尝试使用"*"作为目标原点,它仍然无法正常工作.
有谁知道这在CRM 2016中是否仍然是一个可行的选择?
javascript iframe postmessage dynamics-crm dynamics-crm-2016
wcf ×2
attachment ×1
dynamics-crm ×1
filestream ×1
iframe ×1
ios ×1
iphone ×1
javascript ×1
postmessage ×1
silverlight ×1
video ×1