相关疑难解决方法(0)

自定义扩展文件未在iMessage中打开

在我的应用程序中,我需要将一些自定义数据文件从一个设备发送到另一个设备,我正在尝试使用Mail,iMessage/Message和Airdrop.

这适用于Mail和Airdrop但使用iMessage并且它很好,但在接收端,我无法打开文件.它只是不允许我对它做任何事情.

有任何想法吗??

这就是我的文档类型:

<key>CFBundleDocumentTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeIconFile</key>
            <string>abc.png</string>
            <key>CFBundleTypeName</key>
            <string>ABC Custom Data type</string>
            <key>CFBundleTypeRole</key>
            <string>Viewer</string>
            <key>Handler Rank</key>
            <string>Owner</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>com.company.abc.wd</string>
            </array>
        </dict>
    </array>
Run Code Online (Sandbox Code Playgroud)

这就是我发送数据的方式:

NSMutableDictionary * dict = [NSMutableDictionary dictionary];
[dict setObject:currentDataSet forKey:@"actualData"];
NSData * meetingData = [NSKeyedArchiver archivedDataWithRootObject:dict];

Meeting * dataItem = [[Meeting alloc]initWithData:meetingData
               type:@"com.abc.xyz.wd" subject:@"Meeting"
          previewImage:[UIImage imageNamed:@"appIcon.png"]];

UIActivityViewController * activityController =
  [[UIActivityViewController alloc]initWithActivityItems:@[dataItem]
                                   applicationActivities:nil];

activityController.excludedActivityTypes =
       @[UIActivityTypePostToTwitter, UIActivityTypePostToWeibo];

[self presentViewController:activityController animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)

objective-c ios imessage ios7

18
推荐指数
2
解决办法
2079
查看次数

标签 统计

imessage ×1

ios ×1

ios7 ×1

objective-c ×1